Public Member Functions

Zend_Crypt_Math_BigInteger_Bcmath Class Reference

Inheritance diagram for Zend_Crypt_Math_BigInteger_Bcmath:
Zend_Crypt_Math_BigInteger_Interface

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)

Detailed Description

Definition at line 39 of file Bcmath.php.


Member Function Documentation

add ( left_operand,
right_operand 
)

Adds two arbitrary precision numbers

Parameters:
string$left_operand
string$right_operand
Returns:
string

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 61 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.

Parameters:
string$left_operand
string$right_operand
Returns:
int

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 84 of file Bcmath.php.

divide ( left_operand,
right_operand 
)

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

Parameters:
string$left_operand
string$right_operand
Returns:
string|null

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 96 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; }

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 192 of file Bcmath.php.

init ( operand,
base = 10 
)

Initialise a big integer into an extension specific type. This is not applicable to BCMath.

Parameters:
string$operand
int$base
Returns:
string

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 49 of file Bcmath.php.

modulus ( left_operand,
modulus 
)
Parameters:
string$left_operand
string$right_operand
Returns:
string

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 106 of file Bcmath.php.

multiply ( left_operand,
right_operand 
)
Parameters:
string$left_operand
string$right_operand
Returns:
string

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 116 of file Bcmath.php.

pow ( left_operand,
right_operand 
)
Parameters:
string$left_operand
string$right_operand
Returns:
string

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 126 of file Bcmath.php.

powmod ( left_operand,
right_operand,
modulus 
)
Parameters:
string$left_operand
string$right_operand
Returns:
string

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 136 of file Bcmath.php.

sqrt ( operand )
Parameters:
string$left_operand
string$right_operand
Returns:
string

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 146 of file Bcmath.php.

subtract ( left_operand,
right_operand 
)
Parameters:
string$left_operand
string$right_operand
Returns:
string

Implements Zend_Crypt_Math_BigInteger_Interface.

Definition at line 71 of file Bcmath.php.


The documentation for this class was generated from the following file: