Exemple #1
0
 /**
  * @covers Moontoast\Math\BigNumber::negate
  */
 public function testNegate()
 {
     $bn1 = new BigNumber(1234);
     $bn2 = new BigNumber('0.000000567', 9);
     $this->assertSame('-1234', $bn1->negate()->getValue());
     $this->assertSame('1234', $bn1->negate()->getValue());
     $bn2->setScale(7);
     $this->assertSame('-0.0000005', $bn2->negate()->getValue());
     $bn2->setScale(6);
     $this->assertSame('0.000000', $bn2->negate()->getValue());
 }