Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,4 @@
---
category:
- Simple
from: http://rosettacode.org/wiki/Zero_to_the_zero_power

View file

@ -0,0 +1,27 @@
Some computer programming languages are not exactly consistent   (with other computer programming languages)  
<br>when &nbsp; ''raising zero to the zeroth power'': &nbsp; &nbsp; <b><big>0<sup>0</sup></big></b>
;Task:
Show the results of raising &nbsp; zero &nbsp; to the &nbsp; zeroth &nbsp; power.
If your computer language objects to &nbsp; &nbsp; <big> '''0**0''' </big> &nbsp; &nbsp; or &nbsp; &nbsp; <big> '''0^0''' </big> &nbsp; &nbsp; at compile time, &nbsp; you may also try something like:
x = 0
y = 0
z = x**y
say 'z=' z
'''Show the result here.'''<br>
And of course use any symbols or notation that is supported in your computer programming language for exponentiation.
;See also:
* The Wiki entry: [[wp:Zero_to_the_power_of_zero#History|Zero to the power of zero]].
* The Wiki entry: [[wp:Zero_to_the_power_of_zero#History|Zero to the power of zero: History]].
* The MathWorld™ entry: [http://mathworld.wolfram.com/ExponentLaws.html exponent laws].
** Also, in the above MathWorld™ entry, see formula ('''9'''): <math>x^0=1</math>.
* The OEIS entry: [https://oeis.org/wiki/The_special_case_of_zero_to_the_zeroth_power The special case of zero to the zeroth power]
<br><br>

View file

@ -0,0 +1 @@
print(0 ^ 0)

View file

@ -0,0 +1 @@
0 0 ^ .

View file

@ -0,0 +1 @@
print( ( 0 ^ 0, newline ) )

View file

@ -0,0 +1,2 @@
0*0
1

View file

@ -0,0 +1,5 @@
# syntax: GAWK -f ZERO_TO_THE_ZERO_POWER.AWK
BEGIN {
print(0 ^ 0)
exit(0)
}

View file

@ -0,0 +1,14 @@
INCLUDE "D2:REAL.ACT" ;from the Action! Tool Kit
PROC Main()
REAL z,res
Put(125) PutE() ;clear the screen
IntToReal(0,z)
Power(z,z,res)
PrintR(z) Print("^")
PrintR(z) Print("=")
PrintRE(res)
RETURN

View file

@ -0,0 +1,31 @@
with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Long_Integer_Text_IO,
Ada.Long_Long_Integer_Text_IO, Ada.Float_Text_IO, Ada.Long_Float_Text_IO,
Ada.Long_Long_Float_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Long_Integer_Text_IO,
Ada.Long_Long_Integer_Text_IO, Ada.Float_Text_IO, Ada.Long_Float_Text_IO,
Ada.Long_Long_Float_Text_IO;
procedure Test5 is
I : Integer := 0;
LI : Long_Integer := 0;
LLI : Long_Long_Integer := 0;
F : Float := 0.0;
LF : Long_Float := 0.0;
LLF : Long_Long_Float := 0.0;
Zero : Natural := 0;
begin
Put ("Integer 0^0 = ");
Put (I ** Zero, 2); New_Line;
Put ("Long Integer 0^0 = ");
Put (LI ** Zero, 2); New_Line;
Put ("Long Long Integer 0^0 = ");
Put (LLI ** Zero, 2); New_Line;
Put ("Float 0.0^0 = ");
Put (F ** Zero); New_Line;
Put ("Long Float 0.0^0 = ");
Put (LF ** Zero); New_Line;
Put ("Long Long Float 0.0^0 = ");
Put (LLF ** Zero); New_Line;
end Test5;

View file

@ -0,0 +1 @@
return 0 ^ 0

View file

@ -0,0 +1,2 @@
print 0 ^ 0
print 0.0 ^ 0

View file

@ -0,0 +1 @@
write("0 ^ 0 = ", 0 ** 0);

View file

@ -0,0 +1 @@
MsgBox % 0 ** 0

View file

@ -0,0 +1 @@
print "0 ^ 0 = "; 0 ^ 0

View file

@ -0,0 +1 @@
PRINT 0^0

View file

@ -0,0 +1 @@
00

View file

@ -0,0 +1 @@
PRINT POW(0, 0)

View file

@ -0,0 +1 @@
0 ^ 0

View file

@ -0,0 +1 @@
"PDPF"4#@(0F0FYP)@

View file

@ -0,0 +1 @@
0^0

View file

@ -0,0 +1,4 @@
blsq ) 0.0 0.0?^
1.0
blsq ) 0 0?^
1

View file

@ -0,0 +1,11 @@
#include <iostream>
#include <cmath>
#include <complex>
int main()
{
std::cout << "0 ^ 0 = " << std::pow(0,0) << std::endl;
std::cout << "0+0i ^ 0+0i = " <<
std::pow(std::complex<double>(0),std::complex<double>(0)) << std::endl;
return 0;
}

View file

@ -0,0 +1,13 @@
using System;
namespace ZeroToTheZeroeth
{
class Program
{
static void Main(string[] args)
{
double k = Math.Pow(0, 0);
Console.Write("0^0 is {0}", k);
}
}
}

View file

@ -0,0 +1,11 @@
#include <stdio.h>
#include <math.h>
#include <complex.h>
int main()
{
printf("0 ^ 0 = %f\n", pow(0,0));
double complex c = cpow(0,0);
printf("0+0i ^ 0+0i = %f+%fi\n", creal(c), cimag(c));
return 0;
}

View file

@ -0,0 +1,8 @@
start_up = proc ()
zz_int: int := 0 ** 0
zz_real: real := 0.0 ** 0.0
po: stream := stream$primary_output()
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

View file

@ -0,0 +1,9 @@
identification division.
program-id. zero-power-zero-program.
data division.
working-storage section.
77 n pic 9.
procedure division.
compute n = 0**0.
display n upon console.
stop run.

View file

@ -0,0 +1 @@
10 print "0 ^ 0 = ";0^0

View file

@ -0,0 +1,2 @@
<cfset zeroPowerTag = 0^0>
<cfoutput>"#zeroPowerTag#"</cfoutput>

View file

@ -0,0 +1,4 @@
<cfscript>
zeroPower = 0^0;
writeOutput( zeroPower );
</cfscript>

View file

@ -0,0 +1,4 @@
puts "Int32: #{0_i32**0_i32}"
puts "Negative Int32: #{-0_i32**-0_i32}"
puts "Float32: #{0_f32**0_f32}"
puts "Negative Float32: #{-0_f32**-0_f32}"

View file

@ -0,0 +1,12 @@
void main() {
import std.stdio, std.math, std.bigint, std.complex;
writeln("Int: ", 0 ^^ 0);
writeln("Ulong: ", 0UL ^^ 0UL);
writeln("Float: ", 0.0f ^^ 0.0f);
writeln("Double: ", 0.0 ^^ 0.0);
writeln("Real: ", 0.0L ^^ 0.0L);
writeln("pow: ", pow(0, 0));
writeln("BigInt: ", 0.BigInt ^^ 0);
writeln("Complex: ", complex(0.0, 0.0) ^^ 0);
}

View file

@ -0,0 +1,6 @@
import 'dart:math';
void main() {
var resul = pow(0, 0);
print("0 ^ 0 = $resul");
}

View file

@ -0,0 +1 @@
0 0^p

View file

@ -0,0 +1,2 @@
writeLine(0 ** 0) # an integer
writeLine(0.0 ** 0.0) # a real

View file

@ -0,0 +1,3 @@
.....
PRINT(0^0)
.....

View file

@ -0,0 +1 @@
print pow 0 0

View file

@ -0,0 +1,7 @@
;; trying the 16 combinations
;; all return the integer 1
(lib 'bigint)
(define zeroes '(integer: 0 inexact=float: 0.000 complex: 0+0i bignum: #0))
(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

View file

@ -0,0 +1 @@
print (0^0)

View file

@ -0,0 +1,6 @@
import extensions;
public program()
{
console.printLine("0^0 is ",0.power:0)
}

View file

@ -0,0 +1 @@
:math.pow(0,0)

View file

@ -0,0 +1 @@
(expt 0 0)

View file

@ -0,0 +1,3 @@
USING: math.functions.private ; ! ^complex
0 0 ^
C{ 0 0 } C{ 0 0 } ^complex

View file

@ -0,0 +1,7 @@
/* created by Aykayayciti Earl Lamont Montgomery
April 9th, 2018 */
x = 0
y = 0
z = x**y
> "z=", z

View file

@ -0,0 +1 @@
0^0

View file

@ -0,0 +1 @@
0e 0e f** f.

View file

@ -0,0 +1 @@
: ^0 DROP 1 ;

View file

@ -0,0 +1,11 @@
program zero
double precision :: i, j
double complex :: z1, z2
i = 0.0D0
j = 0.0D0
z1 = (0.0D0,0.0D0)
z2 = (0.0D0,0.0D0)
write(*,*) 'When integers are used, we have 0^0 = ', 0**0
write(*,*) 'When double precision numbers are used, we have 0.0^0.0 = ', i**j
write(*,*) 'When complex numbers are used, we have (0.0+0.0i)^(0.0+0.0i) = ', z1**z2
end program

View file

@ -0,0 +1,4 @@
' FB 1.05.0 Win64
Print "0 ^ 0 ="; 0 ^ 0
Sleep

View file

@ -0,0 +1 @@
println[0^0]

View file

@ -0,0 +1,5 @@
window 1
print 0^0
HandleEvents

View file

@ -0,0 +1 @@
0^0;

View file

@ -0,0 +1 @@
PRINT 0^0

View file

@ -0,0 +1,5 @@
Public Sub Main()
Print 0 ^ 0
End

View file

@ -0,0 +1,15 @@
package main
import (
"fmt"
"math"
"math/big"
"math/cmplx"
)
func main() {
fmt.Println("float64: ", math.Pow(0, 0))
var b big.Int
fmt.Println("big integer:", b.Exp(&b, &b, nil))
fmt.Println("complex: ", cmplx.Pow(0, 0))
}

View file

@ -0,0 +1 @@
0 0?

View file

@ -0,0 +1 @@
println 0**0

View file

@ -0,0 +1,11 @@
import Data.Complex ( Complex((:+)) )
main :: IO ()
main = mapM_ print [
0 ^ 0,
0.0 ^ 0,
0 ^^ 0,
0 ** 0,
(0 :+ 0) ^ 0,
(0 :+ 0) ** (0 :+ 0)
]

View file

@ -0,0 +1,2 @@
F64 a = 0 ` 0;
Print("0 ` 0 = %5.3f\n", a);

View file

@ -0,0 +1,3 @@
procedure main()
write(0^0)
end

View file

@ -0,0 +1,2 @@
0 ^ 0
1

View file

@ -0,0 +1,2 @@
*/''
1

View file

@ -0,0 +1 @@
System.out.println(Math.pow(0, 0));

View file

@ -0,0 +1,2 @@
> Math.pow(0, 0);
1

View file

@ -0,0 +1,2 @@
> 0**0
1

View file

@ -0,0 +1 @@
puts(Math.pow(0,0));

View file

@ -0,0 +1,9 @@
using Printf
const types = (Complex, Float64, Rational, Int, Bool)
for Tb in types, Te in types
zb, ze = zero(Tb), zero(Te)
r = zb ^ ze
@printf("%10s ^ %-10s = %7s ^ %-7s = %-12s (%s)\n", Tb, Te, zb, ze, r, typeof(r))
end

View file

@ -0,0 +1,2 @@
0^0
1.0

View file

@ -0,0 +1,10 @@
:mypower
dup not (
[ drop sign dup 0 equal [ drop 1 ] if ]
[ power ]
) if
;
0 0 mypower print nl
"End " input

View file

@ -0,0 +1,5 @@
import kotlin.math.pow
fun main() {
println(0.0.pow(0))
}

View file

@ -0,0 +1,4 @@
{pow 0 0}
-> 1
{exp 0 0}
-> 1

View file

@ -0,0 +1,3 @@
'********
print 0^0
'********

View file

@ -0,0 +1 @@
print 0🠅0

View file

@ -0,0 +1 @@
print(0^0)

View file

@ -0,0 +1,6 @@
Module Checkit {
x=0
y=0
Print x**y=1, x^y=1 ' True True
}
Checkit

View file

@ -0,0 +1,2 @@
0^0
complex(0,0)^0

View file

@ -0,0 +1 @@
10 PRINT "0 ^ 0 = "; 0 ^ 0

View file

@ -0,0 +1 @@
0^0

View file

@ -0,0 +1 @@
0^0.0

View file

@ -0,0 +1 @@
0^0;

View file

@ -0,0 +1,18 @@
:- module zero_to_the_zero_power.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module float, int, integer, list, string.
main(!IO) :-
io.format(" int.pow(0, 0) = %d\n", [i(pow(0, 0))], !IO),
io.format("integer.pow(zero, zero) = %s\n",
[s(to_string(pow(zero, zero)))], !IO),
io.format(" float.pow(0.0, 0) = %.1f\n", [f(pow(0.0, 0))], !IO).
:- end_module zero_to_the_zero_power.

View file

@ -0,0 +1 @@
TextWindow.WriteLine(Math.Power(0,0))

View file

@ -0,0 +1 @@
0 0 pow puts

View file

@ -0,0 +1 @@
print "The result of zero to the zero power is " + 0^0

View file

@ -0,0 +1 @@
println 0^0

View file

@ -0,0 +1,7 @@
/**
Zero to the zeroth power, in Neko
*/
var math_pow = $loader.loadprim("std@math_pow", 2)
$print(math_pow(0, 0), "\n")

View file

@ -0,0 +1,2 @@
x=0
Say '0**0='||x**x

View file

@ -0,0 +1 @@
(pow 0 0)

View file

@ -0,0 +1,8 @@
0 0.0 o outer power 0 0.0 o
+--+--+--+
| 1|1.| 1|
+--+--+--+
|1.|1.|1.|
+--+--+--+
| 1|1.| 1|
+--+--+--+

View file

@ -0,0 +1,4 @@
import math
echo pow(0.0, 0.0) # Floating point exponentiation.
echo 0 ^ 0 # Integer exponentiation.

View file

@ -0,0 +1 @@
0 0 pow println

View file

@ -0,0 +1,2 @@
(print "0^0: " (expt 0 0))
(print "0.0^0: " (expt (inexact 0) 0))

View file

@ -0,0 +1,6 @@
/**********************************************************************
* 21.04.2014 Walter Pachl
**********************************************************************/
Say 'rxCalcpower(0,0) ->' rxCalcpower(0,0)
Say '0**0 ->' 0**0
::requires rxmath library

View file

@ -0,0 +1 @@
echo (0^0);

View file

@ -0,0 +1,3 @@
0^0
0.^0
0^0.

View file

@ -0,0 +1,4 @@
<?php
echo pow(0,0);
echo 0 ** 0; // PHP 5.6+ only
?>

View file

@ -0,0 +1,7 @@
zhz: Proc Options(Main);
Dcl a dec float(10) Init(1);
Dcl b dec float(10) Init(0);
Put skip list('1**0=',a**b);
Put skip list('0**1=',b**a);
Put skip list('0**0=',b**b);
End;

View file

@ -0,0 +1,7 @@
program ZToZ;
uses
math;
begin
write('0.0 ^ 0 :',IntPower(0.0,0):4:2);
writeln(' 0.0 ^ 0.0 :',Power(0.0,0.0):4:2);
end.

View file

@ -0,0 +1,5 @@
print 0 ** 0, "\n";
use Math::Complex;
print cplx(0,0) ** cplx(0,0), "\n";

Some files were not shown because too many files have changed in this diff Show more