Zero to the zero power

From Rosetta Code
Revision as of 21:06, 18 March 2014 by rosettacode>Gerard Schildberger (added a new Rosetta Code task (zero to the zeroth power).)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Zero to the zero power is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

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
  • 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
  • Also, in the above MathWorld (TM) entry, see formula (9):   x0 == 1.



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