Ejemplo n.º 1
0
 /**
  * Tests the possibility of a "negative" string zero, i.e. "-0.000"
  *
  * The sign of -0 is still a negative sign. This is ultimately calculated
  * by bccomp(), according to which, when -0.000 is compared to 0.000, it
  * will return a -1, meaning -0.000 is less than 0.000, but -0 compared to
  * 0 will return a 0, meaning the two are equal. This is odd, but it is the
  * expected behavior.
  */
 public function testNegativeZero()
 {
     $bn = new BigNumber('-0.0000005', 3);
     $this->assertSame('-0.000', $bn->getValue());
     $this->assertEquals(-1, $bn->signum());
     $this->assertTrue($bn->isNegative());
 }