ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:abs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
functions:abs [2017/03/12 21:32] – [Examples] korshunfunctions:abs [2017/04/17 15:13] (current) korshun
Line 1: Line 1:
 ====== abs ====== ====== abs ======
 +{{tag>math}}
 ''num abs(num x)'' ''num abs(num x)''
 +
 +[[:types|num - any numeric type (int or fixed)]]
  
 ===== Description ===== ===== Description =====
-Returns the absolute value of ''x''.+Returns the absolute value of x. 
 + 
 +<note important>''abs(INT_MIN)'' returns [[constants:INT_MIN]], not [[constants:INT_MAX]].</note>
  
 ===== Examples ===== ===== Examples =====
 <code> <code>
-abs( 2.1) -> 2.1; +abs( 2.1) -> 2.1 
-abs(-2.1) -> 2.1; +abs(-2.1) -> 2.1 
-abs( 123) -> 123; +abs( 123) -> 123 
-abs(-123) -> 123;+abs(-123) -> 123
 </code> </code>
functions/abs.1489347164.txt.gz · Last modified: 2017/03/12 21:32 by korshun