math.abs

From Garry's Mod
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