math.modf

From GMod Wiki

Jump to: navigation, search
Function
Syntax math.modf( x )
Where is this used?
Description:
Returns two numbers, the integral part of x and the fractional part of x.
Returns: Number number
Part of Library: Math
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Math.modf]Math.modf [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionReturns two numbers, the integral part of a number and the fractional part of number.
Used onNewerShared.png
Code
i, f = math.modf(18.4)
Outputi = 18, f = 0.4
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox