math.abs

From Garry's Mod
Revision as of 10:19, 18 May 2016 by NeatNit (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 math.abs( )

Contents

Description

Calculates the absolute value of a number (effectively removes any negative sign).

Arguments

number x

The number to get the absolute value of.

Returns

number

absolute_value

Examples

Example

Demonstrates what this function does.

print( math.abs( 15 ) )
print( math.abs( -15 ) )

Output:


15
15
Personal tools
Navigation