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

Method asinh

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

Source from the content-addressed store, hash-verified

129 }
130
131 private static Object asinh(
132 Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args) {
133 double x = ScriptRuntime.toNumber(args, 0);
134 if (Double.isInfinite(x)) {
135 return Double.valueOf(x);
136 }
137 if (!Double.isNaN(x)) {
138 if (x == 0) {
139 if (1 / x > 0) {
140 return ScriptRuntime.zeroObj;
141 }
142 return ScriptRuntime.negativeZeroObj;
143 }
144 return Double.valueOf(Math.log(x + Math.sqrt(x * x + 1.0)));
145 }
146 return ScriptRuntime.NaNobj;
147 }
148
149 private static Object atan(
150 Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args) {

Callers 1

math-functions.jsFile · 0.80

Calls 5

toNumberMethod · 0.95
logMethod · 0.80
sqrtMethod · 0.80
valueOfMethod · 0.45
isNaNMethod · 0.45

Tested by

no test coverage detected