Exemple #1
0
 public function testExponent()
 {
     if (!extension_loaded('bcmath')) {
         $this->markTestSkipped('BCMath extension not loaded, test skipped');
         return;
     }
     $this->assertEquals('1000', Math::exponent('1e3'));
     $this->assertEquals('10320', Math::exponent('1.032e4'));
     $this->assertEquals('10320', Math::exponent('10.32e3'));
     $this->assertEquals('1000', Math::exponent('1e+3'));
     $this->assertEquals('0.001', Math::exponent('1e-3', 3));
     $this->assertEquals('0.0001032', Math::exponent('1.032e-4', 7));
     $this->assertEquals('0.01032', Math::exponent('10.32e-3', 5));
 }