MCPcopy Create free account
hub / github.com/mozilla/rhino / trunc

Method trunc

rhino/src/main/java/org/mozilla/javascript/NativeMath.java:653–658  ·  view source on GitHub ↗
(
            Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args)

Source from the content-addressed store, hash-verified

651 }
652
653 private static Object trunc(
654 Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args) {
655 double x = ScriptRuntime.toNumber(args, 0);
656 x = ((x < 0.0) ? Math.ceil(x) : Math.floor(x));
657 return ScriptRuntime.wrapNumber(x);
658 }
659}

Callers 2

makeArrayFunction · 0.80
math-functions.jsFile · 0.80

Calls 4

toNumberMethod · 0.95
wrapNumberMethod · 0.95
ceilMethod · 0.80
floorMethod · 0.80

Tested by

no test coverage detected