示例#1
0
 public function testOne()
 {
     $this->assertBigDecimalInternalValues('1', 0, BigDecimal::one());
     $this->assertSame(BigDecimal::one(), BigDecimal::one());
 }
示例#2
0
文件: BigDecimal.php 项目: brick/math
 /**
  * {@inheritdoc}
  */
 public function toScale($scale, $roundingMode = RoundingMode::UNNECESSARY)
 {
     $scale = (int) $scale;
     if ($scale === $this->scale) {
         return $this;
     }
     return $this->dividedBy(BigDecimal::one(), $scale, $roundingMode);
 }