WEB DEVELOPER SITE

# PHP 5 Math Functions

## PHP Math Introduction

The math capacities can deal with qualities inside the scope of whole number and buoy types.

## Installation

The PHP math capacities are a piece of the PHP center. No establishment is required to utilize these functions.

## PHP 5 Math Functions

Function Description
abs() Returns indisputably the (positive) estimation of a number
php_ref_math.htmlacos() Returns the circular segment cosine of a number
acosh() Returns the converse hyperbolic cosine of a number
asin() Returns the circular segment sine of a number
asinh() Returns the converse hyperbolic sine of a number
atan() Returns the circular segment digression of a number in radians
atan2() Returns the circular segment digression of two factors x and y
atanh() Returns the converse hyperbolic digression of a number
base_convert() Converts a number from one number base to another
bindec() Converts a twofold number to a decimal number
ceil() Rounds a number up to the closest integer
cos() Returns the cosine of a number
cosh() Returns the hyperbolic cosine of a number
decbin() Converts a decimal number to a twofold number
dechex() Converts a decimal number to a hexadecimal number
decoct() Converts a decimal number to an octal number
deg2rad() Converts a degree incentive to a radian value
exp() Calculates the type of e
expm1() Returns exp(x) - 1
floor() Rounds a number down to the closest integer
fmod() Returns the rest of x/y
getrandmax() Returns the biggest conceivable esteem returned by rand()
hexdec() Converts a hexadecimal number to a decimal number
hypot() Calculates the hypotenuse of a right-point triangle
is_finite() Checks whether an esteem is limited or not
is_infinite() Checks whether an esteem is boundless or not
is_nan() Checks whether an esteem is 'not-a-number'
lcg_value() Returns a pseudo irregular number in a range somewhere in the range of 0 and 1
log() Returns the common logarithm of a number
log10() Returns the base-10 logarithm of a number
log1p() Returns log(1+number)
max() Returns the most elevated an incentive in a cluster, or the most noteworthy estimation of a few determined values
min() Returns the most minimal incentive in a cluster, or the least estimation of a few determined values
mt_getrandmax() Returns the biggest conceivable esteem returned by mt_rand()
mt_rand() Generates an arbitrary number utilizing Mersenne Twister algorithm
mt_srand() Seeds the Mersenne Twister arbitrary number generator
octdec() Converts an octal number to a decimal number
pi() Returns the estimation of PI
pow() Returns x raised to the intensity of y
rad2deg() Converts a radian incentive to a degree value
rand() Generates an irregular integer
round() Rounds a gliding point number
sin() Returns the sine of a number
sinh() Returns the hyperbolic sine of a number
sqrt() Returns the square base of a number
srand() Seeds the arbitrary number generator
tan() Returns the digression of a number
tanh() Returns the hyperbolic digression of a number

## PHP 5 Predefined Math Constants

Constant Value Description PHP Version
INF INF The infinite PHP 4
M_E 2.7182818284590452354 Returns e PHP 4
M_EULER 0.57721566490153286061 Returns Euler constant PHP 4
M_LNPI 1.14472988584940017414 Returns the common logarithm of PI: log_e(pi) PHP 5.2
M_LN2 0.69314718055994530942 Returns the normal logarithm of 2: log_e 2 PHP 4
M_LN10 2.30258509299404568402 Returns the normal logarithm of 10: log_e 10 PHP 4
M_LOG2E 1.4426950408889634074 Returns the base-2 logarithm of E: log_2 e PHP 4
M_LOG10E 0.43429448190325182765 Returns the base-10 logarithm of E: log_10 e PHP 4
M_PI 3.14159265358979323846 Returns Pi PHP 4
M_PI_2 1.57079632679489661923 Returns Pi/2 PHP 4
M_PI_4 0.78539816339744830962 Returns Pi/4 PHP 4
M_1_PI 0.31830988618379067154 Returns 1/Pi PHP 4
M_2_PI 0.63661977236758134308 Returns 2/Pi PHP 4
M_SQRTPI 1.77245385090551602729 Returns the square foundation of PI: sqrt(pi) PHP 5.2
M_2_SQRTPI 1.12837916709551257390 Returns 2/square foundation of PI: 2/sqrt(pi) PHP 4
M_SQRT1_2 0.70710678118654752440 Returns the square foundation of 1/2: 1/sqrt(2) PHP 4
M_SQRT2 1.41421356237309504880 Returns the square foundation of 2: sqrt(2) PHP 4
M_SQRT3 1.73205080756887729352 Returns the square foundation of 3: sqrt(3) PHP 5.2
NAN NAN Not A Number PHP 4
PHP_ROUND_HALF_UP 1 Round parts up PHP 5.3
PHP_ROUND_HALF_DOWN 2 Round parts down PHP 5.3
PHP_ROUND_HALF_EVEN 3 Round parts to even numbers PHP 5.3
PHP_ROUND_HALF_ODD 4 Round parts to odd numbers PHP 5.3