Skip to content

Commit 96a8d9f

Browse files
committed
stdlib: floating point test: remove redundant tests and add digit separators for readability
1 parent bb2eec8 commit 96a8d9f

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

test/1_stdlib/FloatingPoint.swift.gyb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,9 @@ FloatingPoint.test("Double/HashValueZero") {
200200
let floatNextUpDownTests: [(Float, Float)] = [
201201
(.nan, .nan),
202202
(.greatestFiniteMagnitude, .infinity),
203-
(-.infinity, -.greatestFiniteMagnitude),
204-
(0x1.fffffep-1, 1.0), (1.0, 0x1.000002p+0),
205-
(-0x1p-149, -0.0), (0.0, 0x1p-149),
206-
(0x1.effffep-1, 0.96875), (0.96875, 0x1.f00002p-1),
203+
(0x1.ffff_fe__p-1, 1.0), (1.0, 0x1.0000_02__p+0),
204+
(0.0, .leastNonzeroMagnitude),
205+
(0x1.efff_fe__p-1, 0x1.fp-1), (0x1.fp-1, 0x1.f000_02__p-1),
207206
]
208207

209208
FloatingPoint.test("Float.nextUp, .nextDown")
@@ -218,10 +217,9 @@ FloatingPoint.test("Float.nextUp, .nextDown")
218217
let doubleNextUpDownTests: [(Double, Double)] = [
219218
(.nan, .nan),
220219
(.greatestFiniteMagnitude, .infinity),
221-
(-.infinity, -.greatestFiniteMagnitude),
222-
(0x1.fffffffffffffp-1, 1.0), (1.0, 0x1.0000000000001p+0),
223-
(-0x1p-1074, -0.0), (0.0, 0x1p-1074),
224-
(0x1.effffffffffffp-1, 0.96875), (0.96875, 0x1.f000000000001p-1),
220+
(0x1.ffff_ffff_ffff_fp-1, 1.0), (1.0, 0x1.0000_0000_0000_1p+0),
221+
(0.0, .leastNonzeroMagnitude),
222+
(0x1.efff_ffff_ffff_fp-1, 0x1.fp-1), (0x1.fp-1, 0x1.f000_0000_0000_1p-1),
225223
]
226224

227225
FloatingPoint.test("Double.nextUp, .nextDown")

0 commit comments

Comments
 (0)