30. Class

30.1. Zend\Math\BigInteger\Adapter\Gmp

GMP extension adapter

30.1.1. Methods

30.1.1.1. init

init()

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

Parameters:
  • string
  • integer|null
Return type:

bool|string

30.1.1.2. add

add()

Add two big integers

Parameters:
  • string
  • string
Return type:

string

30.1.1.3. sub

sub()

Subtract two big integers

Parameters:
  • string
  • string
Return type:

string

30.1.1.4. mul

mul()

Multiply two big integers

Parameters:
  • string
  • string
Return type:

string

30.1.1.5. div

div()

Divide two big integers and return integer part result. Raises exception if the divisor is zero.

Parameters:
  • string
  • string
Return type:

string|null

Throws :

ExceptionDivisionByZeroException

30.1.1.6. pow

pow()

Raise a big integers to another

Parameters:
  • string
  • string
Return type:

string

30.1.1.7. sqrt

sqrt()

Get the square root of a big integer

Parameters:string
Return type:string

30.1.1.8. abs

abs()

Get absolute value of a big integer

Parameters:string
Return type:string

30.1.1.9. mod

mod()

Get modulus of a big integer

Parameters:
  • string
  • string
Return type:

string

30.1.1.10. powmod

powmod()

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

Parameters:
  • string
  • string
  • string
Return type:

string

30.1.1.11. comp

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.

Parameters:
  • string
  • string
Return type:

int

30.1.1.12. intToBin

intToBin()

Convert big integer into it’s binary number representation

Parameters:
  • string
  • bool – return in twos’ complement form
Return type:

string

30.1.1.13. binToInt

binToInt()

Convert binary number into big integer

Parameters:
  • string
  • bool – whether binary number is in twos’ complement form
Return type:

string

30.1.1.14. baseConvert

baseConvert()

Base conversion. Bases 2..62 are supported

Parameters:
  • string
  • int
  • int
Return type:

string

Throws :

ExceptionInvalidArgumentException