public function testPow()
 {
     $a = 1234;
     $b = '1234';
     $c = '0x4D2';
     $math = new BcEngine();
     $this->assertEquals(gmp_strval(gmp_pow($a, $a)), $math->pow($a, $a));
     $this->assertEquals(gmp_strval(gmp_pow($b, $b)), $math->pow($b, $b));
     $this->assertEquals(gmp_strval(gmp_pow($c, $c)), $math->pow($c, $c));
     $this->assertEquals(1, $math->pow(1, 1));
 }
Example #2
0
 public function testPow()
 {
     $a = 1234;
     $b = '1234';
     $c = '0x4D2';
     $pow = '20';
     $math = new BcEngine();
     $this->assertEquals('67035243914691711794360082394262505332216263021359359696306176', $math->pow($a, $pow));
     $this->assertEquals('67035243914691711794360082394262505332216263021359359696306176', $math->pow($b, $pow));
     $this->assertEquals('67035243914691711794360082394262505332216263021359359696306176', $math->pow($c, $pow));
     $this->assertEquals(1, $math->pow(1, 1));
 }