Skip to content
ezeioDocs
  1. Reference
  2. Script reference
  3. Math and control

ABS

Macro that will return the absolute value

Description#

ABS( number )

Returns the absolute value of the given number.

Works with both float and integer parameters.

Parameters#

number input value

Return value#

Returns the absolute value of number.

Example usage#

   new Float:x;
   new i;
 
   x = ABS( 123.45 );     // 123.45
   i = ABS( 456 );        // 456
 
   x = ABS( -123.45 );    // 123.45
   i = ABS( -456 );       // 456

Last updated Sep 27, 2021