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

Method atanh

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

Source from the content-addressed store, hash-verified

154 }
155
156 private static Object atanh(
157 Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args) {
158 double x = ScriptRuntime.toNumber(args, 0);
159 if (!Double.isNaN(x) && -1.0 <= x && x <= 1.0) {
160 if (x == 0) {
161 if (1 / x > 0) {
162 return ScriptRuntime.zeroObj;
163 }
164 return ScriptRuntime.negativeZeroObj;
165 }
166 return Double.valueOf(0.5 * Math.log((1.0 + x) / (1.0 - x)));
167 }
168 return ScriptRuntime.NaNobj;
169 }
170
171 private static Object atan2(
172 Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args) {

Callers 1

math-functions.jsFile · 0.80

Calls 4

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

Tested by

no test coverage detected