@@ -21,6 +21,9 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | protected $base; |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param integer $precision |
|
| 26 | + */ |
|
| 24 | 27 | public function __construct($value, $precision = null, $base = 10) |
| 25 | 28 | {
|
| 26 | 29 | $this->base = $base; |
@@ -97,7 +100,7 @@ discard block |
||
| 97 | 100 | * Note about precision: it uses the smaller of the two precisions (significant figures). |
| 98 | 101 | * |
| 99 | 102 | * @param $num |
| 100 | - * @return mixed |
|
| 103 | + * @return NumberInterface |
|
| 101 | 104 | */ |
| 102 | 105 | public function divide($num) |
| 103 | 106 | {
|
@@ -508,6 +511,9 @@ discard block |
||
| 508 | 511 | } |
| 509 | 512 | } |
| 510 | 513 | |
| 514 | + /** |
|
| 515 | + * @param integer $value |
|
| 516 | + */ |
|
| 511 | 517 | public function greaterThan($value) |
| 512 | 518 | {
|
| 513 | 519 | $value = Numbers::makeOrDont(Numbers::IMMUTABLE, $value, $this->getPrecision()); |
@@ -540,6 +546,9 @@ discard block |
||
| 540 | 546 | } |
| 541 | 547 | } |
| 542 | 548 | |
| 549 | + /** |
|
| 550 | + * @param integer $value |
|
| 551 | + */ |
|
| 543 | 552 | public function lessThanOrEqualTo($value) |
| 544 | 553 | {
|
| 545 | 554 | $value = Numbers::makeOrDont(Numbers::IMMUTABLE, $value, $this->getPrecision()); |
@@ -599,6 +608,9 @@ discard block |
||
| 599 | 608 | return get_class($this).$this->getValue(); |
| 600 | 609 | } |
| 601 | 610 | |
| 611 | + /** |
|
| 612 | + * @param integer $object |
|
| 613 | + */ |
|
| 602 | 614 | public function equals($object): bool |
| 603 | 615 | {
|
| 604 | 616 | $reflection = new \ReflectionClass($object); |
@@ -2,12 +2,12 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Samsara\Fermat\Types; |
| 4 | 4 | |
| 5 | -use Ds\Hashable; |
|
| 6 | -use Samsara\Fermat\Numbers; |
|
| 7 | -use Samsara\Fermat\Provider\BCProvider; |
|
| 8 | -use Riimu\Kit\BaseConversion\BaseConverter; |
|
| 9 | -use Samsara\Fermat\Provider\SequenceProvider; |
|
| 10 | -use Samsara\Fermat\Provider\SeriesProvider; |
|
| 5 | +use Ds\Hashable; |
|
| 6 | +use Samsara\Fermat\Numbers; |
|
| 7 | +use Samsara\Fermat\Provider\BCProvider; |
|
| 8 | +use Riimu\Kit\BaseConversion\BaseConverter; |
|
| 9 | +use Samsara\Fermat\Provider\SequenceProvider; |
|
| 10 | +use Samsara\Fermat\Provider\SeriesProvider; |
|
| 11 | 11 | use Samsara\Fermat\Types\Base\NumberInterface; |
| 12 | 12 | |
| 13 | 13 | abstract class Number implements Hashable |