We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent beb3825 commit 414cc82Copy full SHA for 414cc82
compiler/src/IR.hs
@@ -292,6 +292,7 @@ instance WellFormedIRCheck IRExpr where
292
, "_setFailureRate"
293
, "sleep"
294
, "spawn"
295
+ , "sqrt"
296
, "substring"
297
, "stringToInt"
298
, "restore"
rt/src/builtins/math.mts
@@ -26,5 +26,12 @@ export function BuiltinMath <TBase extends Constructor<UserRuntimeZero>> (Base:T
26
assertIsNumber(arg);
27
return this.runtime.ret(new LVal(Math.floor(arg.val), arg.lev, arg.tlev));
28
})
29
+
30
+ sqrt = mkBase((arg) => {
31
+ assertIsNumber(arg);
32
+ return this.runtime.ret(new LVal(Math.sqrt(arg.val), arg.lev, arg.tlev));
33
+ })
34
35
36
}
37
0 commit comments