PHP Mathematical Functions

EditRocket provides the following information on Mathematical functions in the PHP source code builder.

number abs ( mixed $number ) - Returns the absolute value of number.

float acos ( float $arg ) - Returns the arc cosine of arg in radians.

float acosh ( float $arg ) - Returns the inverse hyperbolic cosine of arg, i.e. the value whose hyperbolic cosine is arg.

float asin ( float $arg ) - Returns the arc sine of arg in radians.

float asinh ( float $arg ) - Returns the inverse hyperbolic sine of arg, i.e. the value whose hyperbolic sine is arg.

float atan ( float $arg ) - Returns the arc tangent of arg in radians.

float atan2 ( float $y , float $x ) -

float atanh ( float $arg ) - Returns the inverse hyperbolic tangent of arg, i.e. the value whose hyperbolic tangent is arg.

string base_convert ( string $number , int $frombase , int $tobase ) - Returns a string containing number represented in base tobase. The base in which number is given is specified in frombase. Both frombase and tobase have to be between 2 and 36, inclusive. Digits in numbers with a base higher than 10 will be represented with the letters a-z, with a meaning 10, b meaning 11 and z meaning 35.

number bindec ( string $binary_string ) - Returns the decimal equivalent of the binary number represented by the binary_string argument.

float ceil ( float $value ) -

float cos ( float $arg ) - cos() returns the cosine of the arg parameter. The arg parameter is in radians.

float cosh ( float $arg ) - Returns the hyperbolic cosine of arg, defined as (exp(arg) + exp(-arg))/2.

string decbin ( int $number ) - Returns a string containing a binary representation of the given number argument. The largest number that can be converted is 4294967295 in decimal resulting to a string of 32 1's.

string dechex ( int $number ) - Returns a string containing a hexadecimal representation of the given number argument. The largest number that can be converted is 4294967295 in decimal resulting to ffffffff.

string decoct ( int $number ) - Returns a string containing an octal representation of the given number argument. The largest number that can be converted is 4294967295 in decimal resulting to 37777777777.

float deg2rad ( float $number ) - This function converts number from degrees to the radian equivalent.

float exp ( float $arg ) - Returns e raised to the power of arg.

float expm1 ( float $arg ) -

float floor ( float $value ) -

float fmod ( float $x , float $y ) - Returns the floating point remainder of dividing the dividend (x) by the divisor (y). The reminder (r) is defined as: x = i * y + r, for some integer i. If y is non-zero, r has the same sign as x and a magnitude less than the magnitude of y.

int getrandmax ( void ) -

number hexdec ( string $hex_string ) - Returns the decimal equivalent of the hexadecimal number represented by the hex_string argument. hexdec() converts a hexadecimal string to a decimal number.

float hypot ( float $x , float $y ) - hypot() returns the length of the hypotenuse of a right-angle triangle with sides of length x and y, or the distance of the point (x, y) from the origin. This is equivalent to sqrt(x*x + y*y).

bool is_finite ( float $val ) - Checks whether val is a legal finite on this platform.

bool is_infinite ( float $val ) - Returns TRUE if val is infinite (positive or negative), like the result of log(0) or any value too big to fit into a float on this platform.

bool is_nan ( float $val ) - Checks whether val is 'not a number', like the result of acos(1.01).

float lcg_value ( void ) - lcg_value() returns a pseudo random number in the range of (0, 1). The function combines two CGs with periods of 2^31 - 85 and 2^31 - 249. The period of this function is equal to the product of both primes.

float log ( float $arg [, float $base ] ) - If the optional base parameter is specified, log() returns log base arg, otherwise log() returns the natural logarithm of arg.

float log10 ( float $arg ) - Returns the base-10 logarithm of arg.

float log1p ( float $number ) -

mixed max ( array $values ) -

mixed min ( array $values ) -

int mt_getrandmax ( void ) -

int mt_rand ([ int $min ], int $max ) -

void mt_srand ([ int $seed ] ) - Seeds the random number generator with seed or with a random value if no seed is given.

number octdec ( string $octal_string ) - Returns the decimal equivalent of the octal number represented by the octal_string argument.

float pi ( void ) -

number pow ( number $base , number $exp ) - Returns base raised to the power of exp.

float rad2deg ( float $number ) - This function converts number from radian to degrees.

int rand ([ int $min ], int $max ) -

float round ( float $val [, int $precision ] ) - Returns the rounded value of val to specified precision (number of digits after the decimal point). precision can also be negative or zero (default).

float sin ( float $arg ) - sin() returns the sine of the arg parameter. The arg parameter is in radians.

float sinh ( float $arg ) - Returns the hyperbolic sine of arg, defined as (exp(arg) - exp(-arg))/2.

float sqrt ( float $arg ) - Returns the square root of arg.

void srand ([ int $seed ] ) - Seeds the random number generator with seed or with a random value if no seed is given.

float tan ( float $arg ) - tan() returns the tangent of the arg parameter. The arg parameter is in radians.

float tanh ( float $arg ) - Returns the hyperbolic tangent of arg, defined as sinh(arg)/cosh(arg).