| Total Complexity | 7 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 71.43% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class MutableDecimal extends Decimal |
||
| 9 | {
|
||
| 10 | |||
| 11 | 1 | public function continuousModulo($mod) |
|
| 12 | {
|
||
| 13 | |||
| 14 | 1 | $mod = Numbers::makeOrDont(Numbers::IMMUTABLE, $mod, $this->precision+1); |
|
| 15 | 1 | $oldNum = Numbers::make(Numbers::IMMUTABLE, $this->getValue(), $this->precision+1); |
|
| 16 | |||
| 17 | 1 | $multiple = $oldNum->divide($mod)->floor(); |
|
| 18 | |||
| 19 | 1 | $remainder = $oldNum->subtract($mod->multiply($multiple)); |
|
| 20 | |||
| 21 | 1 | return Numbers::make(Numbers::MUTABLE, $remainder->truncate($this->precision)->getValue()); |
|
| 22 | |||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param string $value |
||
| 27 | * |
||
| 28 | * @return MutableDecimal |
||
| 29 | */ |
||
| 30 | 3 | protected function setValue(string $value, int $precision = null, int $base = 10) |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return bool |
||
| 58 | */ |
||
| 59 | public function isComplex(): bool |
||
| 64 | } |