A few more Rosetta Code entries to finish the year

User avatar
sarossell
Posts: 195
Joined: Sat Nov 05, 2016 6:31 pm
My devices: iPad Mini 2, iPhone 5, MacBook Air, MacBook Pro
Flag: United States of America
Contact:

A few more Rosetta Code entries to finish the year

Post 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.
smart BASIC Rocks!

- Scott : San Diego, California

User avatar
GeorgeMcGinn
Posts: 435
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10
Location: Venice, FL
Flag: United States of America
Contact:

Re: A few more Rosetta Code entries to finish the year

Post 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.
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)

User avatar
sarossell
Posts: 195
Joined: Sat Nov 05, 2016 6:31 pm
My devices: iPad Mini 2, iPhone 5, MacBook Air, MacBook Pro
Flag: United States of America
Contact:

Re: A few more Rosetta Code entries to finish the year

Post by sarossell »

Yeah, apparently some languages choke on that one. Go figure.
smart BASIC Rocks!

- Scott : San Diego, California

User avatar
GeorgeMcGinn
Posts: 435
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10
Location: Venice, FL
Flag: United States of America
Contact:

Re: A few more Rosetta Code entries to finish the year

Post by GeorgeMcGinn »

Actually, Math chokes on it as well!
sarossell wrote:Yeah, apparently some languages choke on that one. Go figure.
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)

User avatar
sarossell
Posts: 195
Joined: Sat Nov 05, 2016 6:31 pm
My devices: iPad Mini 2, iPhone 5, MacBook Air, MacBook Pro
Flag: United States of America
Contact:

Re: A few more Rosetta Code entries to finish the year

Post by sarossell »

Really? I thought it was defined as equal to 1.
smart BASIC Rocks!

- Scott : San Diego, California

User avatar
GeorgeMcGinn
Posts: 435
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10
Location: Venice, FL
Flag: United States of America
Contact:

Re: A few more Rosetta Code entries to finish the year

Post 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.
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)

User avatar
sarossell
Posts: 195
Joined: Sat Nov 05, 2016 6:31 pm
My devices: iPad Mini 2, iPhone 5, MacBook Air, MacBook Pro
Flag: United States of America
Contact:

Re: A few more Rosetta Code entries to finish the year

Post by sarossell »

Well, I'm honestly not sure what value it is either way. :?
smart BASIC Rocks!

- Scott : San Diego, California

Henko
Posts: 821
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: A few more Rosetta Code entries to finish the year

Post 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 :D

User avatar
sarossell
Posts: 195
Joined: Sat Nov 05, 2016 6:31 pm
My devices: iPad Mini 2, iPhone 5, MacBook Air, MacBook Pro
Flag: United States of America
Contact:

Re: A few more Rosetta Code entries to finish the year

Post by sarossell »

Does it have any use in practical application though? I mean, other than trying to trip up a programming language?
smart BASIC Rocks!

- Scott : San Diego, California

User avatar
GeorgeMcGinn
Posts: 435
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10
Location: Venice, FL
Flag: United States of America
Contact:

Re: A few more Rosetta Code entries to finish the year

Post 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?
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)

Post Reply