代码拉取完成,页面将自动刷新
同步操作将从 landy/qlang 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package math
import (
"math"
"reflect"
"strings"
"qlang.io/qlang.spec.v1"
)
// -----------------------------------------------------------------------------
func init() {
fnt := qlang.Fntable
fnt["e"] = math.E
fnt["pi"] = math.Pi
fnt["phi"] = math.Phi
fnt["Inf"] = math.Inf(1)
fnt["NaN"] = math.NaN()
}
// -----------------------------------------------------------------------------
// Exports is the export table of this module.
//
var Exports = map[string]interface{}{
"_name": "math",
"abs": math.Abs,
"acos": math.Acos,
"acosh": math.Acosh,
"asin": math.Asin,
"asinh": math.Asinh,
"atan": math.Atan,
"atan2": math.Atan2,
"atanh": math.Atanh,
"cbrt": math.Cbrt,
"ceil": math.Ceil,
"copysign": math.Copysign,
"cos": math.Cos,
"cosh": math.Cosh,
"dim": math.Dim,
"erf": math.Erf,
"erfc": math.Erfc,
"exp": math.Exp,
"exp2": math.Exp2,
"expm1": math.Expm1,
"floor": math.Floor,
"gamma": math.Gamma,
"hypot": math.Hypot,
"inf": math.Inf,
"j0": math.J0,
"j1": math.J1,
"jn": math.Jn,
"ldexp": math.Ldexp,
"ln": math.Log,
"log": math.Log,
"log10": math.Log10,
"log1p": math.Log1p,
"log2": math.Log2,
"logb": math.Logb,
"mod": mod,
"nextafter": math.Nextafter,
"pow": math.Pow,
"pow10": math.Pow10,
"remainder": math.Remainder,
"sin": math.Sin,
"sinh": math.Sinh,
"sqrt": math.Sqrt,
"tan": math.Tan,
"tanh": math.Tanh,
"trunc": math.Trunc,
"y0": math.Y0,
"y1": math.Y1,
"yn": math.Yn,
}
// -----------------------------------------------------------------------------
func mod(a, b interface{}) interface{} {
return math.Mod(castFloat(a), castFloat(b))
}
func castFloat(a interface{}) float64 {
switch a1 := a.(type) {
case int:
return float64(a1)
case float64:
return a1
}
panicUnsupportedFn("float", a)
return 0
}
func panicUnsupportedFn(fn string, args ...interface{}) interface{} {
targs := make([]string, len(args))
for i, a := range args {
targs[i] = reflect.TypeOf(a).String()
}
panic("unsupported function: " + fn + "(" + strings.Join(targs, ",") + ")")
}
// -----------------------------------------------------------------------------
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。