Skip to content

Commit 40bcf8b

Browse files
Sharktheoneptomato
authored andcommitted
Add test for Number.MIN_VALUE's value
1 parent 2d3912c commit 40bcf8b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (C) 2026 Luna Pfeiffer. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-number.min_value
6+
description: >
7+
Number.MIN_VALUE is approximately 5e-324. We can't directly compare it as the spec states:
8+
9+
In the IEEE 754-2019 double precision binary representation, the smallest possible value is a denormalized number.
10+
If an implementation does not support denormalized values, the value of Number.MIN_VALUE must be the smallest
11+
non-zero positive value that can actually be represented by the implementation.
12+
---*/
13+
14+
15+
assert.sameValue(typeof Number.MIN_VALUE, "number", "Number.MIN_VALUE should be a number");
16+
assert(Number.MIN_VALUE > 0, "Number.MIN_VALUE must be positive");
17+
18+
assert(Number.MIN_VALUE < Number.EPSILON, "Number.MIN_VALUE should be smaller than Number.EPSILON")
19+
20+
assert.sameValue(Number.MIN_VALUE / 2, 0, "Number.MIN_VALUE divided by 2 should underflow to 0");

0 commit comments

Comments
 (0)