math.abs

From GMod Wiki

Jump to: navigation, search
Function
Syntax math.abs( Number number )
Where is this used?
Description:
Returns the absolute value of the first argument.
Returns: Number absoluteValueOfNumber
Part of Library: Math
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Math.abs]Math.abs [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints the absolute value of -500.25
Used onNewerShared.png
Code
print( math.abs( -500.25 ) )
Output500.25
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox