Crypt/Math/BigInteger/Gmp.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Crypt  
Subpackage
Math  
Version
$Id$  

\Zend_Crypt_Math_BigInteger_Gmp

Package: Zend_Crypt
Support for arbitrary precision mathematics in PHP.
Zend_Crypt_Math_BigInteger_Gmp is a wrapper across the PHP BCMath extension.
Implements
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Methods

methodpublicadd(resource $left_operand, resource $right_operand) : string

Adds two arbitrary precision numbers

Parameters
NameTypeDescription
$left_operandresource
$right_operandresource
Returns
TypeDescription
string
methodpublicbinaryToInteger(string $operand) : string

Parameters
NameTypeDescription
$operandstring
Returns
TypeDescription
string
methodpubliccompare(resource $left_operand, resource $right_operand) : int

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.

Parameters
NameTypeDescription
$left_operandresource
$right_operandresource
Returns
TypeDescription
int
methodpublicdivide(resource $left_operand, resource $right_operand) : string | null

Divide two big integers and return result or NULL if the denominator is zero.

Parameters
NameTypeDescription
$left_operandresource
$right_operandresource
Returns
TypeDescription
string | null
methodpublichexToDecimal(string $operand) : string

Parameters
NameTypeDescription
$operandstring
Returns
TypeDescription
string
methodpublicinit(string $operand, int $base = 10) : string

Initialise a big integer into an extension specific type.

Parameters
NameTypeDescription
$operandstring
$baseint
Returns
TypeDescription
string
methodpublicintegerToBinary(resource $operand) : string

Parameters
NameTypeDescription
$operandresource

GMP number resource

Returns
TypeDescription
string
methodpublicmultiply(resource $left_operand, resource $right_operand) : string

Multiply numbers

Parameters
NameTypeDescription
$left_operandresource
$right_operandresource
Returns
TypeDescription
string
methodpublicpow(resource $left_operand, int $right_operand) : string

Raise number into power

Parameters
NameTypeDescription
$left_operandresource
$right_operandint
Returns
TypeDescription
string
methodpublicpowmod(resource $left_operand, resource $right_operand, resource $modulus) : string

Raise number into power with modulo

Parameters
NameTypeDescription
$left_operandresource
$right_operandresource
$modulusresource
Returns
TypeDescription
string
methodpublicsqrt( $operand) : string

Calculate square root

Parameters
NameTypeDescription
$operand
Returns
TypeDescription
string
methodpublicsubtract(resource $left_operand, resource $right_operand) : string

Subtract numbers

Parameters
NameTypeDescription
$left_operandresource
$right_operandresource
Returns
TypeDescription
string
Documentation was generated by phpDocumentor 2.2.0 .