math.fmod

From GMod Wiki

Revision as of 22:04, 19 March 2010 by Zero5100 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax math.fmod( Float num, Float divBy )
Where is this used?
Description:
Returns the remainder of the division operation.
Returns: Float
Part of Library: Math
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Math.fmod]Math.fmod [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionFinds the remainder.
Used onNewerShared.png
Code
--42/5=8.4
--8*5=40
--42-40=2
myNumber=math.fmod(42,5)
OutputmyNumber is set to 2.


Additional Notes

local example = 1 % 6

Is the same as:

local example = math.fmod( 1, 6 )
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox