| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function continuousModulo($mod) |
||
| 12 | {
|
||
| 13 | |||
| 14 | $mod = Numbers::makeOrDont(Numbers::IMMUTABLE, $mod, $this->precision+1); |
||
| 15 | $oldNum = Numbers::make(Numbers::IMMUTABLE, $this->getValue(), $this->precision+1); |
||
| 16 | |||
| 17 | $multiple = $oldNum->divide($mod)->floor(); |
||
| 18 | |||
| 19 | $remainder = $oldNum->subtract($mod->multiply($multiple)); |
||
| 20 | |||
| 21 | return Numbers::make(Numbers::MUTABLE, $remainder->truncate($this->precision)->getValue()); |
||
| 22 | |||
| 64 | } |