Skip to content

Commit

Permalink
Merge pull request #437 from bakedpotat0/bcmath
Browse files Browse the repository at this point in the history
Update bcmath stub
  • Loading branch information
andrey-sokolov committed Nov 15, 2018
2 parents 9ea50bd + d9e5c1e commit 4c22183
Showing 1 changed file with 87 additions and 37 deletions.
124 changes: 87 additions & 37 deletions bcmath/bcmath.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@
* @param string $right_operand <p>
* The right operand, as a string.
* </p>
* @param int $scale [optional]
* @param int $scale [optional] <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
* this has not been set.
* </p>
* @return string The sum of the two operands, as a string.
* @since 4.0
* @since 5.0
* @since 7.0
*/
function bcadd ($left_operand, $right_operand, $scale = null) {}
function bcadd ($left_operand, $right_operand, $scale = 0) {}

/**
* Subtract one arbitrary precision number from another
Expand All @@ -25,12 +31,18 @@ function bcadd ($left_operand, $right_operand, $scale = null) {}
* @param string $right_operand <p>
* The right operand, as a string.
* </p>
* @param int $scale [optional]
* @param int $scale [optional] <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
* this has not been set.
* </p>
* @return string The result of the subtraction, as a string.
* @since 4.0
* @since 5.0
* @since 7.0
*/
function bcsub ($left_operand, $right_operand, $scale = null) {}
function bcsub ($left_operand, $right_operand, $scale = 0) {}

/**
* Multiply two arbitrary precision numbers
Expand All @@ -41,61 +53,89 @@ function bcsub ($left_operand, $right_operand, $scale = null) {}
* @param string $right_operand <p>
* The right operand, as a string.
* </p>
* @param int $scale [optional]
* @param int $scale [optional] <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
* this has not been set.
* </p>
* @return string the result as a string.
* @since 4.0
* @since 5.0
* @since 7.0
*/
function bcmul ($left_operand, $right_operand, $scale = null) {}
function bcmul ($left_operand, $right_operand, $scale = 0) {}

/**
* Divide two arbitrary precision numbers
* @link https://php.net/manual/en/function.bcdiv.php
* @param string $left_operand <p>
* The left operand, as a string.
* @param string $dividend <p>
* The dividend, as a string.
* </p>
* @param string $right_operand <p>
* The right operand, as a string.
* @param string $divisor <p>
* The divisor, as a string.
* </p>
* @param int $scale [optional]
* @return string the result of the division as a string, or <b>NULL</b> if
* <i>right_operand</i> is 0.
* @param int $scale [optional] <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
* this has not been set.
* </p>
* @return string|null the result of the division as a string, or <b>NULL</b> if
* <i>divisor</i> is 0.
* @since 4.0
* @since 5.0
* @since 7.0
*/
function bcdiv ($left_operand, $right_operand, $scale = null) {}
function bcdiv ($dividend, $divisor, $scale = 0) {}

/**
* Get modulus of an arbitrary precision number
* @link https://php.net/manual/en/function.bcmod.php
* @param string $left_operand <p>
* The left operand, as a string.
* @param string $dividend <p>
* The dividend, as a string.
* </p>
* @param string $modulus <p>
* The modulus, as a string.
* @param string $divisor <p>
* The divisor, as a string.
* </p>
* @param int $scale [optional] <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
* this has not been set.
* </p>
* @return string the modulus as a string, or <b>NULL</b> if
* <i>modulus</i> is 0.
* @return string|null the modulus as a string, or <b>NULL</b> if
* <i>divisor</i> is 0.
* @since 4.0
* @since 5.0
* @since 7.0
* @since 7.2.0 scale param added, dividend/divisor no longer truncated
*/
function bcmod ($left_operand, $modulus) {}
function bcmod ($dividend, $divisor, $scale = 0) {}

/**
* Raise an arbitrary precision number to another
* @link https://php.net/manual/en/function.bcpow.php
* @param string $left_operand <p>
* The left operand, as a string.
* @param string $base <p>
* The base, as a string.
* </p>
* @param string $right_operand <p>
* The right operand, as a string.
* @param string $exponent <p>
* The exponent, as a string. If the exponent is non-integral, it is truncated.
* The valid range of the exponent is platform specific, but is at least
* -2147483648 to 2147483647.
* </p>
* @param int $scale [optional] <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
* this has not been set.
* </p>
* @param int $scale [optional]
* @return string the result as a string.
* @since 4.0
* @since 5.0
* @since 7.0
*/
function bcpow ($left_operand, $right_operand, $scale = null) {}
function bcpow ($base, $exponent, $scale = 0) {}

/**
* Get the square root of an arbitrary precision number
Expand All @@ -108,6 +148,7 @@ function bcpow ($left_operand, $right_operand, $scale = null) {}
* <i>operand</i> is negative.
* @since 4.0
* @since 5.0
* @since 7.0
*/
function bcsqrt ($operand, $scale = null) {}

Expand All @@ -120,6 +161,7 @@ function bcsqrt ($operand, $scale = null) {}
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 4.0
* @since 5.0
* @since 7.0
*/
function bcscale ($scale) {}

Expand All @@ -142,24 +184,32 @@ function bcscale ($scale) {}
* <i>right_operand</i>, -1 otherwise.
* @since 4.0
* @since 5.0
* @since 7.0
*/
function bccomp ($left_operand, $right_operand, $scale = null) {}
function bccomp ($left_operand, $right_operand, $scale = 0) {}

/**
* Raise an arbitrary precision number to another, reduced by a specified modulus
* @link https://php.net/manual/en/function.bcpowmod.php
* @param string $left_operand <p>
* The left operand, as a string.
* @param string $base <p>
* The base, as an integral string (i.e. the scale has to be zero).
* </p>
* @param string $right_operand <p>
* The right operand, as a string.
* @param string $exponent <p>
* The exponent, as an non-negative, integral string (i.e. the scale has to be
* zero).
* </p>
* @param string $modulus <p>
* The modulus, as a string.
* The modulus, as an integral string (i.e. the scale has to be zero).
* </p>
* @param int $scale [optional]
* @return string the result as a string, or <b>NULL</b> if <i>modulus</i>
* is 0.
* @param int $scale [optional] <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
* this has not been set.
* </p>
* @return string|null the result as a string, or <b>NULL</b> if <i>modulus</i>
* is 0 or <i>exponent</i> is negative.
* @since 5.0
* @since 7.0
*/
function bcpowmod ($left_operand, $right_operand, $modulus, $scale = null) {}
function bcpowmod ($base, $exponent, $modulus, $scale = 0) {}

0 comments on commit 4c22183

Please sign in to comment.