You are here : phpmathabs

abs() - math

Returns the absolute value of number.
Parameters :
  • number - The numeric value to process

  • Syntax

    number abs
         ( mixed $number
        )


    Example

    <?phpecho abs(-4.2); // 4.2 (double/float)echo abs(5);    // 5 (integer)echo abs(-5);   // 5 (integer)?>


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference