mirror of
https://github.com/robertkrimen/otto
synced 2025-10-26 20:28:49 +08:00
Add Math.abs
This commit is contained in:
@@ -7,6 +7,11 @@ import (
|
||||
|
||||
// Math
|
||||
|
||||
func builtinMath_abs(call FunctionCall) Value {
|
||||
number := toFloat(call.Argument(0))
|
||||
return toValue(math.Abs(number))
|
||||
}
|
||||
|
||||
func builtinMath_acos(call FunctionCall) Value {
|
||||
number := toFloat(call.Argument(0))
|
||||
return toValue(math.Acos(number))
|
||||
|
||||
Reference in New Issue
Block a user