math.log

From GMod Wiki

Jump to: navigation, search
Function
Syntax math.log( x )
Where is this used?
Description:
Returns the logarithm to a number with the base e (2.71828...). Also called natural logarithm
Returns: Number number
Part of Library: Math
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Math.log]Math.log [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionShows how to use the function
Used onNewerShared.png
Code
 
print(math.log(2))
print(math.log(2)/math.log(3)) -- This is the same as log3(2) - however log base 10 is the only other function regarding logs in lua.
 
Output0.30103 and 0.63093


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox