-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathes.math.atanh.js
29 lines (27 loc) · 1.01 KB
/
es.math.atanh.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { createConversionChecker } from '../helpers/helpers.js';
QUnit.test('Math.atanh', assert => {
const { atanh } = Math;
assert.isFunction(atanh);
assert.name(atanh, 'atanh');
assert.arity(atanh, 1);
assert.looksNative(atanh);
assert.nonEnumerable(Math, 'atanh');
assert.same(atanh(NaN), NaN);
assert.same(atanh(-2), NaN);
assert.same(atanh(-1.5), NaN);
assert.same(atanh(2), NaN);
assert.same(atanh(1.5), NaN);
assert.same(atanh(-1), -Infinity);
assert.same(atanh(1), Infinity);
assert.same(atanh(0), 0);
assert.same(atanh(-0), -0);
assert.same(atanh(-1e300), NaN);
assert.same(atanh(1e300), NaN);
assert.closeTo(atanh(0.5), 0.5493061443340549, 1e-11);
assert.closeTo(atanh(-0.5), -0.5493061443340549, 1e-11);
assert.closeTo(atanh(0.444), 0.47720201260109457, 1e-11);
const checker = createConversionChecker(0.5);
assert.closeTo(atanh(checker), 0.5493061443340549, 1e-11);
assert.same(checker.$valueOf, 1, 'valueOf calls');
assert.same(checker.$toString, 0, 'toString calls');
});