| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 1 | public function continuousModulo($mod) |
|
| 21 | {
|
||
| 22 | |||
| 23 | 1 | $mod = Numbers::makeOrDont(Numbers::IMMUTABLE, $mod, $this->precision+1); |
|
| 24 | 1 | $oldNum = Numbers::make(Numbers::IMMUTABLE, $this->getValue(), $this->precision+1); |
|
| 25 | |||
| 26 | 1 | $multiple = $oldNum->divide($mod)->floor(); |
|
| 27 | |||
| 28 | 1 | $remainder = $oldNum->subtract($mod->multiply($multiple)); |
|
| 29 | |||
| 30 | 1 | return Numbers::make(Numbers::MUTABLE, $remainder->truncate($this->precision)->getValue()); |
|
| 31 | |||
| 54 | } |