Garry's Mod Wiki

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
absolute_value

Example

Demonstrates what this function does.

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

15

Page Links


Special Pages


Wikis

?

Render Time: 34ms

DB GetPage 7
Generate Html 3
SaveChanges (1) 16
Render Body 0
Render Sidebar 6