@@ -529,7 +529,6 @@ FloatingPoint.test("${Self}.significandWidth") {
529
529
%end
530
530
531
531
let floatNextUpDownTests: [(Float, Float)] = [
532
- (.nan, .nan),
533
532
(.greatestFiniteMagnitude, .infinity),
534
533
(0x1.ffff_fe__p-1, 1.0), (1.0, 0x1.0000_02__p+0),
535
534
(0.0, .leastNonzeroMagnitude),
@@ -553,7 +552,6 @@ FloatingPoint.test("Float.nextUp, .nextDown")
553
552
}
554
553
555
554
let doubleNextUpDownTests: [(Double, Double)] = [
556
- (.nan, .nan),
557
555
(.greatestFiniteMagnitude, .infinity),
558
556
(0x1.ffff_ffff_ffff_fp-1, 1.0), (1.0, 0x1.0000_0000_0000_1p+0),
559
557
(0.0, .leastNonzeroMagnitude),
@@ -576,6 +574,16 @@ FloatingPoint.test("Double.nextUp, .nextDown")
576
574
expectBitwiseEqual(-prev, (-succ).nextUp)
577
575
}
578
576
577
+ %for Self in ['Float', 'Double']:
578
+ FloatingPoint.test("${Self}.nextUp, .nextDown/nan") {
579
+ let x = ${Self}.nan
580
+ expectBitwiseEqual(x, x.nextUp)
581
+ expectBitwiseEqual(x, x.nextDown)
582
+ expectTrue((-x).nextDown.isNaN)
583
+ expectTrue((-x).nextUp.isNaN)
584
+ }
585
+ %end
586
+
579
587
#if arch(i386) || arch(x86_64)
580
588
581
589
FloatingPoint.test("Float80/ExpressibleByIntegerLiteral") {
0 commit comments