|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| init ($operand, $base=10) | |
| add ($left_operand, $right_operand) | |
| subtract ($left_operand, $right_operand) | |
| compare ($left_operand, $right_operand) | |
| divide ($left_operand, $right_operand) | |
| modulus ($left_operand, $modulus) | |
| multiply ($left_operand, $right_operand) | |
| pow ($left_operand, $right_operand) | |
| powmod ($left_operand, $right_operand, $modulus) | |
| sqrt ($operand) | |
| binaryToInteger ($operand) | |
| integerToBinary ($operand) | |
| hexToDecimal ($operand) | |
Definition at line 39 of file Bcmath.php.
| add | ( | $left_operand, | |
| $right_operand | |||
| ) |
Adds two arbitrary precision numbers
| string | $left_operand | |
| string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 62 of file Bcmath.php.
| binaryToInteger | ( | $operand | ) |
| string | $operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 171 of file Bcmath.php.
| compare | ( | $left_operand, | |
| $right_operand | |||
| ) |
Compare two big integers and returns result as an integer where 0 means both are identical, 1 that left_operand is larger, or -1 that right_operand is larger.
| string | $left_operand | |
| string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 88 of file Bcmath.php.
| divide | ( | $left_operand, | |
| $right_operand | |||
| ) |
Divide two big integers and return result or NULL if the denominator is zero.
| string | $left_operand | |
| string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 101 of file Bcmath.php.
| hexToDecimal | ( | $operand | ) |
public function integerToBinary($operand) { $return = ''; while(bccomp($operand, '0')) { $return .= chr(bcmod($operand, '256')); $operand = bcdiv($operand, '256'); } return $return; }
| string | $operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 217 of file Bcmath.php.
| init | ( | $operand, | |
$base = 10 |
|||
| ) |
Initialise a big integer into an extension specific type. This is not applicable to BCMath.
| string | $operand | |
| int | $base |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 50 of file Bcmath.php.
| integerToBinary | ( | $operand | ) |
| string | $operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 186 of file Bcmath.php.
| modulus | ( | $left_operand, | |
| $modulus | |||
| ) |
Get modulus of an arbitrary precision number
| string | $left_operand | |
| string | $modulus |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 113 of file Bcmath.php.
| multiply | ( | $left_operand, | |
| $right_operand | |||
| ) |
Multiply two arbitrary precision numbers
| string | $left_operand | |
| string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 125 of file Bcmath.php.
| pow | ( | $left_operand, | |
| $right_operand | |||
| ) |
Raise an arbitrary precision number to another
| string | $left_operand | |
| string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 137 of file Bcmath.php.
| powmod | ( | $left_operand, | |
| $right_operand, | |||
| $modulus | |||
| ) |
Raise an arbitrary precision number to another, reduced by a specified modulus
| string | $left_operand | |
| string | $right_operand | |
| string | $modulus |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 151 of file Bcmath.php.
| sqrt | ( | $operand | ) |
Get the square root of an arbitrary precision number
| string | $operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 162 of file Bcmath.php.
| subtract | ( | $left_operand, | |
| $right_operand | |||
| ) |
Subtract one arbitrary precision number from another
| string | $left_operand | |
| string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
Definition at line 74 of file Bcmath.php.