Zero to the zero power
Some programming languages are not exactly consistent (with other programming languages) when raising zero to the zeroth power 00.
task requirements
Show the results of raising zero to the zeroth power.
If your computer language objects to 0**0 at compile time, you may also try something like: <lang rexx>x = 0 y = 0 z = x**y ··· show the result ···</lang>
Of course, use any symbols or notation that is supported in your computer language for exponentiation.
- See also
- The Wiki entry: powers_of_zero.
- Also, in the above Wiki entry, scroll down to: Zero to the power of zero.
- Also, in the above Wiki entry, scroll further down to: History of differing points of view
- The MathWorld (TM) entry: exponent laws.
- Also, in the above MathWorld (TM) entry, see formula (9): x0 == 1.
- The OEIS entry: The_special_case_of_zero_to_the_zeroth_power
REXX
using PC/REXX
using Personal REXX
using REGINA
<lang rexx>/*REXX program shows the results of raising zero to the zeroth power.*/
say '0 ** 0 (zero to the zeroth power) ───► ' 0**0</lang>
output
0 ** 0 (zero to the zeroth power) ───► 1
using R4
<lang rexx>∙∙∙ same program ∙∙∙</lang>
output
Error 26 : Invalid whole number (SYNTAX) Information: 0 ** 0 is undefined Error occurred in statement# 2 Statement source: say '0 ** 0 (zero to the zeroth power) ───► ' 0**0 Statement context: C:\ZERO_TO0.REX, procedure: ZERO_TO0
using ROO
<lang rexx>∙∙∙ same program ∙∙∙</lang>
output
Error 26 : Invalid whole number (SYNTAX) Information: 0 ** 0 is undefined Error occurred in statement# 2 Statement source: say '0 ** 0 (zero to the zeroth power) ───► ' 0**0 Statement context: C:\ZERO_TO0.REX, procedure: ZERO_TO0