Crypt/Math/BigInteger/Bcmath.php
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_Bcmath
Package: Zend_CryptSupport for arbitrary precision mathematics in PHP.
Zend_Crypt_Math_BigInteger_Bcmath 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



add(string $left_operand, string $right_operand) : stringAdds two arbitrary precision numbers
Parameters| Name | Type | Description |
|---|
| $left_operand | string | |
|---|
| $right_operand | string | |
|---|
Returns 


compare(string $left_operand, string $right_operand) : intCompare 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| Name | Type | Description |
|---|
| $left_operand | string | |
|---|
| $right_operand | string | |
|---|
Returns 


divide(string $left_operand, string $right_operand) : string | nullDivide two big integers and return result or NULL if the denominator
is zero.
Parameters| Name | Type | Description |
|---|
| $left_operand | string | |
|---|
| $right_operand | string | |
|---|
Returns| Type | Description |
|---|
| string | null | |



init(string $operand, int $base = 10) : stringInitialise a big integer into an extension specific type. This is not
applicable to BCMath.
Parameters| Name | Type | Description |
|---|
| $operand | string | |
|---|
| $base | int | |
|---|
Returns 


modulus(string $left_operand, string $modulus) : stringGet modulus of an arbitrary precision number
Parameters| Name | Type | Description |
|---|
| $left_operand | string | |
|---|
| $modulus | string | |
|---|
Returns 


multiply(string $left_operand, string $right_operand) : stringMultiply two arbitrary precision numbers
Parameters| Name | Type | Description |
|---|
| $left_operand | string | |
|---|
| $right_operand | string | |
|---|
Returns 


pow(string $left_operand, string $right_operand) : stringRaise an arbitrary precision number to another
Parameters| Name | Type | Description |
|---|
| $left_operand | string | |
|---|
| $right_operand | string | |
|---|
Returns 


powmod(string $left_operand, string $right_operand, string $modulus) : stringRaise an arbitrary precision number to another, reduced by a specified
modulus
Parameters| Name | Type | Description |
|---|
| $left_operand | string | |
|---|
| $right_operand | string | |
|---|
| $modulus | string | |
|---|
Returns 


sqrt(string $operand) : stringGet the square root of an arbitrary precision number
Parameters| Name | Type | Description |
|---|
| $operand | string | |
|---|
Returns 


subtract(string $left_operand, string $right_operand) : stringSubtract one arbitrary precision number from another
Parameters| Name | Type | Description |
|---|
| $left_operand | string | |
|---|
| $right_operand | string | |
|---|
Returns