F.20. Math

FunctionReturnsDescription
abs(int number)
intReturns the absolute value of the number.
ceil(float number)
floatReturns the next highest integer value of the number.
floor(float number)
floatReturns the next lowest integer value from the number.
round(float number [, int precision])
floatReturns the number rounded to specified precision.
sin(float number)
floatReturns the sine of the number in radians.
cos(float number)
floatReturns the cosine of the number in radians.
tan(float number)
floatReturns the tangent of the number in radians.
asin(float number)
floatReturns the arc sine of the number in radians.
acos(float number)
floatReturns the arc cosine of the number in radians.
atan(float number)
floatReturns the arc tangent of the number in radians.
atan2(float y, float x)
floatReturns the arc tangent of y/x, with the resulting quadrant determined by the signs of y and x.
sinh(float number)
floatReturns the hyperbolic sine of the number, defined as (exp(number) - exp(-number))/2.
cosh(float number)
floatReturns the hyperbolic cosine of the number, defined as (exp(number) + exp(-number))/2.
tanh(float number)
floatReturns the hyperbolic tangent of the number, defined as sinh(number)/cosh(number).
asinh(float number)
floatReturns the inverse hyperbolic sine of the number, that is, the value whose hyperbolic sine is number.
acosh(float number)
floatReturns the inverse hyperbolic cosine of the number, that is, the value whose hyperbolic cosine is number.
atanh(float number) ...

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.