forked from zloirock/core-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathes.math.log10.js
28 lines (26 loc) · 1004 Bytes
/
es.math.log10.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
import { createConversionChecker } from '../helpers/helpers';
QUnit.test('Math.log10', assert => {
const { log10 } = Math;
assert.isFunction(log10);
assert.name(log10, 'log10');
assert.arity(log10, 1);
assert.looksNative(log10);
assert.nonEnumerable(Math, 'log10');
assert.same(log10(''), log10(0));
assert.same(log10(NaN), NaN);
assert.same(log10(-1), NaN);
assert.same(log10(0), -Infinity);
assert.same(log10(-0), -Infinity);
assert.same(log10(1), 0);
assert.same(log10(Infinity), Infinity);
assert.epsilon(log10(0.1), -1);
assert.epsilon(log10(0.5), -0.3010299956639812);
assert.epsilon(log10(1.5), 0.17609125905568124);
assert.epsilon(log10(5), 0.6989700043360189);
assert.epsilon(log10(50), 1.6989700043360187);
assert.epsilon(log10(1000), 3);
const checker = createConversionChecker(0.5);
assert.epsilon(log10(checker), -0.3010299956639812);
assert.same(checker.$valueOf, 1, 'valueOf calls');
assert.same(checker.$toString, 0, 'toString calls');
});