Fully Qualified Name: | Zend\Math\BigInteger\Adapter\Gmp |
Implements: | AdapterInterface |
GMP extension adapter
Name | Description | Defined By |
---|---|---|
abs() | Get absolute value of a big integer | Gmp |
add() | Add two big integers | Gmp |
baseConvert() | Base conversion. Bases 2. | Gmp |
binToInt() | Convert binary number into big integer | Gmp |
comp() | Compare two big integers and returns result as an integer where Returns < 0 if leftOperand is less than rightOperand; > 0 if leftOperand is greater than rightOperand, and 0 if they are equal. | Gmp |
div() | Divide two big integers and return integer part result. | Gmp |
init() | Create string representing big integer in decimal form from arbitrary integer format | Gmp |
intToBin() | Convert big integer into it's binary number representation | Gmp |
mod() | Get modulus of a big integer | Gmp |
mul() | Multiply two big integers | Gmp |
pow() | Raise a big integers to another | Gmp |
powmod() | Raise a big integer to another, reduced by a specified modulus | Gmp |
sqrt() | Get the square root of a big integer | Gmp |
sub() | Subtract two big integers | Gmp |
Get absolute value of a big integer
Parameter Name | Type | Description |
---|---|---|
$operand | string |
Returns: string
Add two big integers
Parameter Name | Type | Description |
---|---|---|
$leftOperand | string | |
$rightOperand | string |
Returns: string
Base conversion. Bases 2.
.62 are supported
Parameter Name | Type | Description |
---|---|---|
$operand | string | |
$fromBase | int | |
$toBase | int |
Returns: string
Convert binary number into big integer
Parameter Name | Type | Description |
---|---|---|
$bytes | string | |
$twoc | bool | whether |
Returns: string
Compare two big integers and returns result as an integer where Returns < 0 if leftOperand is less than rightOperand; > 0 if leftOperand is greater than rightOperand, and 0 if they are equal.
Parameter Name | Type | Description |
---|---|---|
$leftOperand | string | |
$rightOperand | string |
Returns: int
Divide two big integers and return integer part result.
Raises exception if the divisor is zero.
Parameter Name | Type | Description |
---|---|---|
$leftOperand | string | |
$rightOperand | string |
Returns: string|null
Create string representing big integer in decimal form from arbitrary integer format
Parameter Name | Type | Description |
---|---|---|
$operand | string | |
$base | int|null |
Returns: bool|string
Convert big integer into it's binary number representation
Parameter Name | Type | Description |
---|---|---|
$int | string | |
$twoc | bool | return |
Returns: string
Get modulus of a big integer
Parameter Name | Type | Description |
---|---|---|
$leftOperand | string | |
$modulus | string |
Returns: string
Multiply two big integers
Parameter Name | Type | Description |
---|---|---|
$leftOperand | string | |
$rightOperand | string |
Returns: string
Raise a big integers to another
Parameter Name | Type | Description |
---|---|---|
$operand | string | |
$exp | string |
Returns: string
Raise a big integer to another, reduced by a specified modulus
Parameter Name | Type | Description |
---|---|---|
$leftOperand | string | |
$rightOperand | string | |
$modulus | string |
Returns: string
Get the square root of a big integer
Parameter Name | Type | Description |
---|---|---|
$operand | string |
Returns: string
Subtract two big integers
Parameter Name | Type | Description |
---|---|---|
$leftOperand | string | |
$rightOperand | string |
Returns: string