1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Add Math.log

This commit is contained in:
Robert Krimen
2013-02-27 15:03:24 -08:00
parent fc55f7c7d9
commit fdcc597591
3 changed files with 20 additions and 0 deletions

View File

@@ -54,6 +54,11 @@ func builtinMath_floor(call FunctionCall) Value {
return toValue(math.Floor(number))
}
func builtinMath_log(call FunctionCall) Value {
number := toFloat(call.Argument(0))
return toValue(math.Log(number))
}
func builtinMath_max(call FunctionCall) Value {
switch len(call.ArgumentList) {
case 0: