Math Functions

PHP has several built-in functions for performing mathematical operations.

A list of PHP math operation functions can be found in the table below:

Math Functions

abs()
Returns the absolute value of the argument.
ceil()
Returns the next highest integer value of the fractional argument.
floor()
Returns a rounded number down to the nearest integer.
is_nan()
Checks whether a value is not a number.
max()
Finds and returns the highest value in an array or a list of variables.
pow()
Returns the number raised to the power of the exponent.
sin()
Returns the sine of a given angle.
tan()
Returns the tangent of the angle passed as the argument.

All contributors

Looking to contribute?

Learn PHP on Codecademy