|
@@ -1488,6 +1488,12 @@ void add_module_math(VM* vm){
|
|
|
vm->bind_func<1>(mod, "isinf", PK_LAMBDA(VAR(std::isinf(CAST_F(args[0])))));
|
|
vm->bind_func<1>(mod, "isinf", PK_LAMBDA(VAR(std::isinf(CAST_F(args[0])))));
|
|
|
vm->bind_func<1>(mod, "isnan", PK_LAMBDA(VAR(std::isnan(CAST_F(args[0])))));
|
|
vm->bind_func<1>(mod, "isnan", PK_LAMBDA(VAR(std::isnan(CAST_F(args[0])))));
|
|
|
|
|
|
|
|
|
|
+ vm->bind_func<2>(mod, "isclose", [](VM* vm, ArgsView args) {
|
|
|
|
|
+ f64 a = CAST_F(args[0]);
|
|
|
|
|
+ f64 b = CAST_F(args[1]);
|
|
|
|
|
+ return VAR(std::fabs(a - b) <= Number::kEpsilon);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
vm->bind_func<1>(mod, "exp", PK_LAMBDA(VAR(std::exp(CAST_F(args[0])))));
|
|
vm->bind_func<1>(mod, "exp", PK_LAMBDA(VAR(std::exp(CAST_F(args[0])))));
|
|
|
vm->bind_func<1>(mod, "log", PK_LAMBDA(VAR(std::log(CAST_F(args[0])))));
|
|
vm->bind_func<1>(mod, "log", PK_LAMBDA(VAR(std::log(CAST_F(args[0])))));
|
|
|
vm->bind_func<1>(mod, "log2", PK_LAMBDA(VAR(std::log2(CAST_F(args[0])))));
|
|
vm->bind_func<1>(mod, "log2", PK_LAMBDA(VAR(std::log2(CAST_F(args[0])))));
|