Garry's Mod Wiki

math.abs

math.abs

  number math.abs( number x )

Description

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

Arguments

1 number x
The number to get the absolute value of.

Returns

1 number
The absolute value.

Example

Demonstrates what this function does.

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

Special Pages


Wikis

?

Render Time: 21ms

DB GetPage 2
Generate Html 2
SaveChanges (1) 5
Render Body 0
Render Sidebar 9