Zero to the zero power: Difference between revisions
Content deleted Content added
Thundergnat (talk | contribs) m syntax highlighting fixup automation |
|||
Line 37:
=={{header|11l}}==
<syntaxhighlight lang
{{out}}
Line 45:
=={{header|8th}}==
<
0 0 ^ .
</syntaxhighlight>
{{out}}
1
Line 56:
=={{header|Action!}}==
{{libheader|Action! Tool Kit}}
<
PROC Main()
Line 69:
PrintR(z) Print("=")
PrintRE(res)
RETURN</
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Zero_to_the_zero_power.png Screenshot from Atari 8-bit computer]
Line 77:
=={{header|Ada}}==
<
Ada.Long_Long_Integer_Text_IO, Ada.Float_Text_IO, Ada.Long_Float_Text_IO,
Ada.Long_Long_Float_Text_IO;
Line 108:
Put (LLF ** Zero); New_Line;
end Test5;
</syntaxhighlight>
{{out}}
<pre>Integer 0^0 = 1
Line 120:
=={{header|ALGOL 68}}==
{{works with|ALGOL 68G|Any - tested with release 2.6.win32}}
<
</syntaxhighlight>
{{out}}
<pre>
Line 128:
=={{header|APL}}==
<
1</
=={{header|AppleScript}}==
<syntaxhighlight lang
{{output}}
<syntaxhighlight lang
=={{header|Applesoft BASIC}}==
Line 145:
=={{header|Arturo}}==
<
print 0.0 ^ 0</
{{out}}
Line 154:
=={{header|Asymptote}}==
<
=={{header|AutoHotkey}}==
<syntaxhighlight lang
{{out}}
<pre>1</pre>
=={{header|AWK}}==
<syntaxhighlight lang="awk">
# syntax: GAWK -f ZERO_TO_THE_ZERO_POWER.AWK
BEGIN {
Line 168:
exit(0)
}
</syntaxhighlight>
{{out}}
<pre>
Line 175:
=={{header|BaCon}}==
<syntaxhighlight lang
{{out}}
Line 183:
=={{header|BASIC}}==
==={{header|BASIC256}}===
<
==={{header|QBasic}}===
{{works with|QBasic|1.1}}
{{works with|QuickBasic|4.5}}
<
==={{header|True BASIC}}===
{{works with|QBasic}}
<
END</
=={{header|BBC BASIC}}==
<
{{out}}
Line 205:
=={{header|Bc}}==
<syntaxhighlight lang="bc">
0 ^ 0
</syntaxhighlight>
{{out}}
1
Line 216:
Note that the result is potentially dependent on the underlying language of the interpreter, but all those tested so far have returned 1. Interpreters that don't support '''Befunge-98''', or don't support this fingerprint, should just terminate (possibly with a warning).
<
{{out}}
Line 223:
=={{header|BQN}}==
BQN doesn't specify the details of arithmetic functions; existing implementations use IEEE doubles and the <code>pow</code> function, giving a result of 1.
<syntaxhighlight lang
{{out}}
<pre>1</pre>
=={{header|Bracmat}}==
<syntaxhighlight lang
{{out}}
<pre>1</pre>
=={{header|Burlesque}}==
<
blsq ) 0.0 0.0?^
1.0
blsq ) 0 0?^
1
</syntaxhighlight>
=={{header|C}}==
Line 244:
This example uses the standard <code>pow</code> function in the math library.
0^0 is given as 1.
<
#include <math.h>
#include <complex.h>
Line 254:
printf("0+0i ^ 0+0i = %f+%fi\n", creal(c), cimag(c));
return 0;
}</
{{out}}
Line 263:
=={{header|C sharp|C#}}==
<
namespace ZeroToTheZeroeth
Line 275:
}
}
}</
{{out}}
Line 283:
=={{header|C++}}==
<
#include <cmath>
#include <complex>
Line 293:
std::pow(std::complex<double>(0),std::complex<double>(0)) << std::endl;
return 0;
}</
{{out}}
Line 302:
=={{header|Caché ObjectScript}}==
<
// default behavior is incorrect:
set (x,y) = 0
Line 311:
w !,"0 to the 0th power (right): "_(x**y)
quit</
{{out}}<pre>SAMPLES>do ^ZEROPOW
Line 333:
1 in my case could just be an implementation detail.
<
zz_int: int := 0 ** 0
zz_real: real := 0.0 ** 0.0
Line 340:
stream$putl(po, "integer 0**0: " || int$unparse(zz_int))
stream$putl(po, "real 0**0: " || f_form(zz_real, 1, 1))
end start_up</
{{out}}
<pre>integer 0**0: 1
Line 346:
=={{header|COBOL}}==
<
program-id. zero-power-zero-program.
data division.
Line 354:
compute n = 0**0.
display n upon console.
stop run.</
{{out}}
<pre>1</pre>
Line 360:
=={{header|ColdFusion}}==
=== Classic tag based CFML ===
<
<cfset zeroPowerTag = 0^0>
<cfoutput>"#zeroPowerTag#"</cfoutput>
</syntaxhighlight>
{{Output}}
<pre>
Line 370:
=== Script Based CFML ===
<
zeroPower = 0^0;
writeOutput( zeroPower );
</cfscript></
{{Output}}
<pre>
Line 397:
=={{header|Crystal}}==
<
puts "Negative Int32: #{-0_i32**-0_i32}"
puts "Float32: #{0_f32**0_f32}"
puts "Negative Float32: #{-0_f32**-0_f32}"</
{{Output}}
Line 409:
=={{header|D}}==
<
import std.stdio, std.math, std.bigint, std.complex;
Line 420:
writeln("BigInt: ", 0.BigInt ^^ 0);
writeln("Complex: ", complex(0.0, 0.0) ^^ 0);
}</
{{out}}
<pre>Int: 1
Line 432:
=={{header|Dc}}==
<
</syntaxhighlight>
{{Output}}
<pre>
Line 444:
=={{header|EasyLang}}==
<syntaxhighlight lang="text">print pow 0 0</
=={{header|EchoLisp}}==
<
;; trying the 16 combinations
;; all return the integer 1
Line 455:
(for* ((z1 zeroes) (z2 zeroes)) (write (expt z1 z2)))
→ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
</syntaxhighlight>
=={{header|Eiffel}}==
<syntaxhighlight lang
{{out}}
<pre>1</pre>
Line 464:
=={{header|Elena}}==
ELENA 4.x
<
public program()
{
console.printLine("0^0 is ",0.power:0)
}</
{{out}}
<pre>
Line 477:
=={{header|Elixir}}==
Elixir uses Erlang's <code>:math</code> for power operations and can handle zero to the zero power.
<syntaxhighlight lang="elixir">
:math.pow(0,0)
</syntaxhighlight>
{{out}}
1.0
=={{header|Emacs Lisp}}==
<syntaxhighlight lang
{{out}}
1
=={{header|ERRE}}==
<syntaxhighlight lang="erre">
.....
PRINT(0^0)
.....
</syntaxhighlight>
{{out}}
<pre> 1
Line 505:
=={{header|Factor}}==
<
0 0 ^
C{ 0 0 } C{ 0 0 } ^complex</
{{out}}
<pre>--- Data stack:
Line 515:
=={{header|Falcon}}==
'''VBA/Python programmer's approach not sure if it's the most falconic way'''
<
/* created by Aykayayciti Earl Lamont Montgomery
April 9th, 2018 */
Line 524:
> "z=", z
</syntaxhighlight>
{{out}}
<pre>
Line 532:
=={{header|Fermat}}==
<syntaxhighlight lang
{{out}}<pre>1</pre>
=={{header|Forth}}==
<syntaxhighlight lang
{{out}}
Line 543:
Of course in an embedded program we would be tempted to "pre-calculate" the answer :-)
<
{{Output}}
Line 552:
=={{header|Fortran}}==
<syntaxhighlight lang="fortran">
program zero
double precision :: i, j
Line 564:
write(*,*) 'When complex numbers are used, we have (0.0+0.0i)^(0.0+0.0i) = ', z1**z2
end program
</syntaxhighlight>
{{out}}
<pre>
Line 573:
=={{header|FreeBASIC}}==
<
Print "0 ^ 0 ="; 0 ^ 0
Sleep</
{{out}}
Line 584:
=={{header|Frink}}==
<syntaxhighlight lang
{{out}}
Line 593:
=={{header|FutureBasic}}==
<
print 0^0
HandleEvents</
Output:
<pre>
Line 605:
=={{header|Gambas}}==
'''[https://gambas-playground.proko.eu/?gist=7d505dbe89227e9b4423f92ef12d6829 Click this link to run this code]'''
<
Print 0 ^ 0
End</
Output:
<pre>
Line 616:
=={{header|GAP}}==
<syntaxhighlight lang
{{out}}<pre>1</pre>
Line 622:
Go does not have an exponentiation operator but has functions in the standard library for three types, float64, complex128, and big.Int.
As of Go 1.3, all are documented to return 1.
<
import (
Line 636:
fmt.Println("big integer:", b.Exp(&b, &b, nil))
fmt.Println("complex: ", cmplx.Pow(0, 0))
}</
{{out}}
<pre>
Line 647:
{{trans|Java}}
Test:
<syntaxhighlight lang
{{out}}
<pre>1</pre>
=={{header|GW-BASIC}}==
<syntaxhighlight lang
{{out}}<pre>1</pre>
=={{header|Haskell}}==
<
main = do
Line 664:
print $ 0 ** 0
print $ (0 :+ 0) ^ 0
print $ (0 :+ 0) ** (0 :+ 0)</
{{out}}
<pre>
Line 676:
=={{header|HolyC}}==
<
Print("0 ` 0 = %5.3f\n", a);</
{{out}}
Line 687:
"Works" in both languages:
<
write(0^0)
end</
{{out}}
Line 705:
=={{header|J}}==
<
1</
=={{header|Java}}==
<
{{out}}
<pre>1.0</pre>
Line 717:
{{Works with|Node.js}}
In interactive mode:
<
1</
===exponentiation operator (**)===
<
1</
=={{header|jq}}==
Line 728:
a definition that makes a special case of 0^0 should be considered, e.g.
along the following lines:
<
This definition will however be unsatisfactory for many purposes
Line 734:
=={{header|Jsish}}==
<
{{out}}
<pre>1</pre>
Line 740:
=={{header|Julia}}==
Try all combinations of complex, float, rational, integer and boolean.
<
const types = (Complex, Float64, Rational, Int, Bool)
Line 748:
r = zb ^ ze
@printf("%10s ^ %-10s = %7s ^ %-7s = %-12s (%s)\n", Tb, Te, zb, ze, r, typeof(r))
end</
{{out}}
Line 778:
=={{header|K}}==
<syntaxhighlight lang="k">
0^0
1.0
</syntaxhighlight>
=={{header|Klingphix}}==
<
dup not (
[ drop sign dup 0 equal [ drop 1 ] if ]
Line 793:
0 0 mypower print nl
"End " input</
{{out}}
<pre>1
Line 799:
=={{header|Kotlin}}==
<
fun main(args: Array<String>) {
println("0 ^ 0 = ${Math.pow(0.0, 0.0)}")
}</
{{out}}
Line 811:
=={{header|Lambdatalk}}==
<syntaxhighlight lang="scheme">
{pow 0 0}
-> 1
{exp 0 0}
-> 1
</syntaxhighlight>
=={{header|Liberty BASIC}}==
<syntaxhighlight lang="lb">
'********
print 0^0
'********
</syntaxhighlight>
{{out}}
<pre>1</pre>
Line 829:
=={{header|Locomotive Basic}}==
<syntaxhighlight lang
{{out}}
<pre> 1</pre>
Line 835:
=={{header|Lua}}==
No need to try different data types or with / without decimal points as all numbers in Lua are stored in double-precision floating-point format.
<syntaxhighlight lang
{{out}}
<pre>1</pre>
Line 841:
=={{header|M2000 Interpreter}}==
M2000 use ** and ^ for power.
<syntaxhighlight lang="m2000 interpreter">
Module Checkit {
x=0
Line 848:
}
Checkit
</syntaxhighlight>
=={{header|Maple}}==
<syntaxhighlight lang
{{out}}
<pre>1</pre>
However, for consistency with IEEE-754 numerics, we also have a NaN result for the equivalent floating-point exponentiation:
<syntaxhighlight lang
{{out}}
<pre>Float(undefined)</pre>
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<syntaxhighlight lang
{{out}}
<pre>Indeterminate</pre>
=={{header|MATLAB}} / {{header|Octave}}==
<syntaxhighlight lang="matlab">0^0
complex(0,0)^0</
{{out}}
<pre>1
1</pre>
=={{header|Maxima}}==
<syntaxhighlight lang
{{out}}<pre> 0
expt: undefined: 0</pre>
=={{header|Mercury}}==
<
:- interface.
Line 894:
io.format(" float.pow(0.0, 0) = %.1f\n", [f(pow(0.0, 0))], !IO).
:- end_module zero_to_the_zero_power.</
{{out}}
<pre> int.pow(0, 0) = 1
Line 901:
=={{header|Microsoft Small Basic}}==
<
{{out}}<pre>1</pre>
=={{header|min}}==
{{works with|min|0.19.3}}
<syntaxhighlight lang
{{out}}
<pre>
Line 913:
=={{header|MiniScript}}==
<
{{out}}
<pre>
Line 920:
=={{header|МК-61/52}}==
<syntaxhighlight lang="text">Сx ^ x^y С/П</
The result is error message.
=={{header|Nanoquery}}==
<syntaxhighlight lang
{{out}}
<pre>1</pre>
Line 932:
Neko uses the C math library for exponentiation, Zero to the zero in math.pow(x, y) is treated as being 1.
<syntaxhighlight lang="actionscript">/**
Zero to the zeroth power, in Neko
*/
Line 938:
var math_pow = $loader.loadprim("std@math_pow", 2)
$print(math_pow(0, 0), "\n")</
{{out}}
Line 946:
=={{header|NetRexx}}==
<
Say '0**0='||x**x</
{{out}}
<pre>0**0=1</pre>
=={{header|NewLISP}}==
<syntaxhighlight lang
{{out}}
<pre>1</pre>
Line 960:
Create an exponentiation table for all type combinations (of integer <code>0</code>, float <code>0.0</code> and boolean <code>o</code>):
<
+--+--+--+
| 1|1.| 1|
Line 967:
+--+--+--+
| 1|1.| 1|
+--+--+--+</
=={{header|Nim}}==
<
echo pow(0.0, 0.0) # Floating point exponentiation.
echo 0 ^ 0 # Integer exponentiation.</
{{out}}
<pre>1.0
Line 993:
=={{header|Oforth}}==
<syntaxhighlight lang
{{out}}
Line 1,001:
=={{header|Ol}}==
<
(print "0^0: " (expt 0 0))
(print "0.0^0: " (expt (inexact 0) 0))
</syntaxhighlight>
{{out}}
<pre>
Line 1,012:
=={{header|ooRexx}}==
<
* 21.04.2014 Walter Pachl
**********************************************************************/
Say 'rxCalcpower(0,0) ->' rxCalcpower(0,0)
Say '0**0 ->' 0**0
::requires rxmath library</
{{out}}
<pre>
Line 1,026:
=={{header|Openscad}}==
<syntaxhighlight lang
=={{header|PARI/GP}}==
0 raised to the power of exact 0 is 0, but 0 cannot be raised to the power of an inexact 0:
<
0.^0
0^0.</
{{out}}
<pre>%1 = 1
Line 1,044:
=={{header|Pascal}}==
{{works with|Free Pascal}} {{Libheader|math}}
<
uses
math;
Line 1,050:
write('0.0 ^ 0 :',IntPower(0.0,0):4:2);
writeln(' 0.0 ^ 0.0 :',Power(0.0,0.0):4:2);
end.</
;output:
<pre>0.0 ^ 0 :1.00 0.0 ^ 0.0 :1.00</pre>
=={{header|Perl}}==
<
use Math::Complex;
print cplx(0,0) ** cplx(0,0), "\n";</
{{out}}
<pre>
Line 1,068:
=={{header|Phix}}==
{{libheader|Phix/basics}}
<!--<
<span style="color: #0000FF;">?</span><span style="color: #7060A8;">power</span><span style="color: #0000FF;">(</span><span style="color: #000000;">0</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0</span><span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">requires</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"0.8.4"</span><span style="color: #0000FF;">)</span> <span style="color: #000080;font-style:italic;">-- (now fixed/crashes on earlier versions)</span>
Line 1,077:
<span style="color: #000000;">sb</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">complex_sprint</span><span style="color: #0000FF;">(</span><span style="color: #000000;">b</span><span style="color: #0000FF;">,</span><span style="color: #004600;">true</span><span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">printf</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"%s ^ %s = %s\n"</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">sa</span><span style="color: #0000FF;">,</span><span style="color: #000000;">sa</span><span style="color: #0000FF;">,</span><span style="color: #000000;">sb</span><span style="color: #0000FF;">})</span>
<!--</
{{out}}
<pre>
Line 1,085:
=={{header|Phixmonti}}==
<
dup not if
. sign dup 0 == if . 1 endif
Line 1,093:
enddef
0 0 mypower print</
{{out}}
<pre>1</pre>
=={{header|PHP}}==
<
echo pow(0,0);
echo 0 ** 0; // PHP 5.6+ only
?></
{{out}}
<pre>
Line 1,109:
=={{header|PicoLisp}}==
<syntaxhighlight lang="picolisp">
(** 0 0)
</syntaxhighlight>
{{out}}
1
=={{header|Pike}}==
<
{{Out}}
<pre>
Line 1,123:
=={{header|PL/I}}==
<
Dcl a dec float(10) Init(1);
Dcl b dec float(10) Init(0);
Line 1,129:
Put skip list('0**1=',b**a);
Put skip list('0**0=',b**b);
End;</
{{out}}
<pre>
Line 1,140:
=={{header|Plain English}}==
<
Start up.
Put 0 into a number.
Line 1,147:
Write the string to the console.
Wait for the escape key.
Shut down.</
{{out}}
<pre>
Line 1,155:
=={{header|PowerShell}}==
<
Output :
Line 1,164:
=={{header|PureBasic}}==
<syntaxhighlight lang="purebasic">
If OpenConsole()
PrintN("Zero to the zero power is " + Pow(0,0))
Line 1,172:
CloseConsole()
EndIf
</syntaxhighlight>
{{out}}
Line 1,180:
=={{header|Pyret}}==
<syntaxhighlight lang
{{out}}
1
Line 1,186:
=={{header|Python}}==
===Python3===
<
from fractions import Fraction
from itertools import product
Line 1,196:
except:
ans = '<Exception raised>'
print(f'{i!r:>15} ** {j!r:<15} = {ans!r}')</
{{out}}
<pre> 0 ** 0 = 1
Line 1,264:
===Python2===
<
from fractions import Fraction
for n in (Decimal(0), Fraction(0, 1), complex(0), float(0), int(0)):
Line 1,275:
except:
n2 = '<Raised exception>'
print('%8s: ** -> %r; pow -> %r' % (n.__class__.__name__, n1, n2))</
{{out}}
<pre>
Line 1,286:
=={{header|QB64}}==
<syntaxhighlight lang
{{out}}
<pre>1</pre>
Alternatively:
<
l& = 0 'Long integer
s! = 0.0 'Single precision floating point
Line 1,304:
Print b` ^ b`
Print bb%% ^ bb%%
Print isf&& ^ isf&&</
{{out}}
NB: Values with 0 decimals are trimmed by Print's casting from number value to String.
Line 1,318:
As a dialogue in the Quackery shell.
<
...
Stack: 1
</syntaxhighlight>
=={{header|R}}==
<syntaxhighlight lang
{{out}}
<pre>1</pre>
Line 1,331:
=={{header|Racket}}==
<
;; as many zeros as I can think of...
(define zeros (list
Line 1,344:
(printf "(~a)^(~a) = ~s~%" z p
(with-handlers [(exn:fail:contract:divide-by-zero? exn-message)]
(expt z p))))</
{{out}}
Line 1,388:
{{works with|Rakudo|2018.03}}
<syntaxhighlight lang="raku"
say '-------- -------- -------- --------';
for 0, 0.0, FatRat.new(0), 0e0, 0+0i {
printf "%8s %8s %8s %8s\n", .^name, $_, $_**$_, exp($_,$_);
}</
{{out}}
Line 1,408:
=={{header|Red}}==
Shown using the operator, the function, and the <code>math</code> mini-DSL that uses the order of operations from mathematics:
<
print 0 ** 0
print power 0 0
print math [0 ** 0]</
{{out}}
<pre>
Line 1,420:
=={{header|Relation}}==
<syntaxhighlight lang="relation">
echo pow(0,0)
// 1
</syntaxhighlight>
=={{header|REXX}}==
<
say '0 ** 0 (zero to the zeroth power) ───► ' 0**0</
<br>using PC/REXX
<br>using Personal REXX
Line 1,458:
=={{header|Ring}}==
<
x = 0
y = 0
z = pow(x,y)
see "z=" + z + nl # z=1
</syntaxhighlight>
=={{header|Ruby}}==
<
[0, 0.0, Complex(0), Rational(0), BigDecimal("0")].each do |n|
printf "%10s: ** -> %s\n" % [n.class, n**n]
end</
{{out}}
<pre>
Line 1,481:
=={{header|Rust}}==
<
println!("{}",0u32.pow(0));
}</
{{out}}
Line 1,489:
=={{header|S-lang}}==
<syntaxhighlight lang
{{out}}
<pre>1.0</pre>
=={{header|Scala}}==
{{libheader|Scala}}<
=={{header|Scheme}}==
<
(display (expt 0.0 0.0)) (newline)
(display (expt 0+0i 0+0i)) (newline)</
{{out}}
<pre>1
Line 1,506:
=={{header|Seed7}}==
<
include "float.s7i";
include "complex.s7i";
Line 1,517:
writeln("0.0+0i ** 0 = " <& complex(0.0) ** 0);
end func;
</syntaxhighlight>
{{out}}
Line 1,528:
=={{header|SenseTalk}}==
<
set b to 0
put a to the power of b
// Prints: 1</
=={{header|Sidef}}==
<
say n**n
}</
{{out}}
<pre>
Line 1,546:
Taking the 0'th root of a number and raising it back to the zero power, we also get a 1:
<
say ((0**(1/0))**0) # => 1</
=={{header|Sinclair ZX81 BASIC}}==
<syntaxhighlight lang
{{out}}
<pre>1</pre>
Line 1,556:
=={{header|Smalltalk}}==
<
0 raisedTo: 0
0.0 raisedTo: 0.0
</syntaxhighlight>
{{out}}
<pre>
Line 1,567:
=={{header|smart BASIC}}==
<syntaxhighlight lang
{{out}}
Line 1,576:
=={{header|SNOBOL4}}==
<
END</
=={{header|SQL}}==
<syntaxhighlight lang="sql">
SQL> select power(0,0) from dual;
</syntaxhighlight>
{{out}}
<pre>
Line 1,599:
=={{header|Stata}}==
<
1</
=={{header|Swift}}==
<
print(pow(0.0,0.0))</
{{out}}
<pre>1.0</pre>
=={{header|Symsyn}}==
<syntaxhighlight lang="symsyn">
(0^0) []
</syntaxhighlight>
{{out}}
<pre> 1 </pre>
Line 1,617:
=={{header|Tcl}}==
Interactively…
<
1
% expr 0.0**0.0
1.0</
=={{header|TI-83_BASIC}}==
<syntaxhighlight lang
{{out}}
<pre>ERROR:DOMAIN</pre>
=={{header|uBasic/4tH}}==
<syntaxhighlight lang="text">Print 0^0</
{{out}}
<pre>1
Line 1,636:
=={{header|Ursa}}==
Cygnus/X Ursa is written in Java, and as a result returns 1.0 when raising 0 to the 0.
<
1.0</
=={{header|VBA}}==
<
x = 0
y = 0
z = 0 ^ 0
Debug.Print "z ="; z
End Sub</
<pre>z = 1</pre>
=={{header|VBScript}}==
<syntaxhighlight lang
{{Out}}
<pre>1</pre>
Line 1,655:
=={{header|Verilog}}==
<
initial begin
$display("0 ^ 0 = ", 0**0);
$finish ;
end
endmodule</
{{out}}
<pre>0 ^ 0 = 1</pre>
Line 1,666:
=={{header|Visual Basic .NET}}==
<
Sub Main()
Console.Write(0^0)
End Sub
End Module</
{{out}}
Line 1,676:
=={{header|Vlang}}==
<
// Tectonics: v run zero-to-the-zero-power.v
module main
Line 1,685:
pub fn main() {
println(math.pow(0, 0))
}</
{{out}}<pre>prompt$ v run rosetta/zero-to-the-zero-power.v
1.</pre>
=={{header|Wren}}==
<
{{out}}
Line 1,698:
=={{header|XLISP}}==
<
[1] (expt 0 0)
1
[2] </
=={{header|XPL0}}==
<
{{out}}
<pre> 1.00000</pre>
=={{header|Zig}}==
<
pub fn main() !void {
const stdout = std.io.getStdOut().writer();
try stdout.print("0^0 = {d:.8}\n", .{std.math.pow(f32, 0, 0)});
}</
{{out}}
<pre>0^0 = 1.00000000</pre>
=={{header|zkl}}==
<
var BN=Import("zklBigNum"); // big ints
BN(0).pow(0) //--> 1</
|