src/Samsara/Fermat/Values/Currency.php 1 location
|
@@ 19-28 (lines=10) @@
|
| 16 |
|
return (new Currency(bcmod($this->getValue(), $mod), $this->getPrecision(), $this->getBase()))->convertFromModification($oldBase); |
| 17 |
|
} |
| 18 |
|
|
| 19 |
|
public function continuousModulo($mod) |
| 20 |
|
{ |
| 21 |
|
$mod = Numbers::makeOrDont(Numbers::IMMUTABLE, $mod); |
| 22 |
|
|
| 23 |
|
$multiple = $this->divide($mod)->floor(); |
| 24 |
|
|
| 25 |
|
$remainder = $this->subtract($mod->multiply($multiple)); |
| 26 |
|
|
| 27 |
|
return $remainder; |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
public function compoundInterest($interest, $periods) |
| 31 |
|
{ |
src/Samsara/Fermat/Values/ImmutableNumber.php 1 location
|
@@ 20-31 (lines=12) @@
|
| 17 |
|
return (new ImmutableNumber(bcmod($this->getValue(), $mod), $this->getPrecision(), $this->getBase()))->convertFromModification($oldBase);
|
| 18 |
|
}
|
| 19 |
|
|
| 20 |
|
public function continuousModulo($mod)
|
| 21 |
|
{
|
| 22 |
|
|
| 23 |
|
$mod = Numbers::makeOrDont(Numbers::IMMUTABLE, $mod);
|
| 24 |
|
|
| 25 |
|
$multiple = $this->divide($mod)->floor();
|
| 26 |
|
|
| 27 |
|
$remainder = $this->subtract($mod->multiply($multiple));
|
| 28 |
|
|
| 29 |
|
return $remainder;
|
| 30 |
|
|
| 31 |
|
}
|
| 32 |
|
|
| 33 |
|
/**
|
| 34 |
|
* @param $value
|
src/Samsara/Fermat/Values/MutableNumber.php 1 location
|
@@ 20-31 (lines=12) @@
|
| 17 |
|
return (new MutableNumber(bcmod($this->getValue(), $mod), $this->getPrecision()))->convertFromModification($oldBase);
|
| 18 |
|
}
|
| 19 |
|
|
| 20 |
|
public function continuousModulo($mod)
|
| 21 |
|
{
|
| 22 |
|
|
| 23 |
|
$mod = Numbers::makeOrDont(Numbers::IMMUTABLE, $mod);
|
| 24 |
|
|
| 25 |
|
$multiple = $this->divide($mod)->floor();
|
| 26 |
|
|
| 27 |
|
$remainder = $this->subtract($mod->multiply($multiple));
|
| 28 |
|
|
| 29 |
|
return Numbers::make(Numbers::MUTABLE, $remainder->getValue());
|
| 30 |
|
|
| 31 |
|
}
|
| 32 |
|
|
| 33 |
|
/**
|
| 34 |
|
* @param $value
|