@@ -10,6 +10,9 @@ |
||
| 10 | 10 | class ImmutableNumber extends Number implements NumberInterface, DecimalInterface |
| 11 | 11 | {
|
| 12 | 12 | |
| 13 | + /** |
|
| 14 | + * @param ImmutableNumber $mod |
|
| 15 | + */ |
|
| 13 | 16 | public function modulo($mod) |
| 14 | 17 | {
|
| 15 | 18 | $oldBase = $this->convertForModification(); |
@@ -178,7 +178,7 @@ |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
| 181 | - * @param int|float|DecimalInterface $min |
|
| 181 | + * @param integer $min |
|
| 182 | 182 | * @param int|float|DecimalInterface $max |
| 183 | 183 | * @param int $maxIterations |
| 184 | 184 | * |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | * WARNING: This function is of very limited use with Poisson distributions, and may represent a SIGNIFICANT |
| 164 | 164 | * performance hit for certain values of $min, $max, $lambda, and $maxIterations |
| 165 | 165 | * |
| 166 | - * @param int|float|NumberInterface $min |
|
| 166 | + * @param integer $min |
|
| 167 | 167 | * @param int|float|NumberInterface $max |
| 168 | 168 | * @param int $maxIterations |
| 169 | 169 | * |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | * WARNING: This function is of very limited use with Poisson distributions, and may represent a SIGNIFICANT |
| 164 | 164 | * performance hit for certain values of $min, $max, $lambda, and $maxIterations |
| 165 | 165 | * |
| 166 | - * @param int|float|NumberInterface $min |
|
| 166 | + * @param integer $min |
|
| 167 | 167 | * @param int|float|NumberInterface $max |
| 168 | 168 | * @param int $maxIterations |
| 169 | 169 | * |
@@ -24,6 +24,10 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | protected $denominator; |
| 26 | 26 | |
| 27 | + /** |
|
| 28 | + * @param ImmutableNumber $numerator |
|
| 29 | + * @param ImmutableNumber $denominator |
|
| 30 | + */ |
|
| 27 | 31 | public function __construct($numerator, $denominator, $base = 10) |
| 28 | 32 | { |
| 29 | 33 | |
@@ -325,6 +329,9 @@ discard block |
||
| 325 | 329 | return $lcm; |
| 326 | 330 | } |
| 327 | 331 | |
| 332 | + /** |
|
| 333 | + * @param integer $base |
|
| 334 | + */ |
|
| 328 | 335 | public function convertToBase($base) |
| 329 | 336 | { |
| 330 | 337 | $converter = new BaseConverter($this->getBase(), $base); |
@@ -306,6 +306,7 @@ discard block |
||
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | /** |
| 309 | + * @param integer $precision |
|
| 309 | 310 | * @return ImmutableNumber |
| 310 | 311 | */ |
| 311 | 312 | public static function makeOne($precision = null) |
@@ -314,6 +315,7 @@ discard block |
||
| 314 | 315 | } |
| 315 | 316 | |
| 316 | 317 | /** |
| 318 | + * @param integer $precision |
|
| 317 | 319 | * @return ImmutableNumber |
| 318 | 320 | */ |
| 319 | 321 | public static function makeZero($precision = null) |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * Note about precision: it uses the smaller of the two precisions (significant figures). |
| 132 | 132 | * |
| 133 | 133 | * @param $num |
| 134 | - * @param $precision |
|
| 134 | + * @param integer $precision |
|
| 135 | 135 | * @return DecimalInterface|NumberInterface |
| 136 | 136 | */ |
| 137 | 137 | public function divide($num, $precision = null) |
@@ -544,6 +544,9 @@ discard block |
||
| 544 | 544 | |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | + /** |
|
| 548 | + * @param ImmutableNumber $num |
|
| 549 | + */ |
|
| 547 | 550 | public function getGreatestCommonDivisor($num) |
| 548 | 551 | {
|
| 549 | 552 | /** @var ImmutableNumber $num */ |
@@ -938,6 +941,10 @@ discard block |
||
| 938 | 941 | return strpos($this->value, '.'); |
| 939 | 942 | } |
| 940 | 943 | |
| 944 | + /** |
|
| 945 | + * @param integer $pos |
|
| 946 | + * @param integer $add |
|
| 947 | + */ |
|
| 941 | 948 | protected function reduceDecimals(array $decimalArray, $pos, $add) |
| 942 | 949 | {
|
| 943 | 950 | |
@@ -987,9 +994,9 @@ discard block |
||
| 987 | 994 | abstract public function modulo($mod); |
| 988 | 995 | |
| 989 | 996 | /** |
| 990 | - * @param $mod |
|
| 997 | + * @param NumberInterface $mod |
|
| 991 | 998 | * |
| 992 | - * @return NumberInterface|DecimalInterface |
|
| 999 | + * @return NumberInterface |
|
| 993 | 1000 | */ |
| 994 | 1001 | abstract public function continuousModulo($mod); |
| 995 | 1002 | |
@@ -21,6 +21,10 @@ |
||
| 21 | 21 | |
| 22 | 22 | protected $symbol; |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param integer $symbol |
|
| 26 | + * @param integer $precision |
|
| 27 | + */ |
|
| 24 | 28 | public function __construct($value, $symbol = Currency::DOLLAR, $precision = null, $base = 10) |
| 25 | 29 | { |
| 26 | 30 | $this->symbol = $symbol; |