Class Gmp

Summary

Fully Qualified Name: Zend\Math\BigInteger\Adapter\Gmp
Implements: AdapterInterface

Description

GMP extension adapter

Methods

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

Method Details

abs()

Get absolute value of a big integer

Parameter Name Type Description
$operand string

Returns: string

add()

Add two big integers

Parameter Name Type Description
$leftOperand string
$rightOperand string

Returns: string

baseConvert()

Base conversion. Bases 2.

.62 are supported

Parameter Name Type Description
$operand string
$fromBase int
$toBase int

Returns: string

binToInt()

Convert binary number into big integer

Parameter Name Type Description
$bytes string
$twoc bool whether

Returns: string

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.

Parameter Name Type Description
$leftOperand string
$rightOperand string

Returns: int

div()

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

init()

Create string representing big integer in decimal form from arbitrary integer format

Parameter Name Type Description
$operand string
$base int|null

Returns: bool|string

intToBin()

Convert big integer into it's binary number representation

Parameter Name Type Description
$int string
$twoc bool return

Returns: string

mod()

Get modulus of a big integer

Parameter Name Type Description
$leftOperand string
$modulus string

Returns: string

mul()

Multiply two big integers

Parameter Name Type Description
$leftOperand string
$rightOperand string

Returns: string

pow()

Raise a big integers to another

Parameter Name Type Description
$operand string
$exp string

Returns: string

powmod()

Raise a big integer to another, reduced by a specified modulus

Parameter Name Type Description
$leftOperand string
$rightOperand string
$modulus string

Returns: string

sqrt()

Get the square root of a big integer

Parameter Name Type Description
$operand string

Returns: string

sub()

Subtract two big integers

Parameter Name Type Description
$leftOperand string
$rightOperand string

Returns: string

Top