Ejemplo n.º 1
0
 public function testFractionOfPositiveNumber()
 {
     $x = new \MyOddWeb\BigNumber("1.2");
     $fraction = $x->Frac()->ToString();
     $this->assertSame("0.2", $fraction);
     $x = new \MyOddWeb\BigNumber("12345.678");
     $fraction = $x->Frac()->ToString();
     $this->assertSame("0.678", $fraction);
     $x = new \MyOddWeb\BigNumber("12345.2");
     $fraction = $x->Frac()->ToString();
     $this->assertSame("0.2", $fraction);
     $x = new \MyOddWeb\BigNumber("12");
     $fraction = $x->Frac()->ToString();
     $this->assertSame("0", $fraction);
     $this->assertTrue($x->IsZero());
     $x = new \MyOddWeb\BigNumber("0.23456");
     $fraction = $x->Frac()->ToString();
     $this->assertSame("0.23456", $fraction);
 }