Lines Matching refs:APFloat

22   llvm::APFloat F(0.0);  in convertToDoubleFromString()
23 F.convertFromString(Str, llvm::APFloat::rmNearestTiesToEven); in convertToDoubleFromString()
29 llvm::APFloat F(d); in convertToString()
41 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, false).isSignaling()); in TEST()
42 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, true).isSignaling()); in TEST()
43 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, false, &payload).isSignaling()); in TEST()
44 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, true, &payload).isSignaling()); in TEST()
45 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, false).isSignaling()); in TEST()
46 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, true).isSignaling()); in TEST()
47 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, false, &payload).isSignaling()); in TEST()
48 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, true, &payload).isSignaling()); in TEST()
53 APFloat test(APFloat::IEEEquad, APFloat::uninitialized); in TEST()
54 APFloat expected(APFloat::IEEEquad, APFloat::uninitialized); in TEST()
72 test = APFloat::getInf(APFloat::IEEEquad, false); in TEST()
73 expected = APFloat::getInf(APFloat::IEEEquad, false); in TEST()
74 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
80 test = APFloat::getInf(APFloat::IEEEquad, false); in TEST()
81 expected = APFloat::getLargest(APFloat::IEEEquad, false); in TEST()
82 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
87 test = APFloat::getInf(APFloat::IEEEquad, true); in TEST()
88 expected = APFloat::getLargest(APFloat::IEEEquad, true); in TEST()
89 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
94 test = APFloat::getInf(APFloat::IEEEquad, true); in TEST()
95 expected = APFloat::getInf(APFloat::IEEEquad, true); in TEST()
96 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
101 test = APFloat::getLargest(APFloat::IEEEquad, false); in TEST()
102 expected = APFloat::getInf(APFloat::IEEEquad, false); in TEST()
103 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
110 test = APFloat::getLargest(APFloat::IEEEquad, false); in TEST()
111 expected = APFloat(APFloat::IEEEquad, in TEST()
113 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
118 test = APFloat::getLargest(APFloat::IEEEquad, true); in TEST()
119 expected = APFloat(APFloat::IEEEquad, in TEST()
121 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
125 test = APFloat::getLargest(APFloat::IEEEquad, true); in TEST()
126 expected = APFloat::getInf(APFloat::IEEEquad, true); in TEST()
127 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
132 test = APFloat(APFloat::IEEEquad, "0x0.0000000000000000000000000001p-16382"); in TEST()
133 expected = APFloat(APFloat::IEEEquad, in TEST()
135 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
139 test = APFloat(APFloat::IEEEquad, "0x0.0000000000000000000000000001p-16382"); in TEST()
140 expected = APFloat::getZero(APFloat::IEEEquad, false); in TEST()
141 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
146 test = APFloat(APFloat::IEEEquad, "-0x0.0000000000000000000000000001p-16382"); in TEST()
147 expected = APFloat::getZero(APFloat::IEEEquad, true); in TEST()
148 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
153 test = APFloat(APFloat::IEEEquad, "-0x0.0000000000000000000000000001p-16382"); in TEST()
154 expected = APFloat(APFloat::IEEEquad, in TEST()
156 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
160 test = APFloat::getQNaN(APFloat::IEEEquad, false); in TEST()
161 expected = APFloat::getQNaN(APFloat::IEEEquad, false); in TEST()
162 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
166 test = APFloat::getQNaN(APFloat::IEEEquad, false); in TEST()
167 expected = APFloat::getQNaN(APFloat::IEEEquad, false); in TEST()
168 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
172 test = APFloat::getSNaN(APFloat::IEEEquad, false); in TEST()
173 expected = APFloat::getQNaN(APFloat::IEEEquad, false); in TEST()
174 EXPECT_EQ(test.next(false), APFloat::opInvalidOp); in TEST()
178 test = APFloat::getSNaN(APFloat::IEEEquad, false); in TEST()
179 expected = APFloat::getQNaN(APFloat::IEEEquad, false); in TEST()
180 EXPECT_EQ(test.next(true), APFloat::opInvalidOp); in TEST()
184 test = APFloat::getZero(APFloat::IEEEquad, false); in TEST()
185 expected = APFloat::getSmallest(APFloat::IEEEquad, false); in TEST()
186 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
190 test = APFloat::getZero(APFloat::IEEEquad, false); in TEST()
191 expected = APFloat::getSmallest(APFloat::IEEEquad, true); in TEST()
192 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
196 test = APFloat::getZero(APFloat::IEEEquad, true); in TEST()
197 expected = APFloat::getSmallest(APFloat::IEEEquad, false); in TEST()
198 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
202 test = APFloat::getZero(APFloat::IEEEquad, true); in TEST()
203 expected = APFloat::getSmallest(APFloat::IEEEquad, true); in TEST()
204 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
216 test = APFloat(APFloat::IEEEquad, "0x0.ffffffffffffffffffffffffffffp-16382"); in TEST()
217 expected = APFloat(APFloat::IEEEquad, in TEST()
219 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
224 test = APFloat(APFloat::IEEEquad, in TEST()
226 expected = APFloat(APFloat::IEEEquad, in TEST()
228 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
233 test = APFloat(APFloat::IEEEquad, in TEST()
235 expected = APFloat(APFloat::IEEEquad, in TEST()
237 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
242 test = APFloat(APFloat::IEEEquad, in TEST()
244 expected = APFloat(APFloat::IEEEquad, in TEST()
246 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
257 test = APFloat(APFloat::IEEEquad, "-0x1p+1"); in TEST()
258 expected = APFloat(APFloat::IEEEquad, in TEST()
260 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
264 test = APFloat(APFloat::IEEEquad, "0x1p+1"); in TEST()
265 expected = APFloat(APFloat::IEEEquad, "0x1.ffffffffffffffffffffffffffffp+0"); in TEST()
266 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
270 test = APFloat(APFloat::IEEEquad, "0x1.ffffffffffffffffffffffffffffp+0"); in TEST()
271 expected = APFloat(APFloat::IEEEquad, "0x1p+1"); in TEST()
272 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
276 test = APFloat(APFloat::IEEEquad, "-0x1.ffffffffffffffffffffffffffffp+0"); in TEST()
277 expected = APFloat(APFloat::IEEEquad, "-0x1p+1"); in TEST()
278 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
293 test = APFloat(APFloat::IEEEquad, "-0x0.ffffffffffffffffffffffffffffp-16382"); in TEST()
294 expected = APFloat(APFloat::IEEEquad, in TEST()
296 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
302 test = APFloat(APFloat::IEEEquad, "0x0.ffffffffffffffffffffffffffffp-16382"); in TEST()
303 expected = APFloat(APFloat::IEEEquad, in TEST()
305 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
311 test = APFloat(APFloat::IEEEquad, "0x1.0000000000000000000000000000p-16382"); in TEST()
312 expected = APFloat(APFloat::IEEEquad, in TEST()
314 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
320 test = APFloat(APFloat::IEEEquad, "-0x1.0000000000000000000000000000p-16382"); in TEST()
321 expected = APFloat(APFloat::IEEEquad, in TEST()
323 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
338 test = APFloat(APFloat::IEEEquad, "-0x1p-16381"); in TEST()
339 expected = APFloat(APFloat::IEEEquad, in TEST()
341 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
346 test = APFloat(APFloat::IEEEquad, "-0x1.ffffffffffffffffffffffffffffp-16382"); in TEST()
347 expected = APFloat(APFloat::IEEEquad, "-0x1p-16381"); in TEST()
348 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
352 test = APFloat(APFloat::IEEEquad, "0x1.ffffffffffffffffffffffffffffp-16382"); in TEST()
353 expected = APFloat(APFloat::IEEEquad, "0x1p-16381"); in TEST()
354 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
358 test = APFloat(APFloat::IEEEquad, "0x1p-16381"); in TEST()
359 expected = APFloat(APFloat::IEEEquad, in TEST()
361 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
376 test = APFloat(APFloat::IEEEquad, in TEST()
378 expected = APFloat(APFloat::IEEEquad, in TEST()
380 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
386 test = APFloat(APFloat::IEEEquad, in TEST()
388 expected = APFloat(APFloat::IEEEquad, in TEST()
390 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
396 test = APFloat(APFloat::IEEEquad, in TEST()
398 expected = APFloat(APFloat::IEEEquad, in TEST()
400 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
406 test = APFloat(APFloat::IEEEquad, in TEST()
408 expected = APFloat(APFloat::IEEEquad, in TEST()
410 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
416 test = APFloat(APFloat::IEEEquad, in TEST()
418 expected = APFloat(APFloat::IEEEquad, in TEST()
420 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
426 test = APFloat(APFloat::IEEEquad, in TEST()
428 expected = APFloat(APFloat::IEEEquad, in TEST()
430 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
436 test = APFloat(APFloat::IEEEquad, in TEST()
438 expected = APFloat(APFloat::IEEEquad, in TEST()
440 EXPECT_EQ(test.next(false), APFloat::opOK); in TEST()
446 test = APFloat(APFloat::IEEEquad, in TEST()
448 expected = APFloat(APFloat::IEEEquad, in TEST()
450 EXPECT_EQ(test.next(true), APFloat::opOK); in TEST()
457 APFloat::roundingMode rdmd = APFloat::rmNearestTiesToEven; in TEST()
460 APFloat f1(14.5f); in TEST()
461 APFloat f2(-14.5f); in TEST()
462 APFloat f3(225.0f); in TEST()
463 f1.fusedMultiplyAdd(f2, f3, APFloat::rmNearestTiesToEven); in TEST()
468 APFloat Val2(2.0f); in TEST()
469 APFloat f1((float)1.17549435e-38F); in TEST()
470 APFloat f2((float)1.17549435e-38F); in TEST()
473 APFloat f3(12.0f); in TEST()
474 f1.fusedMultiplyAdd(f2, f3, APFloat::rmNearestTiesToEven); in TEST()
481 APFloat f1(1.0); in TEST()
482 APFloat f2(-1.0); in TEST()
483 APFloat f3(1.0); in TEST()
484 f1.fusedMultiplyAdd(f2, f3, APFloat::rmNearestTiesToEven); in TEST()
492 APFloat f1(1.0); in TEST()
493 APFloat f2(-1.0); in TEST()
494 APFloat f3(1.0); in TEST()
495 f1.fusedMultiplyAdd(f2, f3, APFloat::rmTowardNegative); in TEST()
502 APFloat f1(0.0); in TEST()
503 APFloat f2(-0.0); in TEST()
504 APFloat f3(-0.0); in TEST()
505 f1.fusedMultiplyAdd(f2, f3, APFloat::rmNearestTiesToEven); in TEST()
511 APFloat f1(APFloat::IEEEdouble, "-0x1p-1074"); in TEST()
512 APFloat f2(APFloat::IEEEdouble, "+0x1p-1074"); in TEST()
513 APFloat f3(0.0); in TEST()
514 f1.fusedMultiplyAdd(f2, f3, APFloat::rmNearestTiesToEven); in TEST()
520 APFloat M1(APFloat::x87DoubleExtended, 1.0); in TEST()
521 APFloat M2(APFloat::x87DoubleExtended, 1.0); in TEST()
522 APFloat A(APFloat::x87DoubleExtended, 3.0); in TEST()
525 M1.fusedMultiplyAdd(M1, A, APFloat::rmNearestTiesToEven); in TEST()
526 M1.convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, &losesInfo); in TEST()
533 APFloat f1(1.0); in TEST()
534 APFloat f2(2.0); in TEST()
535 APFloat nan = APFloat::getNaN(APFloat::IEEEdouble); in TEST()
544 APFloat f1(1.0); in TEST()
545 APFloat f2(2.0); in TEST()
546 APFloat nan = APFloat::getNaN(APFloat::IEEEdouble); in TEST()
555 APFloat::roundingMode rdmd = APFloat::rmNearestTiesToEven; in TEST()
560 EXPECT_FALSE(APFloat(APFloat::IEEEsingle, MinNormalStr).isDenormal()); in TEST()
561 EXPECT_FALSE(APFloat(APFloat::IEEEsingle, 0.0).isDenormal()); in TEST()
563 APFloat Val2(APFloat::IEEEsingle, 2.0e0); in TEST()
564 APFloat T(APFloat::IEEEsingle, MinNormalStr); in TEST()
572 EXPECT_FALSE(APFloat(APFloat::IEEEdouble, MinNormalStr).isDenormal()); in TEST()
573 EXPECT_FALSE(APFloat(APFloat::IEEEdouble, 0.0).isDenormal()); in TEST()
575 APFloat Val2(APFloat::IEEEdouble, 2.0e0); in TEST()
576 APFloat T(APFloat::IEEEdouble, MinNormalStr); in TEST()
584 EXPECT_FALSE(APFloat(APFloat::x87DoubleExtended, MinNormalStr).isDenormal()); in TEST()
585 EXPECT_FALSE(APFloat(APFloat::x87DoubleExtended, 0.0).isDenormal()); in TEST()
587 APFloat Val2(APFloat::x87DoubleExtended, 2.0e0); in TEST()
588 APFloat T(APFloat::x87DoubleExtended, MinNormalStr); in TEST()
596 EXPECT_FALSE(APFloat(APFloat::IEEEquad, MinNormalStr).isDenormal()); in TEST()
597 EXPECT_FALSE(APFloat(APFloat::IEEEquad, 0.0).isDenormal()); in TEST()
599 APFloat Val2(APFloat::IEEEquad, 2.0e0); in TEST()
600 APFloat T(APFloat::IEEEquad, MinNormalStr); in TEST()
607 EXPECT_EQ(0.0f, APFloat(0.0f).convertToFloat()); in TEST()
608 EXPECT_EQ(-0.0f, APFloat(-0.0f).convertToFloat()); in TEST()
609 EXPECT_TRUE(APFloat(-0.0f).isNegative()); in TEST()
611 EXPECT_EQ(0.0, APFloat(0.0).convertToDouble()); in TEST()
612 EXPECT_EQ(-0.0, APFloat(-0.0).convertToDouble()); in TEST()
613 EXPECT_TRUE(APFloat(-0.0).isNegative()); in TEST()
619 APFloat Val(APFloat::IEEEdouble); in TEST()
621 llvm::APFloat::rmNearestTiesToEven); in TEST()
624 llvm::APFloat::rmNearestTiesToEven); in TEST()
627 llvm::APFloat::rmNearestTiesToEven); in TEST()
630 llvm::APFloat::rmNearestTiesToEven); in TEST()
633 llvm::APFloat::rmNearestTiesToEven); in TEST()
636 llvm::APFloat::rmNearestTiesToEven); in TEST()
642 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0").convertToDouble()); in TEST()
643 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0").convertToDouble()); in TEST()
644 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0").convertToDouble()); in TEST()
646 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0.").convertToDouble()); in TEST()
647 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0.").convertToDouble()); in TEST()
648 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0.").convertToDouble()); in TEST()
650 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, ".0").convertToDouble()); in TEST()
651 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+.0").convertToDouble()); in TEST()
652 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-.0").convertToDouble()); in TEST()
654 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0.0").convertToDouble()); in TEST()
655 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0.0").convertToDouble()); in TEST()
656 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0.0").convertToDouble()); in TEST()
658 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "00000.").convertToDouble()); in TEST()
659 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+00000.").convertToDouble()); in TEST()
660 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-00000.").convertToDouble()); in TEST()
662 EXPECT_EQ(0.0, APFloat(APFloat::IEEEdouble, ".00000").convertToDouble()); in TEST()
663 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+.00000").convertToDouble()); in TEST()
664 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-.00000").convertToDouble()); in TEST()
666 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0000.00000").convertToDouble()); in TEST()
667 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0000.00000").convertToDouble()); in TEST()
668 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0000.00000").convertToDouble()); in TEST()
672 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0e1").convertToDouble()); in TEST()
673 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0e1").convertToDouble()); in TEST()
674 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0e1").convertToDouble()); in TEST()
676 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0e+1").convertToDouble()); in TEST()
677 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0e+1").convertToDouble()); in TEST()
678 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0e+1").convertToDouble()); in TEST()
680 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0e-1").convertToDouble()); in TEST()
681 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0e-1").convertToDouble()); in TEST()
682 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0e-1").convertToDouble()); in TEST()
685 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0.e1").convertToDouble()); in TEST()
686 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0.e1").convertToDouble()); in TEST()
687 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0.e1").convertToDouble()); in TEST()
689 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0.e+1").convertToDouble()); in TEST()
690 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0.e+1").convertToDouble()); in TEST()
691 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0.e+1").convertToDouble()); in TEST()
693 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0.e-1").convertToDouble()); in TEST()
694 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0.e-1").convertToDouble()); in TEST()
695 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0.e-1").convertToDouble()); in TEST()
697 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, ".0e1").convertToDouble()); in TEST()
698 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+.0e1").convertToDouble()); in TEST()
699 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-.0e1").convertToDouble()); in TEST()
701 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, ".0e+1").convertToDouble()); in TEST()
702 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+.0e+1").convertToDouble()); in TEST()
703 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-.0e+1").convertToDouble()); in TEST()
705 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, ".0e-1").convertToDouble()); in TEST()
706 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+.0e-1").convertToDouble()); in TEST()
707 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-.0e-1").convertToDouble()); in TEST()
710 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0.0e1").convertToDouble()); in TEST()
711 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0.0e1").convertToDouble()); in TEST()
712 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0.0e1").convertToDouble()); in TEST()
714 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0.0e+1").convertToDouble()); in TEST()
715 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0.0e+1").convertToDouble()); in TEST()
716 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0.0e+1").convertToDouble()); in TEST()
718 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0.0e-1").convertToDouble()); in TEST()
719 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0.0e-1").convertToDouble()); in TEST()
720 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0.0e-1").convertToDouble()); in TEST()
723 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "000.0000e1").convertToDouble()); in TEST()
724 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+000.0000e+1").convertToDouble()); in TEST()
725 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-000.0000e+1").convertToDouble()); in TEST()
729 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0e1234").convertToDouble()); in TEST()
730 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0e1234").convertToDouble()); in TEST()
731 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0e1234").convertToDouble()); in TEST()
733 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0e+1234").convertToDouble()); in TEST()
734 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0e+1234").convertToDouble()); in TEST()
735 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0e+1234").convertToDouble()); in TEST()
737 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0e-1234").convertToDouble()); in TEST()
738 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0e-1234").convertToDouble()); in TEST()
739 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0e-1234").convertToDouble()); in TEST()
741 EXPECT_EQ(0.0, APFloat(APFloat::IEEEdouble, "000.0000e1234").convertToDouble()); in TEST()
742 EXPECT_EQ(0.0, APFloat(APFloat::IEEEdouble, "000.0000e-1234").convertToDouble()); in TEST()
744 EXPECT_EQ(0.0, APFloat(APFloat::IEEEdouble, StringRef("0e1234\02", 6)).convertToDouble()); in TEST()
748 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0p1").convertToDouble()); in TEST()
749 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x0p1").convertToDouble()); in TEST()
750 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0p1").convertToDouble()); in TEST()
752 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0p+1").convertToDouble()); in TEST()
753 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x0p+1").convertToDouble()); in TEST()
754 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0p+1").convertToDouble()); in TEST()
756 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0p-1").convertToDouble()); in TEST()
757 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x0p-1").convertToDouble()); in TEST()
758 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0p-1").convertToDouble()); in TEST()
761 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0.p1").convertToDouble()); in TEST()
762 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x0.p1").convertToDouble()); in TEST()
763 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0.p1").convertToDouble()); in TEST()
765 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0.p+1").convertToDouble()); in TEST()
766 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x0.p+1").convertToDouble()); in TEST()
767 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0.p+1").convertToDouble()); in TEST()
769 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0.p-1").convertToDouble()); in TEST()
770 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x0.p-1").convertToDouble()); in TEST()
771 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0.p-1").convertToDouble()); in TEST()
774 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x.0p1").convertToDouble()); in TEST()
775 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x.0p1").convertToDouble()); in TEST()
776 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x.0p1").convertToDouble()); in TEST()
778 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x.0p+1").convertToDouble()); in TEST()
779 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x.0p+1").convertToDouble()); in TEST()
780 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x.0p+1").convertToDouble()); in TEST()
782 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x.0p-1").convertToDouble()); in TEST()
783 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x.0p-1").convertToDouble()); in TEST()
784 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x.0p-1").convertToDouble()); in TEST()
787 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0.0p1").convertToDouble()); in TEST()
788 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x0.0p1").convertToDouble()); in TEST()
789 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0.0p1").convertToDouble()); in TEST()
791 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0.0p+1").convertToDouble()); in TEST()
792 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x0.0p+1").convertToDouble()); in TEST()
793 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0.0p+1").convertToDouble()); in TEST()
795 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0.0p-1").convertToDouble()); in TEST()
796 EXPECT_EQ(+0.0, APFloat(APFloat::IEEEdouble, "+0x0.0p-1").convertToDouble()); in TEST()
797 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0.0p-1").convertToDouble()); in TEST()
800 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x00000.p1").convertToDouble()); in TEST()
801 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0000.00000p1").convertToDouble()); in TEST()
802 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x.00000p1").convertToDouble()); in TEST()
803 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0.p1").convertToDouble()); in TEST()
804 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0p1234").convertToDouble()); in TEST()
805 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, "-0x0p1234").convertToDouble()); in TEST()
806 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x00000.p1234").convertToDouble()); in TEST()
807 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0000.00000p1234").convertToDouble()); in TEST()
808 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x.00000p1234").convertToDouble()); in TEST()
809 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0x0.p1234").convertToDouble()); in TEST()
813 EXPECT_EQ(1.0, APFloat(APFloat::IEEEdouble, "1").convertToDouble()); in TEST()
814 EXPECT_EQ(2.0, APFloat(APFloat::IEEEdouble, "2.").convertToDouble()); in TEST()
815 EXPECT_EQ(0.5, APFloat(APFloat::IEEEdouble, ".5").convertToDouble()); in TEST()
816 EXPECT_EQ(1.0, APFloat(APFloat::IEEEdouble, "1.0").convertToDouble()); in TEST()
817 EXPECT_EQ(-2.0, APFloat(APFloat::IEEEdouble, "-2").convertToDouble()); in TEST()
818 EXPECT_EQ(-4.0, APFloat(APFloat::IEEEdouble, "-4.").convertToDouble()); in TEST()
819 EXPECT_EQ(-0.5, APFloat(APFloat::IEEEdouble, "-.5").convertToDouble()); in TEST()
820 EXPECT_EQ(-1.5, APFloat(APFloat::IEEEdouble, "-1.5").convertToDouble()); in TEST()
821 EXPECT_EQ(1.25e12, APFloat(APFloat::IEEEdouble, "1.25e12").convertToDouble()); in TEST()
822 EXPECT_EQ(1.25e+12, APFloat(APFloat::IEEEdouble, "1.25e+12").convertToDouble()); in TEST()
823 EXPECT_EQ(1.25e-12, APFloat(APFloat::IEEEdouble, "1.25e-12").convertToDouble()); in TEST()
824 EXPECT_EQ(1024.0, APFloat(APFloat::IEEEdouble, "1024.").convertToDouble()); in TEST()
825 EXPECT_EQ(1024.05, APFloat(APFloat::IEEEdouble, "1024.05000").convertToDouble()); in TEST()
826 EXPECT_EQ(0.05, APFloat(APFloat::IEEEdouble, ".05000").convertToDouble()); in TEST()
827 EXPECT_EQ(2.0, APFloat(APFloat::IEEEdouble, "2.").convertToDouble()); in TEST()
828 EXPECT_EQ(2.0e2, APFloat(APFloat::IEEEdouble, "2.e2").convertToDouble()); in TEST()
829 EXPECT_EQ(2.0e+2, APFloat(APFloat::IEEEdouble, "2.e+2").convertToDouble()); in TEST()
830 EXPECT_EQ(2.0e-2, APFloat(APFloat::IEEEdouble, "2.e-2").convertToDouble()); in TEST()
831 EXPECT_EQ(2.05e2, APFloat(APFloat::IEEEdouble, "002.05000e2").convertToDouble()); in TEST()
832 EXPECT_EQ(2.05e+2, APFloat(APFloat::IEEEdouble, "002.05000e+2").convertToDouble()); in TEST()
833 EXPECT_EQ(2.05e-2, APFloat(APFloat::IEEEdouble, "002.05000e-2").convertToDouble()); in TEST()
834 EXPECT_EQ(2.05e12, APFloat(APFloat::IEEEdouble, "002.05000e12").convertToDouble()); in TEST()
835 EXPECT_EQ(2.05e+12, APFloat(APFloat::IEEEdouble, "002.05000e+12").convertToDouble()); in TEST()
836 EXPECT_EQ(2.05e-12, APFloat(APFloat::IEEEdouble, "002.05000e-12").convertToDouble()); in TEST()
840 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "99e99999").isInfinity()); in TEST()
841 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "-99e99999").isInfinity()); in TEST()
842 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "1e-99999").isPosZero()); in TEST()
843 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "-1e-99999").isNegZero()); in TEST()
849 EXPECT_EQ( 1.0, APFloat(APFloat::IEEEdouble, "0x1p0").convertToDouble()); in TEST()
850 EXPECT_EQ(+1.0, APFloat(APFloat::IEEEdouble, "+0x1p0").convertToDouble()); in TEST()
851 EXPECT_EQ(-1.0, APFloat(APFloat::IEEEdouble, "-0x1p0").convertToDouble()); in TEST()
853 EXPECT_EQ( 1.0, APFloat(APFloat::IEEEdouble, "0x1p+0").convertToDouble()); in TEST()
854 EXPECT_EQ(+1.0, APFloat(APFloat::IEEEdouble, "+0x1p+0").convertToDouble()); in TEST()
855 EXPECT_EQ(-1.0, APFloat(APFloat::IEEEdouble, "-0x1p+0").convertToDouble()); in TEST()
857 EXPECT_EQ( 1.0, APFloat(APFloat::IEEEdouble, "0x1p-0").convertToDouble()); in TEST()
858 EXPECT_EQ(+1.0, APFloat(APFloat::IEEEdouble, "+0x1p-0").convertToDouble()); in TEST()
859 EXPECT_EQ(-1.0, APFloat(APFloat::IEEEdouble, "-0x1p-0").convertToDouble()); in TEST()
862 EXPECT_EQ( 2.0, APFloat(APFloat::IEEEdouble, "0x1p1").convertToDouble()); in TEST()
863 EXPECT_EQ(+2.0, APFloat(APFloat::IEEEdouble, "+0x1p1").convertToDouble()); in TEST()
864 EXPECT_EQ(-2.0, APFloat(APFloat::IEEEdouble, "-0x1p1").convertToDouble()); in TEST()
866 EXPECT_EQ( 2.0, APFloat(APFloat::IEEEdouble, "0x1p+1").convertToDouble()); in TEST()
867 EXPECT_EQ(+2.0, APFloat(APFloat::IEEEdouble, "+0x1p+1").convertToDouble()); in TEST()
868 EXPECT_EQ(-2.0, APFloat(APFloat::IEEEdouble, "-0x1p+1").convertToDouble()); in TEST()
870 EXPECT_EQ( 0.5, APFloat(APFloat::IEEEdouble, "0x1p-1").convertToDouble()); in TEST()
871 EXPECT_EQ(+0.5, APFloat(APFloat::IEEEdouble, "+0x1p-1").convertToDouble()); in TEST()
872 EXPECT_EQ(-0.5, APFloat(APFloat::IEEEdouble, "-0x1p-1").convertToDouble()); in TEST()
875 EXPECT_EQ( 3.0, APFloat(APFloat::IEEEdouble, "0x1.8p1").convertToDouble()); in TEST()
876 EXPECT_EQ(+3.0, APFloat(APFloat::IEEEdouble, "+0x1.8p1").convertToDouble()); in TEST()
877 EXPECT_EQ(-3.0, APFloat(APFloat::IEEEdouble, "-0x1.8p1").convertToDouble()); in TEST()
879 EXPECT_EQ( 3.0, APFloat(APFloat::IEEEdouble, "0x1.8p+1").convertToDouble()); in TEST()
880 EXPECT_EQ(+3.0, APFloat(APFloat::IEEEdouble, "+0x1.8p+1").convertToDouble()); in TEST()
881 EXPECT_EQ(-3.0, APFloat(APFloat::IEEEdouble, "-0x1.8p+1").convertToDouble()); in TEST()
883 EXPECT_EQ( 0.75, APFloat(APFloat::IEEEdouble, "0x1.8p-1").convertToDouble()); in TEST()
884 EXPECT_EQ(+0.75, APFloat(APFloat::IEEEdouble, "+0x1.8p-1").convertToDouble()); in TEST()
885 EXPECT_EQ(-0.75, APFloat(APFloat::IEEEdouble, "-0x1.8p-1").convertToDouble()); in TEST()
888 EXPECT_EQ( 8192.0, APFloat(APFloat::IEEEdouble, "0x1000.000p1").convertToDouble()); in TEST()
889 EXPECT_EQ(+8192.0, APFloat(APFloat::IEEEdouble, "+0x1000.000p1").convertToDouble()); in TEST()
890 EXPECT_EQ(-8192.0, APFloat(APFloat::IEEEdouble, "-0x1000.000p1").convertToDouble()); in TEST()
892 EXPECT_EQ( 8192.0, APFloat(APFloat::IEEEdouble, "0x1000.000p+1").convertToDouble()); in TEST()
893 EXPECT_EQ(+8192.0, APFloat(APFloat::IEEEdouble, "+0x1000.000p+1").convertToDouble()); in TEST()
894 EXPECT_EQ(-8192.0, APFloat(APFloat::IEEEdouble, "-0x1000.000p+1").convertToDouble()); in TEST()
896 EXPECT_EQ( 2048.0, APFloat(APFloat::IEEEdouble, "0x1000.000p-1").convertToDouble()); in TEST()
897 EXPECT_EQ(+2048.0, APFloat(APFloat::IEEEdouble, "+0x1000.000p-1").convertToDouble()); in TEST()
898 EXPECT_EQ(-2048.0, APFloat(APFloat::IEEEdouble, "-0x1000.000p-1").convertToDouble()); in TEST()
901 EXPECT_EQ( 8192.0, APFloat(APFloat::IEEEdouble, "0x1000p1").convertToDouble()); in TEST()
902 EXPECT_EQ(+8192.0, APFloat(APFloat::IEEEdouble, "+0x1000p1").convertToDouble()); in TEST()
903 EXPECT_EQ(-8192.0, APFloat(APFloat::IEEEdouble, "-0x1000p1").convertToDouble()); in TEST()
905 EXPECT_EQ( 8192.0, APFloat(APFloat::IEEEdouble, "0x1000p+1").convertToDouble()); in TEST()
906 EXPECT_EQ(+8192.0, APFloat(APFloat::IEEEdouble, "+0x1000p+1").convertToDouble()); in TEST()
907 EXPECT_EQ(-8192.0, APFloat(APFloat::IEEEdouble, "-0x1000p+1").convertToDouble()); in TEST()
909 EXPECT_EQ( 2048.0, APFloat(APFloat::IEEEdouble, "0x1000p-1").convertToDouble()); in TEST()
910 EXPECT_EQ(+2048.0, APFloat(APFloat::IEEEdouble, "+0x1000p-1").convertToDouble()); in TEST()
911 EXPECT_EQ(-2048.0, APFloat(APFloat::IEEEdouble, "-0x1000p-1").convertToDouble()); in TEST()
914 EXPECT_EQ( 16384.0, APFloat(APFloat::IEEEdouble, "0x10p10").convertToDouble()); in TEST()
915 EXPECT_EQ(+16384.0, APFloat(APFloat::IEEEdouble, "+0x10p10").convertToDouble()); in TEST()
916 EXPECT_EQ(-16384.0, APFloat(APFloat::IEEEdouble, "-0x10p10").convertToDouble()); in TEST()
918 EXPECT_EQ( 16384.0, APFloat(APFloat::IEEEdouble, "0x10p+10").convertToDouble()); in TEST()
919 EXPECT_EQ(+16384.0, APFloat(APFloat::IEEEdouble, "+0x10p+10").convertToDouble()); in TEST()
920 EXPECT_EQ(-16384.0, APFloat(APFloat::IEEEdouble, "-0x10p+10").convertToDouble()); in TEST()
922 EXPECT_EQ( 0.015625, APFloat(APFloat::IEEEdouble, "0x10p-10").convertToDouble()); in TEST()
923 EXPECT_EQ(+0.015625, APFloat(APFloat::IEEEdouble, "+0x10p-10").convertToDouble()); in TEST()
924 EXPECT_EQ(-0.015625, APFloat(APFloat::IEEEdouble, "-0x10p-10").convertToDouble()); in TEST()
926 EXPECT_EQ(1.0625, APFloat(APFloat::IEEEdouble, "0x1.1p0").convertToDouble()); in TEST()
927 EXPECT_EQ(1.0, APFloat(APFloat::IEEEdouble, "0x1p0").convertToDouble()); in TEST()
955 EXPECT_EQ(APFloat::opOK, in TEST()
956 APFloat(APFloat::IEEEdouble, "10") in TEST()
957 .convertToInteger(result, APFloat::rmTowardZero, &isExact)); in TEST()
961 EXPECT_EQ(APFloat::opInvalidOp, in TEST()
962 APFloat(APFloat::IEEEdouble, "-10") in TEST()
963 .convertToInteger(result, APFloat::rmTowardZero, &isExact)); in TEST()
967 EXPECT_EQ(APFloat::opInvalidOp, in TEST()
968 APFloat(APFloat::IEEEdouble, "32") in TEST()
969 .convertToInteger(result, APFloat::rmTowardZero, &isExact)); in TEST()
973 EXPECT_EQ(APFloat::opInexact, in TEST()
974 APFloat(APFloat::IEEEdouble, "7.9") in TEST()
975 .convertToInteger(result, APFloat::rmTowardZero, &isExact)); in TEST()
980 EXPECT_EQ(APFloat::opOK, in TEST()
981 APFloat(APFloat::IEEEdouble, "-10") in TEST()
982 .convertToInteger(result, APFloat::rmTowardZero, &isExact)); in TEST()
986 EXPECT_EQ(APFloat::opInvalidOp, in TEST()
987 APFloat(APFloat::IEEEdouble, "-17") in TEST()
988 .convertToInteger(result, APFloat::rmTowardZero, &isExact)); in TEST()
992 EXPECT_EQ(APFloat::opInvalidOp, in TEST()
993 APFloat(APFloat::IEEEdouble, "16") in TEST()
994 .convertToInteger(result, APFloat::rmTowardZero, &isExact)); in TEST()
1003 return APFloat::getSNaN(Sem, Negative, &apfill).bitcastToAPInt(); in nanbits()
1005 return APFloat::getQNaN(Sem, Negative, &apfill).bitcastToAPInt(); in nanbits()
1009 ASSERT_EQ(0x7fc00000, nanbits(APFloat::IEEEsingle, false, false, 0)); in TEST()
1010 ASSERT_EQ(0xffc00000, nanbits(APFloat::IEEEsingle, false, true, 0)); in TEST()
1011 ASSERT_EQ(0x7fc0ae72, nanbits(APFloat::IEEEsingle, false, false, 0xae72)); in TEST()
1012 ASSERT_EQ(0x7fffae72, nanbits(APFloat::IEEEsingle, false, false, 0xffffae72)); in TEST()
1013 ASSERT_EQ(0x7fa00000, nanbits(APFloat::IEEEsingle, true, false, 0)); in TEST()
1014 ASSERT_EQ(0xffa00000, nanbits(APFloat::IEEEsingle, true, true, 0)); in TEST()
1015 ASSERT_EQ(0x7f80ae72, nanbits(APFloat::IEEEsingle, true, false, 0xae72)); in TEST()
1016 ASSERT_EQ(0x7fbfae72, nanbits(APFloat::IEEEsingle, true, false, 0xffffae72)); in TEST()
1018 ASSERT_EQ(0x7ff8000000000000ULL, nanbits(APFloat::IEEEdouble, false, false, 0)); in TEST()
1019 ASSERT_EQ(0xfff8000000000000ULL, nanbits(APFloat::IEEEdouble, false, true, 0)); in TEST()
1020 ASSERT_EQ(0x7ff800000000ae72ULL, nanbits(APFloat::IEEEdouble, false, false, 0xae72)); in TEST()
1021 …ASSERT_EQ(0x7fffffffffffae72ULL, nanbits(APFloat::IEEEdouble, false, false, 0xffffffffffffae72ULL)… in TEST()
1022 ASSERT_EQ(0x7ff4000000000000ULL, nanbits(APFloat::IEEEdouble, true, false, 0)); in TEST()
1023 ASSERT_EQ(0xfff4000000000000ULL, nanbits(APFloat::IEEEdouble, true, true, 0)); in TEST()
1024 ASSERT_EQ(0x7ff000000000ae72ULL, nanbits(APFloat::IEEEdouble, true, false, 0xae72)); in TEST()
1025 …ASSERT_EQ(0x7ff7ffffffffae72ULL, nanbits(APFloat::IEEEdouble, true, false, 0xffffffffffffae72ULL)); in TEST()
1031 …EXPECT_DEATH(APFloat(APFloat::IEEEsingle, 0.0f).convertToDouble(), "Float semantics are not IEEEdo… in TEST()
1032 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, 0.0 ).convertToFloat(), "Float semantics are not IEEEsi… in TEST()
1036 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, ""), "Invalid string length"); in TEST()
1037 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+"), "String has no digits"); in TEST()
1038 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-"), "String has no digits"); in TEST()
1040 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("\0", 1)), "Invalid character in significand"); in TEST()
1041 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("1\0", 2)), "Invalid character in significand"… in TEST()
1042 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("1\02", 3)), "Invalid character in significand… in TEST()
1043 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("1\02e1", 5)), "Invalid character in significa… in TEST()
1044 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("1e\0", 3)), "Invalid character in exponent"); in TEST()
1045 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("1e1\0", 4)), "Invalid character in exponent"); in TEST()
1046 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("1e1\02", 5)), "Invalid character in exponent"… in TEST()
1048 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1.0f"), "Invalid character in significand"); in TEST()
1050 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, ".."), "String contains multiple dots"); in TEST()
1051 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "..0"), "String contains multiple dots"); in TEST()
1052 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1.0.0"), "String contains multiple dots"); in TEST()
1056 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "."), "Significand has no digits"); in TEST()
1057 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+."), "Significand has no digits"); in TEST()
1058 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-."), "Significand has no digits"); in TEST()
1061 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "e"), "Significand has no digits"); in TEST()
1062 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+e"), "Significand has no digits"); in TEST()
1063 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-e"), "Significand has no digits"); in TEST()
1065 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "e1"), "Significand has no digits"); in TEST()
1066 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+e1"), "Significand has no digits"); in TEST()
1067 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-e1"), "Significand has no digits"); in TEST()
1069 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, ".e1"), "Significand has no digits"); in TEST()
1070 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+.e1"), "Significand has no digits"); in TEST()
1071 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-.e1"), "Significand has no digits"); in TEST()
1074 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, ".e"), "Significand has no digits"); in TEST()
1075 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+.e"), "Significand has no digits"); in TEST()
1076 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-.e"), "Significand has no digits"); in TEST()
1080 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1e"), "Exponent has no digits"); in TEST()
1081 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+1e"), "Exponent has no digits"); in TEST()
1082 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-1e"), "Exponent has no digits"); in TEST()
1084 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1.e"), "Exponent has no digits"); in TEST()
1085 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+1.e"), "Exponent has no digits"); in TEST()
1086 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-1.e"), "Exponent has no digits"); in TEST()
1088 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, ".1e"), "Exponent has no digits"); in TEST()
1089 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+.1e"), "Exponent has no digits"); in TEST()
1090 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-.1e"), "Exponent has no digits"); in TEST()
1092 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1.1e"), "Exponent has no digits"); in TEST()
1093 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+1.1e"), "Exponent has no digits"); in TEST()
1094 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-1.1e"), "Exponent has no digits"); in TEST()
1097 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1e+"), "Exponent has no digits"); in TEST()
1098 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1e-"), "Exponent has no digits"); in TEST()
1100 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, ".1e"), "Exponent has no digits"); in TEST()
1101 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, ".1e+"), "Exponent has no digits"); in TEST()
1102 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, ".1e-"), "Exponent has no digits"); in TEST()
1104 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1.0e"), "Exponent has no digits"); in TEST()
1105 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1.0e+"), "Exponent has no digits"); in TEST()
1106 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "1.0e-"), "Exponent has no digits"); in TEST()
1110 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x"), "Invalid string"); in TEST()
1111 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x"), "Invalid string"); in TEST()
1112 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x"), "Invalid string"); in TEST()
1114 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x0"), "Hex strings require an exponent"); in TEST()
1115 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x0"), "Hex strings require an exponent"); in TEST()
1116 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x0"), "Hex strings require an exponent"); in TEST()
1118 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x0."), "Hex strings require an exponent"); in TEST()
1119 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x0."), "Hex strings require an exponent"); in TEST()
1120 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x0."), "Hex strings require an exponent"); in TEST()
1122 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x.0"), "Hex strings require an exponent"); in TEST()
1123 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x.0"), "Hex strings require an exponent"); in TEST()
1124 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x.0"), "Hex strings require an exponent"); in TEST()
1126 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x0.0"), "Hex strings require an exponent"); in TEST()
1127 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x0.0"), "Hex strings require an exponent"); in TEST()
1128 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x0.0"), "Hex strings require an exponent"); in TEST()
1130 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("0x\0", 3)), "Invalid character in significand… in TEST()
1131 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("0x1\0", 4)), "Invalid character in significan… in TEST()
1132 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("0x1\02", 5)), "Invalid character in significa… in TEST()
1133 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("0x1\02p1", 7)), "Invalid character in signifi… in TEST()
1134 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("0x1p\0", 5)), "Invalid character in exponent"… in TEST()
1135 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("0x1p1\0", 6)), "Invalid character in exponent… in TEST()
1136 …EXPECT_DEATH(APFloat(APFloat::IEEEdouble, StringRef("0x1p1\02", 7)), "Invalid character in exponen… in TEST()
1138 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1p0f"), "Invalid character in exponent"); in TEST()
1140 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x..p1"), "String contains multiple dots"); in TEST()
1141 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x..0p1"), "String contains multiple dots"); in TEST()
1142 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1.0.0p1"), "String contains multiple dots"); in TEST()
1146 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x."), "Significand has no digits"); in TEST()
1147 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x."), "Significand has no digits"); in TEST()
1148 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x."), "Significand has no digits"); in TEST()
1150 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0xp"), "Significand has no digits"); in TEST()
1151 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0xp"), "Significand has no digits"); in TEST()
1152 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0xp"), "Significand has no digits"); in TEST()
1154 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0xp+"), "Significand has no digits"); in TEST()
1155 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0xp+"), "Significand has no digits"); in TEST()
1156 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0xp+"), "Significand has no digits"); in TEST()
1158 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0xp-"), "Significand has no digits"); in TEST()
1159 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0xp-"), "Significand has no digits"); in TEST()
1160 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0xp-"), "Significand has no digits"); in TEST()
1163 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x.p"), "Significand has no digits"); in TEST()
1164 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x.p"), "Significand has no digits"); in TEST()
1165 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x.p"), "Significand has no digits"); in TEST()
1167 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x.p+"), "Significand has no digits"); in TEST()
1168 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x.p+"), "Significand has no digits"); in TEST()
1169 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x.p+"), "Significand has no digits"); in TEST()
1171 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x.p-"), "Significand has no digits"); in TEST()
1172 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x.p-"), "Significand has no digits"); in TEST()
1173 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x.p-"), "Significand has no digits"); in TEST()
1177 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1p"), "Exponent has no digits"); in TEST()
1178 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x1p"), "Exponent has no digits"); in TEST()
1179 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1p"), "Exponent has no digits"); in TEST()
1181 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1p+"), "Exponent has no digits"); in TEST()
1182 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x1p+"), "Exponent has no digits"); in TEST()
1183 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1p+"), "Exponent has no digits"); in TEST()
1185 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1p-"), "Exponent has no digits"); in TEST()
1186 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x1p-"), "Exponent has no digits"); in TEST()
1187 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1p-"), "Exponent has no digits"); in TEST()
1190 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1.p"), "Exponent has no digits"); in TEST()
1191 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x1.p"), "Exponent has no digits"); in TEST()
1192 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.p"), "Exponent has no digits"); in TEST()
1194 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1.p+"), "Exponent has no digits"); in TEST()
1195 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x1.p+"), "Exponent has no digits"); in TEST()
1196 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.p+"), "Exponent has no digits"); in TEST()
1198 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1.p-"), "Exponent has no digits"); in TEST()
1199 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x1.p-"), "Exponent has no digits"); in TEST()
1200 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.p-"), "Exponent has no digits"); in TEST()
1203 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x.1p"), "Exponent has no digits"); in TEST()
1204 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x.1p"), "Exponent has no digits"); in TEST()
1205 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x.1p"), "Exponent has no digits"); in TEST()
1207 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x.1p+"), "Exponent has no digits"); in TEST()
1208 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x.1p+"), "Exponent has no digits"); in TEST()
1209 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x.1p+"), "Exponent has no digits"); in TEST()
1211 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x.1p-"), "Exponent has no digits"); in TEST()
1212 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x.1p-"), "Exponent has no digits"); in TEST()
1213 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x.1p-"), "Exponent has no digits"); in TEST()
1216 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1.1p"), "Exponent has no digits"); in TEST()
1217 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x1.1p"), "Exponent has no digits"); in TEST()
1218 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.1p"), "Exponent has no digits"); in TEST()
1220 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1.1p+"), "Exponent has no digits"); in TEST()
1221 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x1.1p+"), "Exponent has no digits"); in TEST()
1222 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.1p+"), "Exponent has no digits"); in TEST()
1224 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1.1p-"), "Exponent has no digits"); in TEST()
1225 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "+0x1.1p-"), "Exponent has no digits"); in TEST()
1226 EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.1p-"), "Exponent has no digits"); in TEST()
1232 APFloat inv(0.0f); in TEST()
1235 EXPECT_TRUE(APFloat(2.0).getExactInverse(&inv)); in TEST()
1236 EXPECT_TRUE(inv.bitwiseIsEqual(APFloat(0.5))); in TEST()
1237 EXPECT_TRUE(APFloat(2.0f).getExactInverse(&inv)); in TEST()
1238 EXPECT_TRUE(inv.bitwiseIsEqual(APFloat(0.5f))); in TEST()
1239 EXPECT_TRUE(APFloat(APFloat::IEEEquad, "2.0").getExactInverse(&inv)); in TEST()
1240 EXPECT_TRUE(inv.bitwiseIsEqual(APFloat(APFloat::IEEEquad, "0.5"))); in TEST()
1241 EXPECT_TRUE(APFloat(APFloat::PPCDoubleDouble, "2.0").getExactInverse(&inv)); in TEST()
1242 EXPECT_TRUE(inv.bitwiseIsEqual(APFloat(APFloat::PPCDoubleDouble, "0.5"))); in TEST()
1243 EXPECT_TRUE(APFloat(APFloat::x87DoubleExtended, "2.0").getExactInverse(&inv)); in TEST()
1244 EXPECT_TRUE(inv.bitwiseIsEqual(APFloat(APFloat::x87DoubleExtended, "0.5"))); in TEST()
1247 EXPECT_TRUE(APFloat(1.17549435e-38f).getExactInverse(&inv)); in TEST()
1248 EXPECT_TRUE(inv.bitwiseIsEqual(APFloat(8.5070592e+37f))); in TEST()
1251 EXPECT_FALSE(APFloat(1.7014118e38f).getExactInverse(nullptr)); in TEST()
1253 EXPECT_FALSE(APFloat(0.0).getExactInverse(nullptr)); in TEST()
1255 EXPECT_FALSE(APFloat(1.40129846e-45f).getExactInverse(nullptr)); in TEST()
1259 APFloat T(-0.5), S(3.14), R(APFloat::getLargest(APFloat::IEEEdouble)), P(0.0); in TEST()
1262 P.roundToIntegral(APFloat::rmTowardZero); in TEST()
1265 P.roundToIntegral(APFloat::rmTowardNegative); in TEST()
1268 P.roundToIntegral(APFloat::rmTowardPositive); in TEST()
1271 P.roundToIntegral(APFloat::rmNearestTiesToEven); in TEST()
1275 P.roundToIntegral(APFloat::rmTowardZero); in TEST()
1278 P.roundToIntegral(APFloat::rmTowardNegative); in TEST()
1281 P.roundToIntegral(APFloat::rmTowardPositive); in TEST()
1284 P.roundToIntegral(APFloat::rmNearestTiesToEven); in TEST()
1288 P.roundToIntegral(APFloat::rmTowardZero); in TEST()
1291 P.roundToIntegral(APFloat::rmTowardNegative); in TEST()
1294 P.roundToIntegral(APFloat::rmTowardPositive); in TEST()
1297 P.roundToIntegral(APFloat::rmNearestTiesToEven); in TEST()
1300 P = APFloat::getZero(APFloat::IEEEdouble); in TEST()
1301 P.roundToIntegral(APFloat::rmTowardZero); in TEST()
1303 P = APFloat::getZero(APFloat::IEEEdouble, true); in TEST()
1304 P.roundToIntegral(APFloat::rmTowardZero); in TEST()
1306 P = APFloat::getNaN(APFloat::IEEEdouble); in TEST()
1307 P.roundToIntegral(APFloat::rmTowardZero); in TEST()
1309 P = APFloat::getInf(APFloat::IEEEdouble); in TEST()
1310 P.roundToIntegral(APFloat::rmTowardZero); in TEST()
1312 P = APFloat::getInf(APFloat::IEEEdouble, true); in TEST()
1313 P.roundToIntegral(APFloat::rmTowardZero); in TEST()
1318 APFloat T(-0.0); in TEST()
1320 T = APFloat(3.14159); in TEST()
1322 T = APFloat::getNaN(APFloat::IEEEdouble); in TEST()
1324 T = APFloat::getInf(APFloat::IEEEdouble); in TEST()
1326 T = APFloat::getInf(APFloat::IEEEdouble, true); in TEST()
1328 T = APFloat::getLargest(APFloat::IEEEdouble); in TEST()
1333 EXPECT_EQ(3.402823466e+38f, APFloat::getLargest(APFloat::IEEEsingle).convertToFloat()); in TEST()
1334 EXPECT_EQ(1.7976931348623158e+308, APFloat::getLargest(APFloat::IEEEdouble).convertToDouble()); in TEST()
1338 APFloat test = APFloat::getSmallest(APFloat::IEEEsingle, false); in TEST()
1339 APFloat expected = APFloat(APFloat::IEEEsingle, "0x0.000002p-126"); in TEST()
1345 test = APFloat::getSmallest(APFloat::IEEEsingle, true); in TEST()
1346 expected = APFloat(APFloat::IEEEsingle, "-0x0.000002p-126"); in TEST()
1352 test = APFloat::getSmallest(APFloat::IEEEquad, false); in TEST()
1353 expected = APFloat(APFloat::IEEEquad, "0x0.0000000000000000000000000001p-16382"); in TEST()
1359 test = APFloat::getSmallest(APFloat::IEEEquad, true); in TEST()
1360 expected = APFloat(APFloat::IEEEquad, "-0x0.0000000000000000000000000001p-16382"); in TEST()
1368 APFloat test = APFloat::getSmallestNormalized(APFloat::IEEEsingle, false); in TEST()
1369 APFloat expected = APFloat(APFloat::IEEEsingle, "0x1p-126"); in TEST()
1375 test = APFloat::getSmallestNormalized(APFloat::IEEEsingle, true); in TEST()
1376 expected = APFloat(APFloat::IEEEsingle, "-0x1p-126"); in TEST()
1382 test = APFloat::getSmallestNormalized(APFloat::IEEEquad, false); in TEST()
1383 expected = APFloat(APFloat::IEEEquad, "0x1p-16382"); in TEST()
1389 test = APFloat::getSmallestNormalized(APFloat::IEEEquad, true); in TEST()
1390 expected = APFloat(APFloat::IEEEquad, "-0x1p-16382"); in TEST()
1404 { &APFloat::IEEEhalf, false, {0, 0}, 1}, in TEST()
1405 { &APFloat::IEEEhalf, true, {0x8000ULL, 0}, 1}, in TEST()
1406 { &APFloat::IEEEsingle, false, {0, 0}, 1}, in TEST()
1407 { &APFloat::IEEEsingle, true, {0x80000000ULL, 0}, 1}, in TEST()
1408 { &APFloat::IEEEdouble, false, {0, 0}, 1}, in TEST()
1409 { &APFloat::IEEEdouble, true, {0x8000000000000000ULL, 0}, 1}, in TEST()
1410 { &APFloat::IEEEquad, false, {0, 0}, 2}, in TEST()
1411 { &APFloat::IEEEquad, true, {0, 0x8000000000000000ULL}, 2}, in TEST()
1412 { &APFloat::PPCDoubleDouble, false, {0, 0}, 2}, in TEST()
1413 { &APFloat::PPCDoubleDouble, true, {0x8000000000000000ULL, 0}, 2}, in TEST()
1414 { &APFloat::x87DoubleExtended, false, {0, 0}, 2}, in TEST()
1415 { &APFloat::x87DoubleExtended, true, {0, 0x8000ULL}, 2}, in TEST()
1419 APFloat test = APFloat::getZero(*GetZeroTest[i].semantics, in TEST()
1422 APFloat expected = APFloat(*GetZeroTest[i].semantics, in TEST()
1435 EXPECT_TRUE(APFloat(-42.0).bitwiseIsEqual( in TEST()
1436 APFloat::copySign(APFloat(42.0), APFloat(-1.0)))); in TEST()
1437 EXPECT_TRUE(APFloat(42.0).bitwiseIsEqual( in TEST()
1438 APFloat::copySign(APFloat(-42.0), APFloat(1.0)))); in TEST()
1439 EXPECT_TRUE(APFloat(-42.0).bitwiseIsEqual( in TEST()
1440 APFloat::copySign(APFloat(-42.0), APFloat(-1.0)))); in TEST()
1441 EXPECT_TRUE(APFloat(42.0).bitwiseIsEqual( in TEST()
1442 APFloat::copySign(APFloat(42.0), APFloat(1.0)))); in TEST()
1447 APFloat test(APFloat::IEEEdouble, "1.0"); in TEST()
1448 test.convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, &losesInfo); in TEST()
1452 test = APFloat(APFloat::x87DoubleExtended, "0x1p-53"); in TEST()
1453 test.add(APFloat(APFloat::x87DoubleExtended, "1.0"), APFloat::rmNearestTiesToEven); in TEST()
1454 test.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &losesInfo); in TEST()
1458 test = APFloat(APFloat::IEEEquad, "0x1p-53"); in TEST()
1459 test.add(APFloat(APFloat::IEEEquad, "1.0"), APFloat::rmNearestTiesToEven); in TEST()
1460 test.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &losesInfo); in TEST()
1464 test = APFloat(APFloat::x87DoubleExtended, "0xf.fffffffp+28"); in TEST()
1465 test.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &losesInfo); in TEST()
1469 test = APFloat::getSNaN(APFloat::IEEEsingle); in TEST()
1470 APFloat X87SNaN = APFloat::getSNaN(APFloat::x87DoubleExtended); in TEST()
1471 test.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven, in TEST()
1476 test = APFloat::getQNaN(APFloat::IEEEsingle); in TEST()
1477 APFloat X87QNaN = APFloat::getQNaN(APFloat::x87DoubleExtended); in TEST()
1478 test.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven, in TEST()
1483 test = APFloat::getSNaN(APFloat::x87DoubleExtended); in TEST()
1484 test.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven, in TEST()
1489 test = APFloat::getQNaN(APFloat::x87DoubleExtended); in TEST()
1490 test.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven, in TEST()
1497 APFloat test(APFloat::PPCDoubleDouble, "1.0"); in TEST()
1501 test.divide(APFloat(APFloat::PPCDoubleDouble, "3.0"), APFloat::rmNearestTiesToEven); in TEST()
1506 test = APFloat(APFloat::PPCDoubleDouble, "1.79769313486231580793728971405301e+308"); in TEST()
1511 test = APFloat(APFloat::PPCDoubleDouble, "2.00416836000897277799610805135016e-292"); in TEST()
1515 test = APFloat(APFloat::PPCDoubleDouble, "1.0"); in TEST()
1516 test.add(APFloat(APFloat::PPCDoubleDouble, "0x1p-105"), APFloat::rmNearestTiesToEven); in TEST()
1520 test = APFloat(APFloat::PPCDoubleDouble, "1.0"); in TEST()
1521 test.add(APFloat(APFloat::PPCDoubleDouble, "0x1p-106"), APFloat::rmNearestTiesToEven); in TEST()
1533 APFloat t(APFloat::IEEEsingle, "0x1p+0"); in TEST()
1535 t = APFloat(APFloat::IEEEsingle, "-0x1p+0"); in TEST()
1538 EXPECT_FALSE(APFloat::getInf(APFloat::IEEEsingle, false).isNegative()); in TEST()
1539 EXPECT_TRUE(APFloat::getInf(APFloat::IEEEsingle, true).isNegative()); in TEST()
1541 EXPECT_FALSE(APFloat::getZero(APFloat::IEEEsingle, false).isNegative()); in TEST()
1542 EXPECT_TRUE(APFloat::getZero(APFloat::IEEEsingle, true).isNegative()); in TEST()
1544 EXPECT_FALSE(APFloat::getNaN(APFloat::IEEEsingle, false).isNegative()); in TEST()
1545 EXPECT_TRUE(APFloat::getNaN(APFloat::IEEEsingle, true).isNegative()); in TEST()
1547 EXPECT_FALSE(APFloat::getSNaN(APFloat::IEEEsingle, false).isNegative()); in TEST()
1548 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, true).isNegative()); in TEST()
1552 APFloat t(APFloat::IEEEsingle, "0x1p+0"); in TEST()
1555 EXPECT_FALSE(APFloat::getInf(APFloat::IEEEsingle, false).isNormal()); in TEST()
1556 EXPECT_FALSE(APFloat::getZero(APFloat::IEEEsingle, false).isNormal()); in TEST()
1557 EXPECT_FALSE(APFloat::getNaN(APFloat::IEEEsingle, false).isNormal()); in TEST()
1558 EXPECT_FALSE(APFloat::getSNaN(APFloat::IEEEsingle, false).isNormal()); in TEST()
1559 EXPECT_FALSE(APFloat(APFloat::IEEEsingle, "0x1p-149").isNormal()); in TEST()
1563 APFloat t(APFloat::IEEEsingle, "0x1p+0"); in TEST()
1565 EXPECT_FALSE(APFloat::getInf(APFloat::IEEEsingle, false).isFinite()); in TEST()
1566 EXPECT_TRUE(APFloat::getZero(APFloat::IEEEsingle, false).isFinite()); in TEST()
1567 EXPECT_FALSE(APFloat::getNaN(APFloat::IEEEsingle, false).isFinite()); in TEST()
1568 EXPECT_FALSE(APFloat::getSNaN(APFloat::IEEEsingle, false).isFinite()); in TEST()
1569 EXPECT_TRUE(APFloat(APFloat::IEEEsingle, "0x1p-149").isFinite()); in TEST()
1573 APFloat t(APFloat::IEEEsingle, "0x1p+0"); in TEST()
1575 EXPECT_TRUE(APFloat::getInf(APFloat::IEEEsingle, false).isInfinity()); in TEST()
1576 EXPECT_FALSE(APFloat::getZero(APFloat::IEEEsingle, false).isInfinity()); in TEST()
1577 EXPECT_FALSE(APFloat::getNaN(APFloat::IEEEsingle, false).isInfinity()); in TEST()
1578 EXPECT_FALSE(APFloat::getSNaN(APFloat::IEEEsingle, false).isInfinity()); in TEST()
1579 EXPECT_FALSE(APFloat(APFloat::IEEEsingle, "0x1p-149").isInfinity()); in TEST()
1583 APFloat t(APFloat::IEEEsingle, "0x1p+0"); in TEST()
1585 EXPECT_FALSE(APFloat::getInf(APFloat::IEEEsingle, false).isNaN()); in TEST()
1586 EXPECT_FALSE(APFloat::getZero(APFloat::IEEEsingle, false).isNaN()); in TEST()
1587 EXPECT_TRUE(APFloat::getNaN(APFloat::IEEEsingle, false).isNaN()); in TEST()
1588 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, false).isNaN()); in TEST()
1589 EXPECT_FALSE(APFloat(APFloat::IEEEsingle, "0x1p-149").isNaN()); in TEST()
1594 EXPECT_TRUE(APFloat(APFloat::IEEEsingle, "0x1p+0").isFiniteNonZero()); in TEST()
1595 EXPECT_TRUE(APFloat(APFloat::IEEEsingle, "-0x1p+0").isFiniteNonZero()); in TEST()
1598 EXPECT_TRUE(APFloat(APFloat::IEEEsingle, "0x1p-149").isFiniteNonZero()); in TEST()
1599 EXPECT_TRUE(APFloat(APFloat::IEEEsingle, "-0x1p-149").isFiniteNonZero()); in TEST()
1602 EXPECT_FALSE(APFloat::getInf(APFloat::IEEEsingle, false).isFiniteNonZero()); in TEST()
1603 EXPECT_FALSE(APFloat::getInf(APFloat::IEEEsingle, true).isFiniteNonZero()); in TEST()
1606 EXPECT_FALSE(APFloat::getZero(APFloat::IEEEsingle, false).isFiniteNonZero()); in TEST()
1607 EXPECT_FALSE(APFloat::getZero(APFloat::IEEEsingle, true).isFiniteNonZero()); in TEST()
1611 EXPECT_FALSE(APFloat::getNaN(APFloat::IEEEsingle, false).isFiniteNonZero()); in TEST()
1612 EXPECT_FALSE(APFloat::getNaN(APFloat::IEEEsingle, true).isFiniteNonZero()); in TEST()
1616 EXPECT_FALSE(APFloat::getSNaN(APFloat::IEEEsingle, false).isFiniteNonZero()); in TEST()
1617 EXPECT_FALSE(APFloat::getSNaN(APFloat::IEEEsingle, true).isFiniteNonZero()); in TEST()
1628 APFloat PInf = APFloat::getInf(APFloat::IEEEsingle, false); in TEST()
1629 APFloat MInf = APFloat::getInf(APFloat::IEEEsingle, true); in TEST()
1630 APFloat PZero = APFloat::getZero(APFloat::IEEEsingle, false); in TEST()
1631 APFloat MZero = APFloat::getZero(APFloat::IEEEsingle, true); in TEST()
1632 APFloat QNaN = APFloat::getNaN(APFloat::IEEEsingle, false); in TEST()
1633 APFloat SNaN = APFloat::getSNaN(APFloat::IEEEsingle, false); in TEST()
1634 APFloat PNormalValue = APFloat(APFloat::IEEEsingle, "0x1p+0"); in TEST()
1635 APFloat MNormalValue = APFloat(APFloat::IEEEsingle, "-0x1p+0"); in TEST()
1636 APFloat PLargestValue = APFloat::getLargest(APFloat::IEEEsingle, false); in TEST()
1637 APFloat MLargestValue = APFloat::getLargest(APFloat::IEEEsingle, true); in TEST()
1638 APFloat PSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, false); in TEST()
1639 APFloat MSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, true); in TEST()
1640 APFloat PSmallestNormalized = in TEST()
1641 APFloat::getSmallestNormalized(APFloat::IEEEsingle, false); in TEST()
1642 APFloat MSmallestNormalized = in TEST()
1643 APFloat::getSmallestNormalized(APFloat::IEEEsingle, true); in TEST()
1645 const int OverflowStatus = APFloat::opOverflow | APFloat::opInexact; in TEST()
1649 APFloat x; in TEST()
1650 APFloat y; in TEST()
1655 { PInf, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1656 { PInf, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1657 { PInf, PZero, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1658 { PInf, MZero, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1659 { PInf, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1662 { PInf, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1664 { PInf, PNormalValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1665 { PInf, MNormalValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1666 { PInf, PLargestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1667 { PInf, MLargestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1668 { PInf, PSmallestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1669 { PInf, MSmallestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1670 { PInf, PSmallestNormalized, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1671 { PInf, MSmallestNormalized, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1672 { MInf, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1673 { MInf, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1674 { MInf, PZero, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1675 { MInf, MZero, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1676 { MInf, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1679 { MInf, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1681 { MInf, PNormalValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1682 { MInf, MNormalValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1683 { MInf, PLargestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1684 { MInf, MLargestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1685 { MInf, PSmallestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1686 { MInf, MSmallestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1687 { MInf, PSmallestNormalized, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1688 { MInf, MSmallestNormalized, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1689 { PZero, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1690 { PZero, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1691 { PZero, PZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1692 { PZero, MZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1693 { PZero, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1696 { PZero, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1698 { PZero, PNormalValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1699 { PZero, MNormalValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1700 { PZero, PLargestValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1701 { PZero, MLargestValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1702 { PZero, PSmallestValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1703 { PZero, MSmallestValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1704 { PZero, PSmallestNormalized, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1705 { PZero, MSmallestNormalized, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1706 { MZero, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1707 { MZero, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1708 { MZero, PZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1709 { MZero, MZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1710 { MZero, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1713 { MZero, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1715 { MZero, PNormalValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1716 { MZero, MNormalValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1717 { MZero, PLargestValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1718 { MZero, MLargestValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1719 { MZero, PSmallestValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1720 { MZero, MSmallestValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1721 { MZero, PSmallestNormalized, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1722 { MZero, MSmallestNormalized, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1723 { QNaN, PInf, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1724 { QNaN, MInf, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1725 { QNaN, PZero, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1726 { QNaN, MZero, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1727 { QNaN, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1730 { QNaN, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1732 { QNaN, PNormalValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1733 { QNaN, MNormalValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1734 { QNaN, PLargestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1735 { QNaN, MLargestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1736 { QNaN, PSmallestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1737 { QNaN, MSmallestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1738 { QNaN, PSmallestNormalized, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1739 { QNaN, MSmallestNormalized, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1742 { SNaN, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1743 { SNaN, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1744 { SNaN, PZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1745 { SNaN, MZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1746 { SNaN, QNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1747 { SNaN, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1748 { SNaN, PNormalValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1749 { SNaN, MNormalValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1750 { SNaN, PLargestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1751 { SNaN, MLargestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1752 { SNaN, PSmallestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1753 { SNaN, MSmallestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1754 { SNaN, PSmallestNormalized, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1755 { SNaN, MSmallestNormalized, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1757 { PNormalValue, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1758 { PNormalValue, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1759 { PNormalValue, PZero, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1760 { PNormalValue, MZero, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1761 { PNormalValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1764 { PNormalValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1766 { PNormalValue, PNormalValue, "0x1p+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
1767 { PNormalValue, MNormalValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1768 { PNormalValue, PLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1769 { PNormalValue, MLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1770 { PNormalValue, PSmallestValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1771 { PNormalValue, MSmallestValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1772 { PNormalValue, PSmallestNormalized, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1773 { PNormalValue, MSmallestNormalized, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1774 { MNormalValue, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1775 { MNormalValue, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1776 { MNormalValue, PZero, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1777 { MNormalValue, MZero, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1778 { MNormalValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1781 { MNormalValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1783 { MNormalValue, PNormalValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1784 { MNormalValue, MNormalValue, "-0x1p+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
1785 { MNormalValue, PLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1786 { MNormalValue, MLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1787 { MNormalValue, PSmallestValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1788 { MNormalValue, MSmallestValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1789 { MNormalValue, PSmallestNormalized, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1790 { MNormalValue, MSmallestNormalized, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1791 { PLargestValue, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1792 { PLargestValue, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1793 { PLargestValue, PZero, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1794 { PLargestValue, MZero, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1795 { PLargestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1798 { PLargestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1800 { PLargestValue, PNormalValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1801 { PLargestValue, MNormalValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1802 { PLargestValue, PLargestValue, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
1803 { PLargestValue, MLargestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1804 { PLargestValue, PSmallestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1805 { PLargestValue, MSmallestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1806 … { PLargestValue, PSmallestNormalized, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1807 … { PLargestValue, MSmallestNormalized, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1808 { MLargestValue, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1809 { MLargestValue, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1810 { MLargestValue, PZero, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1811 { MLargestValue, MZero, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1812 { MLargestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1815 { MLargestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1817 { MLargestValue, PNormalValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1818 { MLargestValue, MNormalValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1819 { MLargestValue, PLargestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1820 { MLargestValue, MLargestValue, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
1821 { MLargestValue, PSmallestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1822 { MLargestValue, MSmallestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1823 … { MLargestValue, PSmallestNormalized, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1824 … { MLargestValue, MSmallestNormalized, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1825 { PSmallestValue, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1826 { PSmallestValue, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1827 { PSmallestValue, PZero, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1828 { PSmallestValue, MZero, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1829 { PSmallestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1832 { PSmallestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1834 { PSmallestValue, PNormalValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1835 { PSmallestValue, MNormalValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1836 { PSmallestValue, PLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1837 { PSmallestValue, MLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1838 { PSmallestValue, PSmallestValue, "0x1p-148", APFloat::opOK, APFloat::fcNormal }, in TEST()
1839 { PSmallestValue, MSmallestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1840 { PSmallestValue, PSmallestNormalized, "0x1.000002p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1841 { PSmallestValue, MSmallestNormalized, "-0x1.fffffcp-127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1842 { MSmallestValue, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1843 { MSmallestValue, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1844 { MSmallestValue, PZero, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1845 { MSmallestValue, MZero, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1846 { MSmallestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1849 { MSmallestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1851 { MSmallestValue, PNormalValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1852 { MSmallestValue, MNormalValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1853 { MSmallestValue, PLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1854 { MSmallestValue, MLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1855 { MSmallestValue, PSmallestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1856 { MSmallestValue, MSmallestValue, "-0x1p-148", APFloat::opOK, APFloat::fcNormal }, in TEST()
1857 { MSmallestValue, PSmallestNormalized, "0x1.fffffcp-127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1858 { MSmallestValue, MSmallestNormalized, "-0x1.000002p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1859 { PSmallestNormalized, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1860 { PSmallestNormalized, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1861 { PSmallestNormalized, PZero, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1862 { PSmallestNormalized, MZero, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1863 { PSmallestNormalized, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1866 { PSmallestNormalized, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1868 { PSmallestNormalized, PNormalValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1869 { PSmallestNormalized, MNormalValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1870 … { PSmallestNormalized, PLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1871 … { PSmallestNormalized, MLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1872 { PSmallestNormalized, PSmallestValue, "0x1.000002p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1873 { PSmallestNormalized, MSmallestValue, "0x1.fffffcp-127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1874 { PSmallestNormalized, PSmallestNormalized, "0x1p-125", APFloat::opOK, APFloat::fcNormal }, in TEST()
1875 { PSmallestNormalized, MSmallestNormalized, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1876 { MSmallestNormalized, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1877 { MSmallestNormalized, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1878 { MSmallestNormalized, PZero, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1879 { MSmallestNormalized, MZero, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1880 { MSmallestNormalized, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1883 { MSmallestNormalized, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1885 { MSmallestNormalized, PNormalValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1886 { MSmallestNormalized, MNormalValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1887 … { MSmallestNormalized, PLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1888 … { MSmallestNormalized, MLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
1889 { MSmallestNormalized, PSmallestValue, "-0x1.fffffcp-127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1890 { MSmallestNormalized, MSmallestValue, "-0x1.000002p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1891 { MSmallestNormalized, PSmallestNormalized, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1892 { MSmallestNormalized, MSmallestNormalized, "-0x1p-125", APFloat::opOK, APFloat::fcNormal } in TEST()
1896 APFloat x(SpecialCaseTests[i].x); in TEST()
1897 APFloat y(SpecialCaseTests[i].y); in TEST()
1898 APFloat::opStatus status = x.add(y, APFloat::rmNearestTiesToEven); in TEST()
1900 APFloat result(APFloat::IEEEsingle, SpecialCaseTests[i].result); in TEST()
1916 APFloat PInf = APFloat::getInf(APFloat::IEEEsingle, false); in TEST()
1917 APFloat MInf = APFloat::getInf(APFloat::IEEEsingle, true); in TEST()
1918 APFloat PZero = APFloat::getZero(APFloat::IEEEsingle, false); in TEST()
1919 APFloat MZero = APFloat::getZero(APFloat::IEEEsingle, true); in TEST()
1920 APFloat QNaN = APFloat::getNaN(APFloat::IEEEsingle, false); in TEST()
1921 APFloat SNaN = APFloat::getSNaN(APFloat::IEEEsingle, false); in TEST()
1922 APFloat PNormalValue = APFloat(APFloat::IEEEsingle, "0x1p+0"); in TEST()
1923 APFloat MNormalValue = APFloat(APFloat::IEEEsingle, "-0x1p+0"); in TEST()
1924 APFloat PLargestValue = APFloat::getLargest(APFloat::IEEEsingle, false); in TEST()
1925 APFloat MLargestValue = APFloat::getLargest(APFloat::IEEEsingle, true); in TEST()
1926 APFloat PSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, false); in TEST()
1927 APFloat MSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, true); in TEST()
1928 APFloat PSmallestNormalized = in TEST()
1929 APFloat::getSmallestNormalized(APFloat::IEEEsingle, false); in TEST()
1930 APFloat MSmallestNormalized = in TEST()
1931 APFloat::getSmallestNormalized(APFloat::IEEEsingle, true); in TEST()
1933 const int OverflowStatus = APFloat::opOverflow | APFloat::opInexact; in TEST()
1937 APFloat x; in TEST()
1938 APFloat y; in TEST()
1943 { PInf, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1944 { PInf, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1945 { PInf, PZero, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1946 { PInf, MZero, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1947 { PInf, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1950 { PInf, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1952 { PInf, PNormalValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1953 { PInf, MNormalValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1954 { PInf, PLargestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1955 { PInf, MLargestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1956 { PInf, PSmallestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1957 { PInf, MSmallestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1958 { PInf, PSmallestNormalized, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1959 { PInf, MSmallestNormalized, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1960 { MInf, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1961 { MInf, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1962 { MInf, PZero, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1963 { MInf, MZero, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1964 { MInf, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1967 { MInf, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1969 { MInf, PNormalValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1970 { MInf, MNormalValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1971 { MInf, PLargestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1972 { MInf, MLargestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1973 { MInf, PSmallestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1974 { MInf, MSmallestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1975 { MInf, PSmallestNormalized, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1976 { MInf, MSmallestNormalized, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1977 { PZero, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1978 { PZero, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1979 { PZero, PZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1980 { PZero, MZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1981 { PZero, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
1984 { PZero, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
1986 { PZero, PNormalValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1987 { PZero, MNormalValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
1988 { PZero, PLargestValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1989 { PZero, MLargestValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
1990 { PZero, PSmallestValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1991 { PZero, MSmallestValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
1992 { PZero, PSmallestNormalized, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1993 { PZero, MSmallestNormalized, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
1994 { MZero, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1995 { MZero, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
1996 { MZero, PZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1997 { MZero, MZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
1998 { MZero, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2001 { MZero, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2003 { MZero, PNormalValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2004 { MZero, MNormalValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2005 { MZero, PLargestValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2006 { MZero, MLargestValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2007 { MZero, PSmallestValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2008 { MZero, MSmallestValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2009 { MZero, PSmallestNormalized, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2010 { MZero, MSmallestNormalized, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2011 { QNaN, PInf, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2012 { QNaN, MInf, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2013 { QNaN, PZero, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2014 { QNaN, MZero, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2015 { QNaN, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2018 { QNaN, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2020 { QNaN, PNormalValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2021 { QNaN, MNormalValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2022 { QNaN, PLargestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2023 { QNaN, MLargestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2024 { QNaN, PSmallestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2025 { QNaN, MSmallestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2026 { QNaN, PSmallestNormalized, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2027 { QNaN, MSmallestNormalized, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2030 { SNaN, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2031 { SNaN, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2032 { SNaN, PZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2033 { SNaN, MZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2034 { SNaN, QNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2035 { SNaN, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2036 { SNaN, PNormalValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2037 { SNaN, MNormalValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2038 { SNaN, PLargestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2039 { SNaN, MLargestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2040 { SNaN, PSmallestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2041 { SNaN, MSmallestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2042 { SNaN, PSmallestNormalized, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2043 { SNaN, MSmallestNormalized, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2045 { PNormalValue, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2046 { PNormalValue, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2047 { PNormalValue, PZero, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2048 { PNormalValue, MZero, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2049 { PNormalValue, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2052 { PNormalValue, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2054 { PNormalValue, PNormalValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2055 { PNormalValue, MNormalValue, "0x1p+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2056 { PNormalValue, PLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2057 { PNormalValue, MLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2058 { PNormalValue, PSmallestValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2059 { PNormalValue, MSmallestValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2060 { PNormalValue, PSmallestNormalized, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2061 { PNormalValue, MSmallestNormalized, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2062 { MNormalValue, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2063 { MNormalValue, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2064 { MNormalValue, PZero, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2065 { MNormalValue, MZero, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2066 { MNormalValue, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2069 { MNormalValue, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2071 { MNormalValue, PNormalValue, "-0x1p+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2072 { MNormalValue, MNormalValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2073 { MNormalValue, PLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2074 { MNormalValue, MLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2075 { MNormalValue, PSmallestValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2076 { MNormalValue, MSmallestValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2077 { MNormalValue, PSmallestNormalized, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2078 { MNormalValue, MSmallestNormalized, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2079 { PLargestValue, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2080 { PLargestValue, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2081 { PLargestValue, PZero, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2082 { PLargestValue, MZero, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2083 { PLargestValue, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2086 { PLargestValue, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2088 { PLargestValue, PNormalValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2089 { PLargestValue, MNormalValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2090 { PLargestValue, PLargestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2091 { PLargestValue, MLargestValue, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2092 { PLargestValue, PSmallestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2093 { PLargestValue, MSmallestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2094 … { PLargestValue, PSmallestNormalized, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2095 … { PLargestValue, MSmallestNormalized, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2096 { MLargestValue, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2097 { MLargestValue, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2098 { MLargestValue, PZero, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2099 { MLargestValue, MZero, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2100 { MLargestValue, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2103 { MLargestValue, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2105 { MLargestValue, PNormalValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2106 { MLargestValue, MNormalValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2107 { MLargestValue, PLargestValue, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2108 { MLargestValue, MLargestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2109 { MLargestValue, PSmallestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2110 { MLargestValue, MSmallestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2111 … { MLargestValue, PSmallestNormalized, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2112 … { MLargestValue, MSmallestNormalized, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2113 { PSmallestValue, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2114 { PSmallestValue, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2115 { PSmallestValue, PZero, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2116 { PSmallestValue, MZero, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2117 { PSmallestValue, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2120 { PSmallestValue, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2122 { PSmallestValue, PNormalValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2123 { PSmallestValue, MNormalValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2124 { PSmallestValue, PLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2125 { PSmallestValue, MLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2126 { PSmallestValue, PSmallestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2127 { PSmallestValue, MSmallestValue, "0x1p-148", APFloat::opOK, APFloat::fcNormal }, in TEST()
2128 { PSmallestValue, PSmallestNormalized, "-0x1.fffffcp-127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2129 { PSmallestValue, MSmallestNormalized, "0x1.000002p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2130 { MSmallestValue, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2131 { MSmallestValue, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2132 { MSmallestValue, PZero, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2133 { MSmallestValue, MZero, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2134 { MSmallestValue, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2137 { MSmallestValue, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2139 { MSmallestValue, PNormalValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2140 { MSmallestValue, MNormalValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2141 { MSmallestValue, PLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2142 { MSmallestValue, MLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2143 { MSmallestValue, PSmallestValue, "-0x1p-148", APFloat::opOK, APFloat::fcNormal }, in TEST()
2144 { MSmallestValue, MSmallestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2145 { MSmallestValue, PSmallestNormalized, "-0x1.000002p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2146 { MSmallestValue, MSmallestNormalized, "0x1.fffffcp-127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2147 { PSmallestNormalized, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2148 { PSmallestNormalized, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2149 { PSmallestNormalized, PZero, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2150 { PSmallestNormalized, MZero, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2151 { PSmallestNormalized, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2154 { PSmallestNormalized, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2156 { PSmallestNormalized, PNormalValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2157 { PSmallestNormalized, MNormalValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2158 … { PSmallestNormalized, PLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2159 … { PSmallestNormalized, MLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2160 { PSmallestNormalized, PSmallestValue, "0x1.fffffcp-127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2161 { PSmallestNormalized, MSmallestValue, "0x1.000002p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2162 { PSmallestNormalized, PSmallestNormalized, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2163 { PSmallestNormalized, MSmallestNormalized, "0x1p-125", APFloat::opOK, APFloat::fcNormal }, in TEST()
2164 { MSmallestNormalized, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2165 { MSmallestNormalized, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2166 { MSmallestNormalized, PZero, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2167 { MSmallestNormalized, MZero, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2168 { MSmallestNormalized, QNaN, "-nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2171 { MSmallestNormalized, SNaN, "-nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2173 { MSmallestNormalized, PNormalValue, "-0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2174 { MSmallestNormalized, MNormalValue, "0x1p+0", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2175 … { MSmallestNormalized, PLargestValue, "-0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2176 … { MSmallestNormalized, MLargestValue, "0x1.fffffep+127", APFloat::opInexact, APFloat::fcNormal }, in TEST()
2177 { MSmallestNormalized, PSmallestValue, "-0x1.000002p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2178 { MSmallestNormalized, MSmallestValue, "-0x1.fffffcp-127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2179 { MSmallestNormalized, PSmallestNormalized, "-0x1p-125", APFloat::opOK, APFloat::fcNormal }, in TEST()
2180 { MSmallestNormalized, MSmallestNormalized, "0x0p+0", APFloat::opOK, APFloat::fcZero } in TEST()
2184 APFloat x(SpecialCaseTests[i].x); in TEST()
2185 APFloat y(SpecialCaseTests[i].y); in TEST()
2186 APFloat::opStatus status = x.subtract(y, APFloat::rmNearestTiesToEven); in TEST()
2188 APFloat result(APFloat::IEEEsingle, SpecialCaseTests[i].result); in TEST()
2204 APFloat PInf = APFloat::getInf(APFloat::IEEEsingle, false); in TEST()
2205 APFloat MInf = APFloat::getInf(APFloat::IEEEsingle, true); in TEST()
2206 APFloat PZero = APFloat::getZero(APFloat::IEEEsingle, false); in TEST()
2207 APFloat MZero = APFloat::getZero(APFloat::IEEEsingle, true); in TEST()
2208 APFloat QNaN = APFloat::getNaN(APFloat::IEEEsingle, false); in TEST()
2209 APFloat SNaN = APFloat::getSNaN(APFloat::IEEEsingle, false); in TEST()
2210 APFloat PNormalValue = APFloat(APFloat::IEEEsingle, "0x1p+0"); in TEST()
2211 APFloat MNormalValue = APFloat(APFloat::IEEEsingle, "-0x1p+0"); in TEST()
2212 APFloat PLargestValue = APFloat::getLargest(APFloat::IEEEsingle, false); in TEST()
2213 APFloat MLargestValue = APFloat::getLargest(APFloat::IEEEsingle, true); in TEST()
2214 APFloat PSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, false); in TEST()
2215 APFloat MSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, true); in TEST()
2216 APFloat PSmallestNormalized = in TEST()
2217 APFloat::getSmallestNormalized(APFloat::IEEEsingle, false); in TEST()
2218 APFloat MSmallestNormalized = in TEST()
2219 APFloat::getSmallestNormalized(APFloat::IEEEsingle, true); in TEST()
2221 const int OverflowStatus = APFloat::opOverflow | APFloat::opInexact; in TEST()
2222 const int UnderflowStatus = APFloat::opUnderflow | APFloat::opInexact; in TEST()
2226 APFloat x; in TEST()
2227 APFloat y; in TEST()
2232 { PInf, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2233 { PInf, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2234 { PInf, PZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2235 { PInf, MZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2236 { PInf, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2239 { PInf, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2241 { PInf, PNormalValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2242 { PInf, MNormalValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2243 { PInf, PLargestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2244 { PInf, MLargestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2245 { PInf, PSmallestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2246 { PInf, MSmallestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2247 { PInf, PSmallestNormalized, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2248 { PInf, MSmallestNormalized, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2249 { MInf, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2250 { MInf, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2251 { MInf, PZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2252 { MInf, MZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2253 { MInf, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2256 { MInf, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2258 { MInf, PNormalValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2259 { MInf, MNormalValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2260 { MInf, PLargestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2261 { MInf, MLargestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2262 { MInf, PSmallestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2263 { MInf, MSmallestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2264 { MInf, PSmallestNormalized, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2265 { MInf, MSmallestNormalized, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2266 { PZero, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2267 { PZero, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2268 { PZero, PZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2269 { PZero, MZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2270 { PZero, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2273 { PZero, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2275 { PZero, PNormalValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2276 { PZero, MNormalValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2277 { PZero, PLargestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2278 { PZero, MLargestValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2279 { PZero, PSmallestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2280 { PZero, MSmallestValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2281 { PZero, PSmallestNormalized, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2282 { PZero, MSmallestNormalized, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2283 { MZero, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2284 { MZero, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2285 { MZero, PZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2286 { MZero, MZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2287 { MZero, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2290 { MZero, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2292 { MZero, PNormalValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2293 { MZero, MNormalValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2294 { MZero, PLargestValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2295 { MZero, MLargestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2296 { MZero, PSmallestValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2297 { MZero, MSmallestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2298 { MZero, PSmallestNormalized, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2299 { MZero, MSmallestNormalized, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2300 { QNaN, PInf, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2301 { QNaN, MInf, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2302 { QNaN, PZero, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2303 { QNaN, MZero, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2304 { QNaN, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2307 { QNaN, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2309 { QNaN, PNormalValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2310 { QNaN, MNormalValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2311 { QNaN, PLargestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2312 { QNaN, MLargestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2313 { QNaN, PSmallestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2314 { QNaN, MSmallestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2315 { QNaN, PSmallestNormalized, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2316 { QNaN, MSmallestNormalized, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2319 { SNaN, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2320 { SNaN, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2321 { SNaN, PZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2322 { SNaN, MZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2323 { SNaN, QNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2324 { SNaN, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2325 { SNaN, PNormalValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2326 { SNaN, MNormalValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2327 { SNaN, PLargestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2328 { SNaN, MLargestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2329 { SNaN, PSmallestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2330 { SNaN, MSmallestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2331 { SNaN, PSmallestNormalized, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2332 { SNaN, MSmallestNormalized, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2334 { PNormalValue, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2335 { PNormalValue, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2336 { PNormalValue, PZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2337 { PNormalValue, MZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2338 { PNormalValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2341 { PNormalValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2343 { PNormalValue, PNormalValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2344 { PNormalValue, MNormalValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2345 { PNormalValue, PLargestValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2346 { PNormalValue, MLargestValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2347 { PNormalValue, PSmallestValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2348 { PNormalValue, MSmallestValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2349 { PNormalValue, PSmallestNormalized, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2350 { PNormalValue, MSmallestNormalized, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2351 { MNormalValue, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2352 { MNormalValue, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2353 { MNormalValue, PZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2354 { MNormalValue, MZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2355 { MNormalValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2358 { MNormalValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2360 { MNormalValue, PNormalValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2361 { MNormalValue, MNormalValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2362 { MNormalValue, PLargestValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2363 { MNormalValue, MLargestValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2364 { MNormalValue, PSmallestValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2365 { MNormalValue, MSmallestValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2366 { MNormalValue, PSmallestNormalized, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2367 { MNormalValue, MSmallestNormalized, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2368 { PLargestValue, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2369 { PLargestValue, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2370 { PLargestValue, PZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2371 { PLargestValue, MZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2372 { PLargestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2375 { PLargestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2377 { PLargestValue, PNormalValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2378 { PLargestValue, MNormalValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2379 { PLargestValue, PLargestValue, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2380 { PLargestValue, MLargestValue, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2381 { PLargestValue, PSmallestValue, "0x1.fffffep-22", APFloat::opOK, APFloat::fcNormal }, in TEST()
2382 { PLargestValue, MSmallestValue, "-0x1.fffffep-22", APFloat::opOK, APFloat::fcNormal }, in TEST()
2383 { PLargestValue, PSmallestNormalized, "0x1.fffffep+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2384 { PLargestValue, MSmallestNormalized, "-0x1.fffffep+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2385 { MLargestValue, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2386 { MLargestValue, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2387 { MLargestValue, PZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2388 { MLargestValue, MZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2389 { MLargestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2392 { MLargestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2394 { MLargestValue, PNormalValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2395 { MLargestValue, MNormalValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2396 { MLargestValue, PLargestValue, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2397 { MLargestValue, MLargestValue, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2398 { MLargestValue, PSmallestValue, "-0x1.fffffep-22", APFloat::opOK, APFloat::fcNormal }, in TEST()
2399 { MLargestValue, MSmallestValue, "0x1.fffffep-22", APFloat::opOK, APFloat::fcNormal }, in TEST()
2400 { MLargestValue, PSmallestNormalized, "-0x1.fffffep+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2401 { MLargestValue, MSmallestNormalized, "0x1.fffffep+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2402 { PSmallestValue, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2403 { PSmallestValue, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2404 { PSmallestValue, PZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2405 { PSmallestValue, MZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2406 { PSmallestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2409 { PSmallestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2411 { PSmallestValue, PNormalValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2412 { PSmallestValue, MNormalValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2413 { PSmallestValue, PLargestValue, "0x1.fffffep-22", APFloat::opOK, APFloat::fcNormal }, in TEST()
2414 { PSmallestValue, MLargestValue, "-0x1.fffffep-22", APFloat::opOK, APFloat::fcNormal }, in TEST()
2415 { PSmallestValue, PSmallestValue, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2416 { PSmallestValue, MSmallestValue, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2417 { PSmallestValue, PSmallestNormalized, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2418 { PSmallestValue, MSmallestNormalized, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2419 { MSmallestValue, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2420 { MSmallestValue, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2421 { MSmallestValue, PZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2422 { MSmallestValue, MZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2423 { MSmallestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2426 { MSmallestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2428 { MSmallestValue, PNormalValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2429 { MSmallestValue, MNormalValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2430 { MSmallestValue, PLargestValue, "-0x1.fffffep-22", APFloat::opOK, APFloat::fcNormal }, in TEST()
2431 { MSmallestValue, MLargestValue, "0x1.fffffep-22", APFloat::opOK, APFloat::fcNormal }, in TEST()
2432 { MSmallestValue, PSmallestValue, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2433 { MSmallestValue, MSmallestValue, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2434 { MSmallestValue, PSmallestNormalized, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2435 { MSmallestValue, MSmallestNormalized, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2436 { PSmallestNormalized, PInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2437 { PSmallestNormalized, MInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2438 { PSmallestNormalized, PZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2439 { PSmallestNormalized, MZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2440 { PSmallestNormalized, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2443 { PSmallestNormalized, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2445 { PSmallestNormalized, PNormalValue, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2446 { PSmallestNormalized, MNormalValue, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2447 { PSmallestNormalized, PLargestValue, "0x1.fffffep+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2448 { PSmallestNormalized, MLargestValue, "-0x1.fffffep+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2449 { PSmallestNormalized, PSmallestValue, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2450 { PSmallestNormalized, MSmallestValue, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2451 { PSmallestNormalized, PSmallestNormalized, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2452 { PSmallestNormalized, MSmallestNormalized, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2453 { MSmallestNormalized, PInf, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2454 { MSmallestNormalized, MInf, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2455 { MSmallestNormalized, PZero, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2456 { MSmallestNormalized, MZero, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2457 { MSmallestNormalized, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2460 { MSmallestNormalized, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2462 { MSmallestNormalized, PNormalValue, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2463 { MSmallestNormalized, MNormalValue, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2464 { MSmallestNormalized, PLargestValue, "-0x1.fffffep+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2465 { MSmallestNormalized, MLargestValue, "0x1.fffffep+1", APFloat::opOK, APFloat::fcNormal }, in TEST()
2466 { MSmallestNormalized, PSmallestValue, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2467 { MSmallestNormalized, MSmallestValue, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2468 { MSmallestNormalized, PSmallestNormalized, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2469 { MSmallestNormalized, MSmallestNormalized, "0x0p+0", UnderflowStatus, APFloat::fcZero } in TEST()
2473 APFloat x(SpecialCaseTests[i].x); in TEST()
2474 APFloat y(SpecialCaseTests[i].y); in TEST()
2475 APFloat::opStatus status = x.multiply(y, APFloat::rmNearestTiesToEven); in TEST()
2477 APFloat result(APFloat::IEEEsingle, SpecialCaseTests[i].result); in TEST()
2493 APFloat PInf = APFloat::getInf(APFloat::IEEEsingle, false); in TEST()
2494 APFloat MInf = APFloat::getInf(APFloat::IEEEsingle, true); in TEST()
2495 APFloat PZero = APFloat::getZero(APFloat::IEEEsingle, false); in TEST()
2496 APFloat MZero = APFloat::getZero(APFloat::IEEEsingle, true); in TEST()
2497 APFloat QNaN = APFloat::getNaN(APFloat::IEEEsingle, false); in TEST()
2498 APFloat SNaN = APFloat::getSNaN(APFloat::IEEEsingle, false); in TEST()
2499 APFloat PNormalValue = APFloat(APFloat::IEEEsingle, "0x1p+0"); in TEST()
2500 APFloat MNormalValue = APFloat(APFloat::IEEEsingle, "-0x1p+0"); in TEST()
2501 APFloat PLargestValue = APFloat::getLargest(APFloat::IEEEsingle, false); in TEST()
2502 APFloat MLargestValue = APFloat::getLargest(APFloat::IEEEsingle, true); in TEST()
2503 APFloat PSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, false); in TEST()
2504 APFloat MSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, true); in TEST()
2505 APFloat PSmallestNormalized = in TEST()
2506 APFloat::getSmallestNormalized(APFloat::IEEEsingle, false); in TEST()
2507 APFloat MSmallestNormalized = in TEST()
2508 APFloat::getSmallestNormalized(APFloat::IEEEsingle, true); in TEST()
2510 const int OverflowStatus = APFloat::opOverflow | APFloat::opInexact; in TEST()
2511 const int UnderflowStatus = APFloat::opUnderflow | APFloat::opInexact; in TEST()
2515 APFloat x; in TEST()
2516 APFloat y; in TEST()
2521 { PInf, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2522 { PInf, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2523 { PInf, PZero, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2524 { PInf, MZero, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2525 { PInf, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2528 { PInf, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2530 { PInf, PNormalValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2531 { PInf, MNormalValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2532 { PInf, PLargestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2533 { PInf, MLargestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2534 { PInf, PSmallestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2535 { PInf, MSmallestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2536 { PInf, PSmallestNormalized, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2537 { PInf, MSmallestNormalized, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2538 { MInf, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2539 { MInf, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2540 { MInf, PZero, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2541 { MInf, MZero, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2542 { MInf, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2545 { MInf, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2547 { MInf, PNormalValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2548 { MInf, MNormalValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2549 { MInf, PLargestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2550 { MInf, MLargestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2551 { MInf, PSmallestValue, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2552 { MInf, MSmallestValue, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2553 { MInf, PSmallestNormalized, "-inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2554 { MInf, MSmallestNormalized, "inf", APFloat::opOK, APFloat::fcInfinity }, in TEST()
2555 { PZero, PInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2556 { PZero, MInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2557 { PZero, PZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2558 { PZero, MZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2559 { PZero, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2562 { PZero, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2564 { PZero, PNormalValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2565 { PZero, MNormalValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2566 { PZero, PLargestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2567 { PZero, MLargestValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2568 { PZero, PSmallestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2569 { PZero, MSmallestValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2570 { PZero, PSmallestNormalized, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2571 { PZero, MSmallestNormalized, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2572 { MZero, PInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2573 { MZero, MInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2574 { MZero, PZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2575 { MZero, MZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2576 { MZero, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2579 { MZero, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2581 { MZero, PNormalValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2582 { MZero, MNormalValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2583 { MZero, PLargestValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2584 { MZero, MLargestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2585 { MZero, PSmallestValue, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2586 { MZero, MSmallestValue, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2587 { MZero, PSmallestNormalized, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2588 { MZero, MSmallestNormalized, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2589 { QNaN, PInf, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2590 { QNaN, MInf, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2591 { QNaN, PZero, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2592 { QNaN, MZero, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2593 { QNaN, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2596 { QNaN, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2598 { QNaN, PNormalValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2599 { QNaN, MNormalValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2600 { QNaN, PLargestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2601 { QNaN, MLargestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2602 { QNaN, PSmallestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2603 { QNaN, MSmallestValue, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2604 { QNaN, PSmallestNormalized, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2605 { QNaN, MSmallestNormalized, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2608 { SNaN, PInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2609 { SNaN, MInf, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2610 { SNaN, PZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2611 { SNaN, MZero, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2612 { SNaN, QNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2613 { SNaN, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2614 { SNaN, PNormalValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2615 { SNaN, MNormalValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2616 { SNaN, PLargestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2617 { SNaN, MLargestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2618 { SNaN, PSmallestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2619 { SNaN, MSmallestValue, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2620 { SNaN, PSmallestNormalized, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2621 { SNaN, MSmallestNormalized, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2623 { PNormalValue, PInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2624 { PNormalValue, MInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2625 { PNormalValue, PZero, "inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2626 { PNormalValue, MZero, "-inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2627 { PNormalValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2630 { PNormalValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2632 { PNormalValue, PNormalValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2633 { PNormalValue, MNormalValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2634 { PNormalValue, PLargestValue, "0x1p-128", UnderflowStatus, APFloat::fcNormal }, in TEST()
2635 { PNormalValue, MLargestValue, "-0x1p-128", UnderflowStatus, APFloat::fcNormal }, in TEST()
2636 { PNormalValue, PSmallestValue, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2637 { PNormalValue, MSmallestValue, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2638 { PNormalValue, PSmallestNormalized, "0x1p+126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2639 { PNormalValue, MSmallestNormalized, "-0x1p+126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2640 { MNormalValue, PInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2641 { MNormalValue, MInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2642 { MNormalValue, PZero, "-inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2643 { MNormalValue, MZero, "inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2644 { MNormalValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2647 { MNormalValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2649 { MNormalValue, PNormalValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2650 { MNormalValue, MNormalValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2651 { MNormalValue, PLargestValue, "-0x1p-128", UnderflowStatus, APFloat::fcNormal }, in TEST()
2652 { MNormalValue, MLargestValue, "0x1p-128", UnderflowStatus, APFloat::fcNormal }, in TEST()
2653 { MNormalValue, PSmallestValue, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2654 { MNormalValue, MSmallestValue, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2655 { MNormalValue, PSmallestNormalized, "-0x1p+126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2656 { MNormalValue, MSmallestNormalized, "0x1p+126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2657 { PLargestValue, PInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2658 { PLargestValue, MInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2659 { PLargestValue, PZero, "inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2660 { PLargestValue, MZero, "-inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2661 { PLargestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2664 { PLargestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2666 { PLargestValue, PNormalValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2667 { PLargestValue, MNormalValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2668 { PLargestValue, PLargestValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2669 { PLargestValue, MLargestValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2670 { PLargestValue, PSmallestValue, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2671 { PLargestValue, MSmallestValue, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2672 { PLargestValue, PSmallestNormalized, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2673 { PLargestValue, MSmallestNormalized, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2674 { MLargestValue, PInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2675 { MLargestValue, MInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2676 { MLargestValue, PZero, "-inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2677 { MLargestValue, MZero, "inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2678 { MLargestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2681 { MLargestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2683 { MLargestValue, PNormalValue, "-0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2684 { MLargestValue, MNormalValue, "0x1.fffffep+127", APFloat::opOK, APFloat::fcNormal }, in TEST()
2685 { MLargestValue, PLargestValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2686 { MLargestValue, MLargestValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2687 { MLargestValue, PSmallestValue, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2688 { MLargestValue, MSmallestValue, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2689 { MLargestValue, PSmallestNormalized, "-inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2690 { MLargestValue, MSmallestNormalized, "inf", OverflowStatus, APFloat::fcInfinity }, in TEST()
2691 { PSmallestValue, PInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2692 { PSmallestValue, MInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2693 { PSmallestValue, PZero, "inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2694 { PSmallestValue, MZero, "-inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2695 { PSmallestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2698 { PSmallestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2700 { PSmallestValue, PNormalValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2701 { PSmallestValue, MNormalValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2702 { PSmallestValue, PLargestValue, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2703 { PSmallestValue, MLargestValue, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2704 { PSmallestValue, PSmallestValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2705 { PSmallestValue, MSmallestValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2706 { PSmallestValue, PSmallestNormalized, "0x1p-23", APFloat::opOK, APFloat::fcNormal }, in TEST()
2707 { PSmallestValue, MSmallestNormalized, "-0x1p-23", APFloat::opOK, APFloat::fcNormal }, in TEST()
2708 { MSmallestValue, PInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2709 { MSmallestValue, MInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2710 { MSmallestValue, PZero, "-inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2711 { MSmallestValue, MZero, "inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2712 { MSmallestValue, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2715 { MSmallestValue, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2717 { MSmallestValue, PNormalValue, "-0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2718 { MSmallestValue, MNormalValue, "0x1p-149", APFloat::opOK, APFloat::fcNormal }, in TEST()
2719 { MSmallestValue, PLargestValue, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2720 { MSmallestValue, MLargestValue, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2721 { MSmallestValue, PSmallestValue, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2722 { MSmallestValue, MSmallestValue, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2723 { MSmallestValue, PSmallestNormalized, "-0x1p-23", APFloat::opOK, APFloat::fcNormal }, in TEST()
2724 { MSmallestValue, MSmallestNormalized, "0x1p-23", APFloat::opOK, APFloat::fcNormal }, in TEST()
2725 { PSmallestNormalized, PInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2726 { PSmallestNormalized, MInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2727 { PSmallestNormalized, PZero, "inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2728 { PSmallestNormalized, MZero, "-inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2729 { PSmallestNormalized, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2732 { PSmallestNormalized, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2734 { PSmallestNormalized, PNormalValue, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2735 { PSmallestNormalized, MNormalValue, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2736 { PSmallestNormalized, PLargestValue, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2737 { PSmallestNormalized, MLargestValue, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2738 { PSmallestNormalized, PSmallestValue, "0x1p+23", APFloat::opOK, APFloat::fcNormal }, in TEST()
2739 { PSmallestNormalized, MSmallestValue, "-0x1p+23", APFloat::opOK, APFloat::fcNormal }, in TEST()
2740 { PSmallestNormalized, PSmallestNormalized, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2741 { PSmallestNormalized, MSmallestNormalized, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2742 { MSmallestNormalized, PInf, "-0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2743 { MSmallestNormalized, MInf, "0x0p+0", APFloat::opOK, APFloat::fcZero }, in TEST()
2744 { MSmallestNormalized, PZero, "-inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2745 { MSmallestNormalized, MZero, "inf", APFloat::opDivByZero, APFloat::fcInfinity }, in TEST()
2746 { MSmallestNormalized, QNaN, "nan", APFloat::opOK, APFloat::fcNaN }, in TEST()
2749 { MSmallestNormalized, SNaN, "nan", APFloat::opInvalidOp, APFloat::fcNaN }, in TEST()
2751 { MSmallestNormalized, PNormalValue, "-0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2752 { MSmallestNormalized, MNormalValue, "0x1p-126", APFloat::opOK, APFloat::fcNormal }, in TEST()
2753 { MSmallestNormalized, PLargestValue, "-0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2754 { MSmallestNormalized, MLargestValue, "0x0p+0", UnderflowStatus, APFloat::fcZero }, in TEST()
2755 { MSmallestNormalized, PSmallestValue, "-0x1p+23", APFloat::opOK, APFloat::fcNormal }, in TEST()
2756 { MSmallestNormalized, MSmallestValue, "0x1p+23", APFloat::opOK, APFloat::fcNormal }, in TEST()
2757 { MSmallestNormalized, PSmallestNormalized, "-0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2758 { MSmallestNormalized, MSmallestNormalized, "0x1p+0", APFloat::opOK, APFloat::fcNormal }, in TEST()
2762 APFloat x(SpecialCaseTests[i].x); in TEST()
2763 APFloat y(SpecialCaseTests[i].y); in TEST()
2764 APFloat::opStatus status = x.divide(y, APFloat::rmNearestTiesToEven); in TEST()
2766 APFloat result(APFloat::IEEEsingle, SpecialCaseTests[i].result); in TEST()
2776 APFloat One = APFloat(APFloat::IEEEsingle, "0x1p+0"); in TEST()
2777 APFloat Two = APFloat(APFloat::IEEEsingle, "0x2p+0"); in TEST()
2785 APFloat PInf = APFloat::getInf(APFloat::IEEEsingle, false); in TEST()
2786 APFloat MInf = APFloat::getInf(APFloat::IEEEsingle, true); in TEST()
2787 APFloat PZero = APFloat::getZero(APFloat::IEEEsingle, false); in TEST()
2788 APFloat MZero = APFloat::getZero(APFloat::IEEEsingle, true); in TEST()
2789 APFloat PQNaN = APFloat::getNaN(APFloat::IEEEsingle, false); in TEST()
2790 APFloat MQNaN = APFloat::getNaN(APFloat::IEEEsingle, true); in TEST()
2791 APFloat PSNaN = APFloat::getSNaN(APFloat::IEEEsingle, false); in TEST()
2792 APFloat MSNaN = APFloat::getSNaN(APFloat::IEEEsingle, true); in TEST()
2793 APFloat PNormalValue = APFloat(APFloat::IEEEsingle, "0x1p+0"); in TEST()
2794 APFloat MNormalValue = APFloat(APFloat::IEEEsingle, "-0x1p+0"); in TEST()
2795 APFloat PLargestValue = APFloat::getLargest(APFloat::IEEEsingle, false); in TEST()
2796 APFloat MLargestValue = APFloat::getLargest(APFloat::IEEEsingle, true); in TEST()
2797 APFloat PSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, false); in TEST()
2798 APFloat MSmallestValue = APFloat::getSmallest(APFloat::IEEEsingle, true); in TEST()
2799 APFloat PSmallestNormalized = in TEST()
2800 APFloat::getSmallestNormalized(APFloat::IEEEsingle, false); in TEST()
2801 APFloat MSmallestNormalized = in TEST()
2802 APFloat::getSmallestNormalized(APFloat::IEEEsingle, true); in TEST()
2823 EXPECT_EQ(-1074, ilogb(APFloat::getSmallest(APFloat::IEEEdouble, false))); in TEST()
2824 EXPECT_EQ(-1074, ilogb(APFloat::getSmallest(APFloat::IEEEdouble, true))); in TEST()
2825 EXPECT_EQ(-1023, ilogb(APFloat(APFloat::IEEEdouble, "0x1.ffffffffffffep-1024"))); in TEST()
2826 EXPECT_EQ(-1023, ilogb(APFloat(APFloat::IEEEdouble, "0x1.ffffffffffffep-1023"))); in TEST()
2827 EXPECT_EQ(-1023, ilogb(APFloat(APFloat::IEEEdouble, "-0x1.ffffffffffffep-1023"))); in TEST()
2828 EXPECT_EQ(-51, ilogb(APFloat(APFloat::IEEEdouble, "0x1p-51"))); in TEST()
2829 EXPECT_EQ(-1023, ilogb(APFloat(APFloat::IEEEdouble, "0x1.c60f120d9f87cp-1023"))); in TEST()
2830 EXPECT_EQ(-2, ilogb(APFloat(APFloat::IEEEdouble, "0x0.ffffp-1"))); in TEST()
2831 EXPECT_EQ(-1023, ilogb(APFloat(APFloat::IEEEdouble, "0x1.fffep-1023"))); in TEST()
2832 EXPECT_EQ(1023, ilogb(APFloat::getLargest(APFloat::IEEEdouble, false))); in TEST()
2833 EXPECT_EQ(1023, ilogb(APFloat::getLargest(APFloat::IEEEdouble, true))); in TEST()
2836 EXPECT_EQ(0, ilogb(APFloat(APFloat::IEEEsingle, "0x1p+0"))); in TEST()
2837 EXPECT_EQ(0, ilogb(APFloat(APFloat::IEEEsingle, "-0x1p+0"))); in TEST()
2838 EXPECT_EQ(42, ilogb(APFloat(APFloat::IEEEsingle, "0x1p+42"))); in TEST()
2839 EXPECT_EQ(-42, ilogb(APFloat(APFloat::IEEEsingle, "0x1p-42"))); in TEST()
2841 EXPECT_EQ(APFloat::IEK_Inf, in TEST()
2842 ilogb(APFloat::getInf(APFloat::IEEEsingle, false))); in TEST()
2843 EXPECT_EQ(APFloat::IEK_Inf, in TEST()
2844 ilogb(APFloat::getInf(APFloat::IEEEsingle, true))); in TEST()
2845 EXPECT_EQ(APFloat::IEK_Zero, in TEST()
2846 ilogb(APFloat::getZero(APFloat::IEEEsingle, false))); in TEST()
2847 EXPECT_EQ(APFloat::IEK_Zero, in TEST()
2848 ilogb(APFloat::getZero(APFloat::IEEEsingle, true))); in TEST()
2849 EXPECT_EQ(APFloat::IEK_NaN, in TEST()
2850 ilogb(APFloat::getNaN(APFloat::IEEEsingle, false))); in TEST()
2851 EXPECT_EQ(APFloat::IEK_NaN, in TEST()
2852 ilogb(APFloat::getSNaN(APFloat::IEEEsingle, false))); in TEST()
2854 EXPECT_EQ(127, ilogb(APFloat::getLargest(APFloat::IEEEsingle, false))); in TEST()
2855 EXPECT_EQ(127, ilogb(APFloat::getLargest(APFloat::IEEEsingle, true))); in TEST()
2857 EXPECT_EQ(-149, ilogb(APFloat::getSmallest(APFloat::IEEEsingle, false))); in TEST()
2858 EXPECT_EQ(-149, ilogb(APFloat::getSmallest(APFloat::IEEEsingle, true))); in TEST()
2860 ilogb(APFloat::getSmallestNormalized(APFloat::IEEEsingle, false))); in TEST()
2862 ilogb(APFloat::getSmallestNormalized(APFloat::IEEEsingle, true))); in TEST()
2867 const APFloat::roundingMode RM = APFloat::rmNearestTiesToEven; in TEST()
2869 APFloat(APFloat::IEEEsingle, "0x1p+0") in TEST()
2870 .bitwiseIsEqual(scalbn(APFloat(APFloat::IEEEsingle, "0x1p+0"), 0, RM))); in TEST()
2872 APFloat(APFloat::IEEEsingle, "0x1p+42") in TEST()
2873 .bitwiseIsEqual(scalbn(APFloat(APFloat::IEEEsingle, "0x1p+0"), 42, RM))); in TEST()
2875 APFloat(APFloat::IEEEsingle, "0x1p-42") in TEST()
2876 .bitwiseIsEqual(scalbn(APFloat(APFloat::IEEEsingle, "0x1p+0"), -42, RM))); in TEST()
2878 APFloat PInf = APFloat::getInf(APFloat::IEEEsingle, false); in TEST()
2879 APFloat MInf = APFloat::getInf(APFloat::IEEEsingle, true); in TEST()
2880 APFloat PZero = APFloat::getZero(APFloat::IEEEsingle, false); in TEST()
2881 APFloat MZero = APFloat::getZero(APFloat::IEEEsingle, true); in TEST()
2882 APFloat QPNaN = APFloat::getNaN(APFloat::IEEEsingle, false); in TEST()
2883 APFloat QMNaN = APFloat::getNaN(APFloat::IEEEsingle, true); in TEST()
2884 APFloat SNaN = APFloat::getSNaN(APFloat::IEEEsingle, false); in TEST()
2894 APFloat ScalbnSNaN = scalbn(SNaN, 1, RM); in TEST()
2903 APFloat SNaNWithPayload = APFloat::getSNaN(APFloat::IEEEdouble, false, in TEST()
2905 APFloat QuietPayload = scalbn(SNaNWithPayload, 1, RM); in TEST()
2910 scalbn(APFloat(APFloat::IEEEsingle, "0x1p+0"), 128, RM))); in TEST()
2912 scalbn(APFloat(APFloat::IEEEsingle, "-0x1p+0"), 128, RM))); in TEST()
2914 scalbn(APFloat(APFloat::IEEEsingle, "0x1p+127"), 1, RM))); in TEST()
2916 scalbn(APFloat(APFloat::IEEEsingle, "0x1p-127"), -127, RM))); in TEST()
2918 scalbn(APFloat(APFloat::IEEEsingle, "-0x1p-127"), -127, RM))); in TEST()
2919 EXPECT_TRUE(APFloat(APFloat::IEEEsingle, "-0x1p-149").bitwiseIsEqual( in TEST()
2920 scalbn(APFloat(APFloat::IEEEsingle, "-0x1p-127"), -22, RM))); in TEST()
2922 scalbn(APFloat(APFloat::IEEEsingle, "0x1p-126"), -24, RM))); in TEST()
2925 APFloat SmallestF64 = APFloat::getSmallest(APFloat::IEEEdouble, false); in TEST()
2926 APFloat NegSmallestF64 = APFloat::getSmallest(APFloat::IEEEdouble, true); in TEST()
2928 APFloat LargestF64 = APFloat::getLargest(APFloat::IEEEdouble, false); in TEST()
2929 APFloat NegLargestF64 = APFloat::getLargest(APFloat::IEEEdouble, true); in TEST()
2931 APFloat SmallestNormalizedF64 in TEST()
2932 = APFloat::getSmallestNormalized(APFloat::IEEEdouble, false); in TEST()
2933 APFloat NegSmallestNormalizedF64 in TEST()
2934 = APFloat::getSmallestNormalized(APFloat::IEEEdouble, true); in TEST()
2936 APFloat LargestDenormalF64(APFloat::IEEEdouble, "0x1.ffffffffffffep-1023"); in TEST()
2937 APFloat NegLargestDenormalF64(APFloat::IEEEdouble, "-0x1.ffffffffffffep-1023"); in TEST()
2941 scalbn(APFloat(APFloat::IEEEdouble, "0x1p-1074"), 0, RM))); in TEST()
2943 scalbn(APFloat(APFloat::IEEEdouble, "-0x1p-1074"), 0, RM))); in TEST()
2945 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1p+1023") in TEST()
2951 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1p+1022") in TEST()
2953 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1p+1023") in TEST()
2967 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.ffffffffffffep-1022") in TEST()
2969 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "-0x1.ffffffffffffep-1021") in TEST()
2972 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.ffffffffffffep+1") in TEST()
2981 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.ffffffffffffep-2") in TEST()
2983 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.ffffffffffffep-1") in TEST()
2985 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.ffffffffffffep+0") in TEST()
2987 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.ffffffffffffep+1023") in TEST()
2989 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1p+974") in TEST()
2992 APFloat RandomDenormalF64(APFloat::IEEEdouble, "0x1.c60f120d9f87cp+51"); in TEST()
2993 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.c60f120d9f87cp-972") in TEST()
2995 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.c60f120d9f87cp-1") in TEST()
2997 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.c60f120d9f87cp-2") in TEST()
2999 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.c60f120d9f87cp+0") in TEST()
3007 APFloat(APFloat::IEEEdouble, "-0x1p-1073") in TEST()
3011 APFloat(APFloat::IEEEdouble, "-0x1p-1024") in TEST()
3015 APFloat(APFloat::IEEEdouble, "0x1p-1073") in TEST()
3019 APFloat(APFloat::IEEEdouble, "0x1p-1074") in TEST()
3021 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "-0x1p-1074") in TEST()
3028 APFloat(APFloat::IEEEdouble, "0x1p+0") in TEST()
3029 .bitwiseIsEqual(scalbn(APFloat(APFloat::IEEEdouble, "0x1p+52"), -52, RM))); in TEST()
3032 APFloat(APFloat::IEEEdouble, "0x1p-103") in TEST()
3033 .bitwiseIsEqual(scalbn(APFloat(APFloat::IEEEdouble, "0x1p-51"), -52, RM))); in TEST()
3037 const APFloat::roundingMode RM = APFloat::rmNearestTiesToEven; in TEST()
3039 APFloat PZero = APFloat::getZero(APFloat::IEEEdouble, false); in TEST()
3040 APFloat MZero = APFloat::getZero(APFloat::IEEEdouble, true); in TEST()
3041 APFloat One(1.0); in TEST()
3042 APFloat MOne(-1.0); in TEST()
3043 APFloat Two(2.0); in TEST()
3044 APFloat MTwo(-2.0); in TEST()
3046 APFloat LargestDenormal(APFloat::IEEEdouble, "0x1.ffffffffffffep-1023"); in TEST()
3047 APFloat NegLargestDenormal(APFloat::IEEEdouble, "-0x1.ffffffffffffep-1023"); in TEST()
3049 APFloat Smallest = APFloat::getSmallest(APFloat::IEEEdouble, false); in TEST()
3050 APFloat NegSmallest = APFloat::getSmallest(APFloat::IEEEdouble, true); in TEST()
3052 APFloat Largest = APFloat::getLargest(APFloat::IEEEdouble, false); in TEST()
3053 APFloat NegLargest = APFloat::getLargest(APFloat::IEEEdouble, true); in TEST()
3055 APFloat PInf = APFloat::getInf(APFloat::IEEEdouble, false); in TEST()
3056 APFloat MInf = APFloat::getInf(APFloat::IEEEdouble, true); in TEST()
3058 APFloat QPNaN = APFloat::getNaN(APFloat::IEEEdouble, false); in TEST()
3059 APFloat QMNaN = APFloat::getNaN(APFloat::IEEEdouble, true); in TEST()
3060 APFloat SNaN = APFloat::getSNaN(APFloat::IEEEdouble, false); in TEST()
3068 APFloat SNaNWithPayload = APFloat::getSNaN(APFloat::IEEEdouble, false, in TEST()
3071 APFloat SmallestNormalized in TEST()
3072 = APFloat::getSmallestNormalized(APFloat::IEEEdouble, false); in TEST()
3073 APFloat NegSmallestNormalized in TEST()
3074 = APFloat::getSmallestNormalized(APFloat::IEEEdouble, true); in TEST()
3077 APFloat Frac(APFloat::IEEEdouble); in TEST()
3091 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1p-1").bitwiseIsEqual(Frac)); in TEST()
3095 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "-0x1p-1").bitwiseIsEqual(Frac)); in TEST()
3099 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.ffffffffffffep-1").bitwiseIsEqual(Frac)); in TEST()
3103 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "-0x1.ffffffffffffep-1").bitwiseIsEqual(Frac)); in TEST()
3108 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1p-1").bitwiseIsEqual(Frac)); in TEST()
3112 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "-0x1p-1").bitwiseIsEqual(Frac)); in TEST()
3117 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.fffffffffffffp-1").bitwiseIsEqual(Frac)); in TEST()
3121 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "-0x1.fffffffffffffp-1").bitwiseIsEqual(Frac)); in TEST()
3149 Frac = frexp(APFloat(APFloat::IEEEdouble, "0x0.ffffp-1"), Exp, RM); in TEST()
3151 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.fffep-1").bitwiseIsEqual(Frac)); in TEST()
3153 Frac = frexp(APFloat(APFloat::IEEEdouble, "0x1p-51"), Exp, RM); in TEST()
3155 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1p-1").bitwiseIsEqual(Frac)); in TEST()
3157 Frac = frexp(APFloat(APFloat::IEEEdouble, "0x1.c60f120d9f87cp+51"), Exp, RM); in TEST()
3159 EXPECT_TRUE(APFloat(APFloat::IEEEdouble, "0x1.c60f120d9f87cp-1").bitwiseIsEqual(Frac)); in TEST()