mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Add tests for Math constants
Closes gh-540 Because the specific value of each constant is specified as a host-defined approximation, only the value type may be enforced by Test262.
This commit is contained in:
parent
f7aa31b41f
commit
b698c8b3ab
15
test/built-ins/Math/E/value.js
Normal file
15
test/built-ins/Math/E/value.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Math.E is a numeric value
|
||||
esid: sec-math.e
|
||||
es6id: 20.2.1.1
|
||||
info: >
|
||||
The Number value for e, the base of the natural logarithms, which is
|
||||
approximately 2.7182818284590452354.
|
||||
|
||||
The precision of this approximation is host-defined.
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Math.E, 'number');
|
||||
assert.notSameValue(Math.E, NaN);
|
15
test/built-ins/Math/LN10/value.js
Normal file
15
test/built-ins/Math/LN10/value.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Math.LN10 is a numeric value
|
||||
esid: sec-math.ln10
|
||||
es6id: 20.2.1.2
|
||||
info: >
|
||||
The Number value for the natural logarithm of 10, which is approximately
|
||||
2.302585092994046.
|
||||
|
||||
The precision of this approximation is host-defined.
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Math.LN10, 'number');
|
||||
assert.notSameValue(Math.LN10, NaN);
|
15
test/built-ins/Math/LN2/value.js
Normal file
15
test/built-ins/Math/LN2/value.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Math.LN2 is a numeric value
|
||||
esid: sec-math.ln2
|
||||
es6id: 20.2.1.3
|
||||
info: >
|
||||
The Number value for the natural logarithm of 2, which is approximately
|
||||
0.6931471805599453.
|
||||
|
||||
The precision of this approximation is host-defined.
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Math.LN2, 'number');
|
||||
assert.notSameValue(Math.LN2, NaN);
|
15
test/built-ins/Math/LOG10E/value.js
Normal file
15
test/built-ins/Math/LOG10E/value.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Math.LOG10E is a numeric value
|
||||
esid: sec-math.log10e
|
||||
es6id: 20.2.1.4
|
||||
info: >
|
||||
The Number value for the base-10 logarithm of e, the base of the natural
|
||||
logarithms; this value is approximately 0.4342944819032518.
|
||||
|
||||
The precision of this approximation is host-defined.
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Math.LOG10E, 'number');
|
||||
assert.notSameValue(Math.LOG10E, NaN);
|
15
test/built-ins/Math/LOG2E/value.js
Normal file
15
test/built-ins/Math/LOG2E/value.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Math.LOG2E is a numeric value
|
||||
esid: sec-math.log2e
|
||||
es6id: 20.2.1.5
|
||||
info: >
|
||||
The Number value for the base-2 logarithm of e, the base of the natural
|
||||
logarithms; this value is approximately 1.4426950408889634.
|
||||
|
||||
The precision of this approximation is host-defined.
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Math.LOG2E, 'number');
|
||||
assert.notSameValue(Math.LOG2E, NaN);
|
15
test/built-ins/Math/PI/value.js
Normal file
15
test/built-ins/Math/PI/value.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Math.PI is a numeric value
|
||||
esid: sec-math.pi
|
||||
es6id: 20.2.1.6
|
||||
info: >
|
||||
The Number value for pi, the ratio of the circumference of a circle to its
|
||||
diameter, which is approximately 3.1415926535897932.
|
||||
|
||||
The precision of this approximation is host-defined.
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Math.PI, 'number');
|
||||
assert.notSameValue(Math.PI, NaN);
|
15
test/built-ins/Math/SQRT1_2/value.js
Normal file
15
test/built-ins/Math/SQRT1_2/value.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Math.SQRT1_2 is a numeric value
|
||||
esid: sec-math.sqrt1_2
|
||||
es6id: 20.2.1.7
|
||||
info: >
|
||||
The Number value for the square root of `1/2`, which is approximately
|
||||
0.7071067811865476.
|
||||
|
||||
The precision of this approximation is host-defined.
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Math.SQRT1_2, 'number');
|
||||
assert.notSameValue(Math.SQRT1_2, NaN);
|
15
test/built-ins/Math/SQRT2/value.js
Normal file
15
test/built-ins/Math/SQRT2/value.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Math.SQRT2 is a numeric value
|
||||
esid: sec-math.sqrt2
|
||||
es6id: 20.2.1.8
|
||||
info: >
|
||||
The Number value for the square root of 2, which is approximately
|
||||
1.4142135623730951.
|
||||
|
||||
The precision of this approximation is host-defined.
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Math.SQRT2, 'number');
|
||||
assert.notSameValue(Math.SQRT2, NaN);
|
Loading…
x
Reference in New Issue
Block a user