Skip to content

abs

NAME

abs() - return the absolute value of a number

SYNOPSIS

mixed abs( int | float number );

DESCRIPTION

Returns the absolute value of the supplied <number>.

EXAMPLE

int value = abs( 10 );      // 10
int value = abs( -10 );     // 10
float value = abs( 3.14 );  // 3.140000
float value = abs( -3.14 ); // 3.140000