Page 1 of 3
A few more Rosetta Code entries to finish the year
Posted: Sun Jan 01, 2017 1:24 am
by sarossell
Hi Gang,
I added a few simple entries on Rosetta. The best way to learn is to teach, and I'm starting out with the simple stuff.
- Loops/For
Loops/For with a specified step
User input/Text
Video display modes
Variables
Zero to the zero power
I hadn't realized how involved the subject of Variables was. Please feel free to check my work and correct any mistakes.
P.S.: I noticed the Rosetta server was experiencing some intermittent down time tonight. Fingers crossed, maybe that means the admin is working on that image upload problem. Still no word though.
Re: A few more Rosetta Code entries to finish the year
Posted: Tue Jan 03, 2017 2:32 am
by GeorgeMcGinn
"Zero to the zero power"?????
sarossell wrote:Hi Gang,
I added a few simple entries on Rosetta. The best way to learn is to teach, and I'm starting out with the simple stuff.
- Loops/For
Loops/For with a specified step
User input/Text
Video display modes
Variables
Zero to the zero power
I hadn't realized how involved the subject of Variables was. Please feel free to check my work and correct any mistakes.
P.S.: I noticed the Rosetta server was experiencing some intermittent down time tonight. Fingers crossed, maybe that means the admin is working on that image upload problem. Still no word though.
Re: A few more Rosetta Code entries to finish the year
Posted: Tue Jan 03, 2017 2:35 am
by sarossell
Yeah, apparently some languages choke on that one. Go figure.
Re: A few more Rosetta Code entries to finish the year
Posted: Tue Jan 03, 2017 9:41 pm
by GeorgeMcGinn
Actually, Math chokes on it as well!
sarossell wrote:Yeah, apparently some languages choke on that one. Go figure.
Re: A few more Rosetta Code entries to finish the year
Posted: Tue Jan 03, 2017 9:43 pm
by sarossell
Really? I thought it was defined as equal to 1.
Re: A few more Rosetta Code entries to finish the year
Posted: Wed Jan 04, 2017 12:52 am
by GeorgeMcGinn
Nope. It actually becomes a ZERO in formulas, but raising anything by a power of zero is an invalid math expression, and always results in a zero.
George.
sarossell wrote:Really? I thought it was defined as equal to 1.
Re: A few more Rosetta Code entries to finish the year
Posted: Wed Jan 04, 2017 12:53 am
by sarossell
Well, I'm honestly not sure what value it is either way.

Re: A few more Rosetta Code entries to finish the year
Posted: Wed Jan 04, 2017 7:31 am
by Henko
GeorgeMcGinn wrote:Nope. It actually becomes a ZERO in formulas, but raising anything by a power of zero is an invalid math expression, and always results in a zero.
George.
sarossell wrote:Really? I thought it was defined as equal to 1.
Raising a non-zero value to a power of zero is certainly a valid math expression and equals 1,
Which can be proved by taking logarithms and apply the limit.
Sarossell wins this math contest

Re: A few more Rosetta Code entries to finish the year
Posted: Wed Jan 04, 2017 4:25 pm
by sarossell
Does it have any use in practical application though? I mean, other than trying to trip up a programming language?
Re: A few more Rosetta Code entries to finish the year
Posted: Sat Jan 07, 2017 5:35 am
by GeorgeMcGinn
OK, I'm eating crow...
I had just taken a math refresher course due to my work in cosmology (I do a lot of programming in that field as well as astronomical observations) and the teach said that raising by 0 isn't good math, which I interprested as an invalid expression.
I was told "So when we raise a number to the zeroth power, that means we multiply the number by itself zero times - but that means we're not multiplying anything at all." You can see why I did not question the teacher!
Before my post yesterday I tried doing it in an app called MyScript (an excellent formula app where you can hand write it and it cleans it up for you) and it had issues with it. Today, I got 1. Now I am confused.
And ketchup doesn't help with the taste of crow
But I do have the same question as to what use does raising something to the power of zero have? Because if you multiply X by 0, the answer is always zero.
George.
sarossell wrote:Does it have any use in practical application though? I mean, other than trying to trip up a programming language?