BCMath

BCMath Emulation Class

author

Jim Wigginton terrafrost@php.net

access

public

package

Default

Methods

__callStatic Magic Method

__callStatic( $name, $arguments)
static
var

Arguments

$name

$arguments

Add two arbitrary precision numbers

add( $x, $y, $scale, $pad)
static
var

Arguments

$x

$y

$scale

$pad

Compare two arbitrary precision numbers

comp( $x, $y, $scale, $pad)
static
var

Arguments

$x

$y

$scale

$pad

Divide two arbitrary precision numbers

div( $x, $y, $scale, $pad)
static
var

Arguments

$x

$y

$scale

$pad

Formats numbers

format( $x, $scale, $pad)
static

Places the decimal place at the appropriate place, adds trailing 0's as appropriate, etc

var

Arguments

$x

$scale

$pad

Negativity Test

isNegative( $x)
static
var

Arguments

$x

Get modulus of an arbitrary precision number

mod( $x, $y, $scale, $pad)
static

Uses the PHP 7.2+ behavior

var

Arguments

$x

$y

$scale

$pad

Multiply two arbitrary precision numbers

mul( $x, $y, $scale, $pad)
static
var

Arguments

$x

$y

$scale

$pad

Raise an arbitrary precision number to another

pow( $x, $y, $scale, $pad)
static

Uses the PHP 7.2+ behavior

var

Arguments

$x

$y

$scale

$pad

Raise an arbitrary precision number to another, reduced by a specified modulus

powmod( $x, $e, $n, $scale, $pad)
static
var

Arguments

$x

$e

$n

$scale

$pad

Set or get default scale parameter for all bc math functions

scale( $scale = null)
static

Uses the PHP 7.3+ behavior

var

optional

Arguments

$scale

Get the square root of an arbitrary precision number

sqrt( $n, $scale, $pad)
static
var

Arguments

$n

$scale

$pad

Subtract one arbitrary precision number from another

sub( $x, $y, $scale, $pad)
static
var

Arguments

$x

$y

$scale

$pad

Properties

Default scale parameter for all bc math functions

scale :
static

Type(s)