Home > PHP > Function > Math > abs()

abs()

abs - Absolute value

Syntax

number abs (mixed $number)

Arguments

  • number - The numeric value to process

Description

Returns the absolute value of number.

Version

PHP 4, 5

Return value

The absolute value of number. If the argument number is of type float, the return type is also float, otherwise it is integer (as float usually has a bigger value range than integer).