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

Method log2

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

Source from the content-addressed store, hash-verified

488 }
489
490 private static Object log2(
491 Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args) {
492 double x = ScriptRuntime.toNumber(args, 0);
493 // Java's log(<0) = -Infinity; we need NaN
494 x = (x < 0) ? Double.NaN : Math.log(x) * LOG2E;
495 return ScriptRuntime.wrapNumber(x);
496 }
497
498 private static Object max(
499 Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args) {

Callers 1

math-functions.jsFile · 0.80

Calls 3

toNumberMethod · 0.95
wrapNumberMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected