Math Functions

ABS Returns the absolute (positive) value of a number

ACOS Returns the arc cosine of a number

ACOSH Returns the inverse hyperbolic cosine of a number

ASIN Returns the arc sine of a number

ASINH Returns the inverse hyperbolic sine of a number

ATAN Returns the arc tangent of a number in radians

ATAN2** Returns the arc tangent of two variables x and y

ATANH Returns the inverse hyperbolic tangent of a number

BASE_CONVERT Converts a number from one number base to another

BINDECConverts a binary number to a decimal number

CEILRounds a number up to the nearest integer

COSReturns the cosine of a number

COSHReturns the hyperbolic cosine of a number

DECBINConverts a decimal number to a binary number

DECHEXConverts a decimal number to a hexadecimal number

DECOCTConverts a decimal number to an octal number

DEG2RADConverts a degree value to a radian value

EXPCalculates the exponent of e

EXPM1Returns exp(x) – 1

FLOORRounds a number down to the nearest integer

FMODReturns the remainder of x/y

GETRANDMAXReturns the largest possible value returned by rand

HEXDECConverts a hexadecimal number to a decimal number

HYPOTCalculates the hypotenuse of a right-angle triangle

IS_FINITE Checks whether a value is finite or not

IS_INFINITE Checks whether a value is infinite or not

IS_NAN Checks whether a value is ‘not-a-number’

LCG_VALUE Returns a pseudo random number in a range between 0 and 1

LOGReturns the natural logarithm of a number

LOG10Returns the base-10 logarithm of a number

LOG1PReturns log(1+number)

MAXReturns the highest value in an array, or the highest value of several specified values

MINReturns the lowest value in an array, or the lowest value of several specified values

MT_GETRANDMAX Returns the largest possible value returned by mt_rand

MT_RAND Generates a random integer using Mersenne Twister algorithm

MT_SRAND Seeds the Mersenne Twister random number generator

OCTDECConverts an octal number to a decimal number

PIReturns the value of PI

POWReturns x raised to the power of y

rad2deg Converts a radian value to a
degree value

RANDGenerates a random integer

ROUNDRounds a floating-point number

SINReturns the sine of a number

SINHReturns the hyperbolic sine of a number

SQRTReturns the square root of a number

SRANDSeeds the random number generator

TANReturns the tangent of a number

TANHReturns the hyperbolic tangent of a number

===========================================

predefined constants

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 natural logarithm of PI: log_e(pi) PHP 5.2
M_LN2 0.69314718055994530942 Returns the natural logarithm of 2: log_e 2 PHP 4
M_LN10 2.30258509299404568402 Returns the natural 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 root of PI: sqrt(pi) PHP 5.2
M_2_SQRTPI 1.12837916709551257390 Returns 2/square root of PI: 2/sqrt(pi) PHP 4
M_SQRT1_2 0.70710678118654752440 Returns the square root of 1/2: 1/sqrt(2) PHP 4
M_SQRT2 1.41421356237309504880 Returns the square root of 2: sqrt(2) PHP 4
M_SQRT3 1.73205080756887729352 Returns the square root of 3: sqrt(3) PHP 5.2

Leave a Reply