示例#1
0
 /**
  * @covers Moontoast\Math\BigNumber::sqrt
  */
 public function testSqrt()
 {
     $bn1 = new BigNumber(16);
     $bn2 = new BigNumber(17);
     $bn3 = clone $bn2;
     $this->assertSame($bn1, $bn1->sqrt());
     $this->assertSame('4', $bn1->getValue());
     $this->assertSame('4', $bn2->sqrt()->getValue());
     $bn3->setScale(8);
     $this->assertSame('4.12310562', $bn3->sqrt()->getValue());
 }