WeixiangYan/CodeTransOcean huggingface dataset:
Task: Inheritance_Multiple





Java: public interface Camera{
   
   
   
}







Ada: package Multiple_Interfaces is
   type Camera is tagged null record;
   type Mobile_Phone is limited Interface;
   type Camera_Phone is new Camera and Mobile_Phone with null record;
end Multiple_Interfaces;
Task: Inheritance_Multiple







Python: class Camera:
  pass 





Ada: package Multiple_Interfaces is
   type Camera is tagged null record;
   type Mobile_Phone is limited Interface;
   type Camera_Phone is new Camera and Mobile_Phone with null record;
end Multiple_Interfaces;
Task: Inheritance_Multiple

C: typedef struct{
	double focalLength;
	double resolution;
	double memory;
}Camera;

typedef struct{
	double balance;
	double batteryLevel;
	char** contacts;
}Phone;

typedef struct{
	Camera cameraSample;
	Phone phoneSample;
}CameraPhone;
Task: Inheritance_Multiple



C#: interface ICamera {
    
}

class MobilePhone {
    
}

class CameraPhone: ICamera, MobilePhone {
    
}
Task: Inheritance_Multiple


C++: class Camera
{
  
};

class MobilePhone
{
  
};

class CameraPhone:
  public Camera,
  public MobilePhone
{
  
};
Task: Inheritance_Multiple





Java: public interface Camera{
   
   
   
}
Task: Inheritance_Multiple







Python: class Camera:
  pass
Task: Inheritance_Multiple




Go: 
package main

import "fmt"


type camera struct {
    optics, sensor string
}

type mobilePhone struct {
    sim, firmware string
}



type cameraPhone struct {
    camera
    mobilePhone
}

func main() {
    
    htc := cameraPhone{camera{optics: "zoom"}, mobilePhone{firmware: "3.14"}}

    
    
    
    htc.sim = "XYZ"
    fmt.Println(htc)
}
Task: Inheritance_Multiple

C: typedef struct{
	double focalLength;
	double resolution;
	double memory;
}Camera;

typedef struct{
	double balance;
	double batteryLevel;
	char** contacts;
}Phone;

typedef struct{
	Camera cameraSample;
	Phone phoneSample;
}CameraPhone;









COBOL:        CLASS-ID. Camera.
           
       END CLASS Camera.
       
       CLASS-ID. Mobile-Phone.
           
       END CLASS Mobile-Phone.
       
       CLASS-ID. Camera-Phone INHERITS Camera, Mobile-Phone.    
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Camera
           CLASS Mobile-Phone.
           
           
       END CLASS Camera-Phone.
Task: Inheritance_Multiple



C#: interface ICamera {
    
}

class MobilePhone {
    
}

class CameraPhone: ICamera, MobilePhone {
    
}







COBOL:        CLASS-ID. Camera.
           
       END CLASS Camera.
       
       CLASS-ID. Mobile-Phone.
           
       END CLASS Mobile-Phone.
       
       CLASS-ID. Camera-Phone INHERITS Camera, Mobile-Phone.    
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Camera
           CLASS Mobile-Phone.
           
           
       END CLASS Camera-Phone.
Task: Inheritance_Multiple


C++: class Camera
{
  
};

class MobilePhone
{
  
};

class CameraPhone:
  public Camera,
  public MobilePhone
{
  
};








COBOL:        CLASS-ID. Camera.
           
       END CLASS Camera.
       
       CLASS-ID. Mobile-Phone.
           
       END CLASS Mobile-Phone.
       
       CLASS-ID. Camera-Phone INHERITS Camera, Mobile-Phone.    
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Camera
           CLASS Mobile-Phone.
           
           
       END CLASS Camera-Phone.
Task: Inheritance_Multiple





Java: public interface Camera{
   
   
   
}





COBOL:        CLASS-ID. Camera.
           
       END CLASS Camera.
       
       CLASS-ID. Mobile-Phone.
           
       END CLASS Mobile-Phone.
       
       CLASS-ID. Camera-Phone INHERITS Camera, Mobile-Phone.    
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Camera
           CLASS Mobile-Phone.
           
           
       END CLASS Camera-Phone.
Task: Inheritance_Multiple







Python: class Camera:
  pass 



COBOL:        CLASS-ID. Camera.
           
       END CLASS Camera.
       
       CLASS-ID. Mobile-Phone.
           
       END CLASS Mobile-Phone.
       
       CLASS-ID. Camera-Phone INHERITS Camera, Mobile-Phone.    
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Camera
           CLASS Mobile-Phone.
           
           
       END CLASS Camera-Phone.
Task: Inheritance_Multiple




Go: 
package main

import "fmt"


type camera struct {
    optics, sensor string
}

type mobilePhone struct {
    sim, firmware string
}



type cameraPhone struct {
    camera
    mobilePhone
}

func main() {
    
    htc := cameraPhone{camera{optics: "zoom"}, mobilePhone{firmware: "3.14"}}

    
    
    
    htc.sim = "XYZ"
    fmt.Println(htc)
}






COBOL:        CLASS-ID. Camera.
           
       END CLASS Camera.
       
       CLASS-ID. Mobile-Phone.
           
       END CLASS Mobile-Phone.
       
       CLASS-ID. Camera-Phone INHERITS Camera, Mobile-Phone.    
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Camera
           CLASS Mobile-Phone.
           
           
       END CLASS Camera-Phone.
Task: Zero to the zero power



C#: using System;

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









Ada: 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;
Task: Zero to the zero power

C: #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;
}











Ada: 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;
Task: Zero to the zero power


C++: #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;
}










Ada: 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;
Task: Zero to the zero power




Go: 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))
}








Ada: 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;
Task: Zero to the zero power





Java: System.out.println(Math.pow(0, 0));







Ada: 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;
Task: Zero to the zero power







Python: from decimal import Decimal
from fractions import Fraction
from itertools import product

zeroes = [0, 0.0, 0j, Decimal(0), Fraction(0, 1), -0.0, -0.0j, Decimal(-0.0)]
for i, j in product(zeroes, repeat=2):
    try:
        ans = i**j
    except:
        ans = '<Exception raised>'
    print(f'{i!r:>15} ** {j!r:<15} = {ans!r}')





Ada: 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;
Task: Zero to the zero power








VB: Public Sub zero()
    x = 0
    y = 0
    z = 0 ^ 0
    Debug.Print "z ="; z
End Sub




Ada: 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;
Task: Zero to the zero power

C: #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;
}
Task: Zero to the zero power



C#: using System;

namespace ZeroToTheZeroeth
{
    class Program
    {
        static void Main(string[] args)
        {
            double k = Math.Pow(0, 0);
            Console.Write("0^0 is {0}", k);           
        }
    }
}
Task: Zero to the zero power


C++: #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;
}
Task: Zero to the zero power







Python: from decimal import Decimal
from fractions import Fraction
from itertools import product

zeroes = [0, 0.0, 0j, Decimal(0), Fraction(0, 1), -0.0, -0.0j, Decimal(-0.0)]
for i, j in product(zeroes, repeat=2):
    try:
        ans = i**j
    except:
        ans = '<Exception raised>'
    print(f'{i!r:>15} ** {j!r:<15} = {ans!r}')
Task: Zero to the zero power








VB: Public Sub zero()
    x = 0
    y = 0
    z = 0 ^ 0
    Debug.Print "z ="; z
End Sub
Task: Zero to the zero power




Go: 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))
}
Task: Zero to the zero power





Java: System.out.println(Math.pow(0, 0));
Task: Zero to the zero power



C#: using System;

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








Fortran: 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
Task: Zero to the zero power


C++: #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;
}









Fortran: 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
Task: Zero to the zero power

C: #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;
}










Fortran: 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
Task: Zero to the zero power




Go: 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))
}







Fortran: 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
Task: Zero to the zero power





Java: System.out.println(Math.pow(0, 0));






Fortran: 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
Task: Zero to the zero power







Python: from decimal import Decimal
from fractions import Fraction
from itertools import product

zeroes = [0, 0.0, 0j, Decimal(0), Fraction(0, 1), -0.0, -0.0j, Decimal(-0.0)]
for i, j in product(zeroes, repeat=2):
    try:
        ans = i**j
    except:
        ans = '<Exception raised>'
    print(f'{i!r:>15} ** {j!r:<15} = {ans!r}')




Fortran: 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
Task: Zero to the zero power








VB: Public Sub zero()
    x = 0
    y = 0
    z = 0 ^ 0
    Debug.Print "z ="; z
End Sub



Fortran: 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
Task: Zero to the zero power






PHP: <?php
echo pow(0,0);
echo 0 ** 0; // PHP 5.6+ only
?>





Fortran: 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
Task: Zero to the zero power

C: #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;
}









COBOL: 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.
Task: Zero to the zero power



C#: using System;

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







COBOL: 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.
Task: Zero to the zero power


C++: #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;
}








COBOL: 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.
Task: Zero to the zero power





Java: System.out.println(Math.pow(0, 0));





COBOL: 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.
Task: Zero to the zero power







Python: from decimal import Decimal
from fractions import Fraction
from itertools import product

zeroes = [0, 0.0, 0j, Decimal(0), Fraction(0, 1), -0.0, -0.0j, Decimal(-0.0)]
for i, j in product(zeroes, repeat=2):
    try:
        ans = i**j
    except:
        ans = '<Exception raised>'
    print(f'{i!r:>15} ** {j!r:<15} = {ans!r}')



COBOL: 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.
Task: Zero to the zero power








VB: Public Sub zero()
    x = 0
    y = 0
    z = 0 ^ 0
    Debug.Print "z ="; z
End Sub


COBOL: 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.
Task: Zero to the zero power




Go: 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))
}






COBOL: 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.
Task: Zero to the zero power






PHP: <?php
echo pow(0,0);
echo 0 ** 0; // PHP 5.6+ only
?>