Garry's Mod Wiki

Garry's Mod Wiki

  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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...