diff options
Diffstat (limited to 'contrib/gdtoa/test')
36 files changed, 14663 insertions, 0 deletions
diff --git a/contrib/gdtoa/test/Q.ou0 b/contrib/gdtoa/test/Q.ou0 new file mode 100644 index 0000000..66c7e9b --- /dev/null +++ b/contrib/gdtoa/test/Q.ou0 @@ -0,0 +1,1180 @@ + +Input: 1.23 + +strtoQ consumes 4 bytes and returns 17 +with bits = #3fff3ae1 47ae147a e147ae14 7ae147ae +g_Qfmt(0) gives 4 bytes: "1.23" + +strtoIQ returns 17, consuming 4 bytes. +fI[0] = #3fff3ae1 47ae147a e147ae14 7ae147ae +fI[1] = #3fff3ae1 47ae147a e147ae14 7ae147af +fI[0] == strtod + + +Input: 1.23e+20 + +strtoQ consumes 8 bytes and returns 1 +with bits = #4041aabd f2145b43 0 0 +g_Qfmt(0) gives 8 bytes: "1.23e+20" + +strtoIQ returns 1, consuming 8 bytes. +fI[0] == fI[1] = #4041aabd f2145b43 0 0 + + +Input: 1.23e-20 + +strtoQ consumes 8 bytes and returns 17 +with bits = #3fbcd0ae 4cf76753 9e4cbca ad934841 +g_Qfmt(0) gives 8 bytes: "1.23e-20" + +strtoIQ returns 17, consuming 8 bytes. +fI[0] = #3fbcd0ae 4cf76753 9e4cbca ad934841 +fI[1] = #3fbcd0ae 4cf76753 9e4cbca ad934842 +fI[0] == strtod + + +Input: 1.23456789 + +strtoQ consumes 10 bytes and returns 17 +with bits = #3fff3c0c a4283de1 b7eb6945 1304948f +g_Qfmt(0) gives 10 bytes: "1.23456789" + +strtoIQ returns 17, consuming 10 bytes. +fI[0] = #3fff3c0c a4283de1 b7eb6945 1304948f +fI[1] = #3fff3c0c a4283de1 b7eb6945 13049490 +fI[0] == strtod + + +Input: 1.23456589e+20 + +strtoQ consumes 14 bytes and returns 1 +with bits = #4041ac53 7a660b99 74000000 0 +g_Qfmt(0) gives 14 bytes: "1.23456589e+20" + +strtoIQ returns 1, consuming 14 bytes. +fI[0] == fI[1] = #4041ac53 7a660b99 74000000 0 + + +Input: 1.23e+30 + +strtoQ consumes 8 bytes and returns 1 +with bits = #4062f0cb 4e8fb79 4945600 0 +g_Qfmt(0) gives 8 bytes: "1.23e+30" + +strtoIQ returns 1, consuming 8 bytes. +fI[0] == fI[1] = #4062f0cb 4e8fb79 4945600 0 + + +Input: 1.23e-30 + +strtoQ consumes 8 bytes and returns 17 +with bits = #3f9b8f28 66f5010a a9d63f9e d7e8ba14 +g_Qfmt(0) gives 8 bytes: "1.23e-30" + +strtoIQ returns 17, consuming 8 bytes. +fI[0] = #3f9b8f28 66f5010a a9d63f9e d7e8ba14 +fI[1] = #3f9b8f28 66f5010a a9d63f9e d7e8ba15 +fI[0] == strtod + + +Input: 1.23456789e-20 + +strtoQ consumes 14 bytes and returns 33 +with bits = #3fbcd268 1471e7ad a6a4a029 d86c1fa2 +g_Qfmt(0) gives 14 bytes: "1.23456789e-20" + +strtoIQ returns 33, consuming 14 bytes. +fI[0] = #3fbcd268 1471e7ad a6a4a029 d86c1fa1 +fI[1] = #3fbcd268 1471e7ad a6a4a029 d86c1fa2 +fI[1] == strtod + + +Input: 1.23456789e-30 + +strtoQ consumes 14 bytes and returns 17 +with bits = #3f9b90a3 e33bbd99 51f85855 5a6b19d4 +g_Qfmt(0) gives 14 bytes: "1.23456789e-30" + +strtoIQ returns 17, consuming 14 bytes. +fI[0] = #3f9b90a3 e33bbd99 51f85855 5a6b19d4 +fI[1] = #3f9b90a3 e33bbd99 51f85855 5a6b19d5 +fI[0] == strtod + + +Input: 1.234567890123456789 + +strtoQ consumes 20 bytes and returns 17 +with bits = #3fff3c0c a428c59f b71a4194 68dd175b +g_Qfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIQ returns 17, consuming 20 bytes. +fI[0] = #3fff3c0c a428c59f b71a4194 68dd175b +fI[1] = #3fff3c0c a428c59f b71a4194 68dd175c +fI[0] == strtod + + +Input: 1.23456789012345678901234567890123456789 + +strtoQ consumes 40 bytes and returns 17 +with bits = #3fff3c0c a428c59f b71a7be1 6b6b6d5b +g_Qfmt(0) gives 36 bytes: "1.2345678901234567890123456789012346" + +strtoIQ returns 17, consuming 40 bytes. +fI[0] = #3fff3c0c a428c59f b71a7be1 6b6b6d5b +fI[1] = #3fff3c0c a428c59f b71a7be1 6b6b6d5c +fI[0] == strtod + + +Input: 1.23e306 + +strtoQ consumes 8 bytes and returns 33 +with bits = #43f7c067 6cd1c61f 4daac5f1 e9fa3b55 +g_Qfmt(0) gives 9 bytes: "1.23e+306" + +strtoIQ returns 33, consuming 8 bytes. +fI[0] = #43f7c067 6cd1c61f 4daac5f1 e9fa3b54 +fI[1] = #43f7c067 6cd1c61f 4daac5f1 e9fa3b55 +fI[1] == strtod + + +Input: 1.23e-306 + +strtoQ consumes 9 bytes and returns 17 +with bits = #3c06ba3b 85da396e 7e496ab7 d233c3dd +g_Qfmt(0) gives 9 bytes: "1.23e-306" + +strtoIQ returns 17, consuming 9 bytes. +fI[0] = #3c06ba3b 85da396e 7e496ab7 d233c3dd +fI[1] = #3c06ba3b 85da396e 7e496ab7 d233c3de +fI[0] == strtod + + +Input: 1.23e-320 + +strtoQ consumes 9 bytes and returns 33 +with bits = #3bd83731 86e30898 7e33b2e8 355f847b +g_Qfmt(0) gives 9 bytes: "1.23e-320" + +strtoIQ returns 33, consuming 9 bytes. +fI[0] = #3bd83731 86e30898 7e33b2e8 355f847a +fI[1] = #3bd83731 86e30898 7e33b2e8 355f847b +fI[1] == strtod + + +Input: 1.23e-20 + +strtoQ consumes 8 bytes and returns 17 +with bits = #3fbcd0ae 4cf76753 9e4cbca ad934841 +g_Qfmt(0) gives 8 bytes: "1.23e-20" + +strtoIQ returns 17, consuming 8 bytes. +fI[0] = #3fbcd0ae 4cf76753 9e4cbca ad934841 +fI[1] = #3fbcd0ae 4cf76753 9e4cbca ad934842 +fI[0] == strtod + + +Input: 1.23456789e307 + +strtoQ consumes 14 bytes and returns 17 +with bits = #43fb194b 14bdaecd bcea468c 902464cf +g_Qfmt(0) gives 15 bytes: "1.23456789e+307" + +strtoIQ returns 17, consuming 14 bytes. +fI[0] = #43fb194b 14bdaecd bcea468c 902464cf +fI[1] = #43fb194b 14bdaecd bcea468c 902464d0 +fI[0] == strtod + + +Input: 1.23456589e-307 + +strtoQ consumes 15 bytes and returns 17 +with bits = #3c036319 6bb9845f a6d234e3 39163574 +g_Qfmt(0) gives 15 bytes: "1.23456589e-307" + +strtoIQ returns 17, consuming 15 bytes. +fI[0] = #3c036319 6bb9845f a6d234e3 39163574 +fI[1] = #3c036319 6bb9845f a6d234e3 39163575 +fI[0] == strtod + + +Input: 1.234567890123456789 + +strtoQ consumes 20 bytes and returns 17 +with bits = #3fff3c0c a428c59f b71a4194 68dd175b +g_Qfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIQ returns 17, consuming 20 bytes. +fI[0] = #3fff3c0c a428c59f b71a4194 68dd175b +fI[1] = #3fff3c0c a428c59f b71a4194 68dd175c +fI[0] == strtod + + +Input: 1.234567890123456789e301 + +strtoQ consumes 24 bytes and returns 33 +with bits = #43e726f5 175f5641 3017ea80 763990ef +g_Qfmt(0) gives 25 bytes: "1.234567890123456789e+301" + +strtoIQ returns 33, consuming 24 bytes. +fI[0] = #43e726f5 175f5641 3017ea80 763990ee +fI[1] = #43e726f5 175f5641 3017ea80 763990ef +fI[1] == strtod + + +Input: 1.234567890123456789e-301 + +strtoQ consumes 25 bytes and returns 17 +with bits = #3c1752a6 4e34ba0d 35b19b04 3222fce5 +g_Qfmt(0) gives 25 bytes: "1.234567890123456789e-301" + +strtoIQ returns 17, consuming 25 bytes. +fI[0] = #3c1752a6 4e34ba0d 35b19b04 3222fce5 +fI[1] = #3c1752a6 4e34ba0d 35b19b04 3222fce6 +fI[0] == strtod + + +Input: 1.234567890123456789e-321 + +strtoQ consumes 25 bytes and returns 17 +with bits = #3bd4f3c2 3699d4db 99d1ea94 2fecd7de +g_Qfmt(0) gives 25 bytes: "1.234567890123456789e-321" + +strtoIQ returns 17, consuming 25 bytes. +fI[0] = #3bd4f3c2 3699d4db 99d1ea94 2fecd7de +fI[1] = #3bd4f3c2 3699d4db 99d1ea94 2fecd7df +fI[0] == strtod + + +Input: 1e23 + +strtoQ consumes 4 bytes and returns 1 +with bits = #404b52d0 2c7e14af 68000000 0 +g_Qfmt(0) gives 5 bytes: "1e+23" + +strtoIQ returns 1, consuming 4 bytes. +fI[0] == fI[1] = #404b52d0 2c7e14af 68000000 0 + + +Input: 1e310 + +strtoQ consumes 5 bytes and returns 33 +with bits = #4404bd03 c8140697 9e9ff00e fefd4cbd +g_Qfmt(0) gives 6 bytes: "1e+310" + +strtoIQ returns 33, consuming 5 bytes. +fI[0] = #4404bd03 c8140697 9e9ff00e fefd4cbc +fI[1] = #4404bd03 c8140697 9e9ff00e fefd4cbd +fI[1] == strtod + + +Input: 9.0259718793241475e-277 + +strtoQ consumes 23 bytes and returns 17 +with bits = #3c69ffff ffffffff f9ed5779 ac118fe1 +g_Qfmt(0) gives 23 bytes: "9.0259718793241475e-277" + +strtoIQ returns 17, consuming 23 bytes. +fI[0] = #3c69ffff ffffffff f9ed5779 ac118fe1 +fI[1] = #3c69ffff ffffffff f9ed5779 ac118fe2 +fI[0] == strtod + + +Input: 9.025971879324147880346310405869e-277 + +strtoQ consumes 37 bytes and returns 33 +with bits = #3c6a0000 0 0 9a +g_Qfmt(0) gives 37 bytes: "9.025971879324147880346310405869e-277" + +strtoIQ returns 33, consuming 37 bytes. +fI[0] = #3c6a0000 0 0 99 +fI[1] = #3c6a0000 0 0 9a +fI[1] == strtod + + +Input: 9.025971879324147880346310405868e-277 + +strtoQ consumes 37 bytes and returns 17 +with bits = #3c69ffff ffffffff ffffffff fffffcb5 +g_Qfmt(0) gives 37 bytes: "9.025971879324147880346310405868e-277" + +strtoIQ returns 17, consuming 37 bytes. +fI[0] = #3c69ffff ffffffff ffffffff fffffcb5 +fI[1] = #3c69ffff ffffffff ffffffff fffffcb6 +fI[0] == strtod + + +Input: 2.2250738585072014e-308 + +strtoQ consumes 23 bytes and returns 33 +with bits = #3c010000 0 8c304c cf867de0 +g_Qfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoIQ returns 33, consuming 23 bytes. +fI[0] = #3c010000 0 8c304c cf867ddf +fI[1] = #3c010000 0 8c304c cf867de0 +fI[1] == strtod + + +Input: 2.2250738585072013e-308 + +strtoQ consumes 23 bytes and returns 33 +with bits = #3c00ffff ffffffff fa9e4c4f 4c1e8a10 +g_Qfmt(0) gives 23 bytes: "2.2250738585072013e-308" + +strtoIQ returns 33, consuming 23 bytes. +fI[0] = #3c00ffff ffffffff fa9e4c4f 4c1e8a0f +fI[1] = #3c00ffff ffffffff fa9e4c4f 4c1e8a10 +fI[1] == strtod + +Rounding mode for strtor... changed from 1 (nearest) to 0 (toward zero) + +Input: 1.1 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff1999 99999999 99999999 99999999 +g_Qfmt(0) gives 36 bytes: "1.0999999999999999999999999999999999" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff1999 99999999 99999999 99999999 +fI[1] = #3fff1999 99999999 99999999 9999999a +fI[0] == strtod + + +Input: -1.1 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff1999 99999999 99999999 99999999 +g_Qfmt(0) gives 37 bytes: "-1.0999999999999999999999999999999999" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff1999 99999999 99999999 9999999a +fI[1] = #bfff1999 99999999 99999999 99999999 +fI[1] == strtod + + +Input: 1.2 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff3333 33333333 33333333 33333333 +g_Qfmt(0) gives 3 bytes: "1.2" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff3333 33333333 33333333 33333333 +fI[1] = #3fff3333 33333333 33333333 33333334 +fI[0] == strtod + + +Input: -1.2 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff3333 33333333 33333333 33333333 +g_Qfmt(0) gives 4 bytes: "-1.2" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff3333 33333333 33333333 33333334 +fI[1] = #bfff3333 33333333 33333333 33333333 +fI[1] == strtod + + +Input: 1.3 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff4ccc cccccccc cccccccc cccccccc +g_Qfmt(0) gives 36 bytes: "1.2999999999999999999999999999999998" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff4ccc cccccccc cccccccc cccccccc +fI[1] = #3fff4ccc cccccccc cccccccc cccccccd +fI[0] == strtod + + +Input: -1.3 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff4ccc cccccccc cccccccc cccccccc +g_Qfmt(0) gives 37 bytes: "-1.2999999999999999999999999999999998" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff4ccc cccccccc cccccccc cccccccd +fI[1] = #bfff4ccc cccccccc cccccccc cccccccc +fI[1] == strtod + + +Input: 1.4 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff6666 66666666 66666666 66666666 +g_Qfmt(0) gives 3 bytes: "1.4" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff6666 66666666 66666666 66666666 +fI[1] = #3fff6666 66666666 66666666 66666667 +fI[0] == strtod + + +Input: -1.4 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff6666 66666666 66666666 66666666 +g_Qfmt(0) gives 4 bytes: "-1.4" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff6666 66666666 66666666 66666667 +fI[1] = #bfff6666 66666666 66666666 66666666 +fI[1] == strtod + + +Input: 1.5 + +strtoQ consumes 3 bytes and returns 1 +with bits = #3fff8000 0 0 0 +g_Qfmt(0) gives 3 bytes: "1.5" + +strtoIQ returns 1, consuming 3 bytes. +fI[0] == fI[1] = #3fff8000 0 0 0 + + +Input: -1.5 + +strtoQ consumes 4 bytes and returns 9 +with bits = #bfff8000 0 0 0 +g_Qfmt(0) gives 4 bytes: "-1.5" + +strtoIQ returns 9, consuming 4 bytes. +fI[0] == fI[1] = #bfff8000 0 0 0 + + +Input: 1.6 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff9999 99999999 99999999 99999999 +g_Qfmt(0) gives 36 bytes: "1.5999999999999999999999999999999999" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff9999 99999999 99999999 99999999 +fI[1] = #3fff9999 99999999 99999999 9999999a +fI[0] == strtod + + +Input: -1.6 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff9999 99999999 99999999 99999999 +g_Qfmt(0) gives 37 bytes: "-1.5999999999999999999999999999999999" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff9999 99999999 99999999 9999999a +fI[1] = #bfff9999 99999999 99999999 99999999 +fI[1] == strtod + + +Input: 1.7 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffb333 33333333 33333333 33333333 +g_Qfmt(0) gives 3 bytes: "1.7" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffb333 33333333 33333333 33333333 +fI[1] = #3fffb333 33333333 33333333 33333334 +fI[0] == strtod + + +Input: -1.7 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffb333 33333333 33333333 33333333 +g_Qfmt(0) gives 4 bytes: "-1.7" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffb333 33333333 33333333 33333334 +fI[1] = #bfffb333 33333333 33333333 33333333 +fI[1] == strtod + + +Input: 1.8 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffcccc cccccccc cccccccc cccccccc +g_Qfmt(0) gives 36 bytes: "1.7999999999999999999999999999999998" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fffcccc cccccccc cccccccc cccccccc +fI[1] = #3fffcccc cccccccc cccccccc cccccccd +fI[0] == strtod + + +Input: -1.8 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffcccc cccccccc cccccccc cccccccc +g_Qfmt(0) gives 37 bytes: "-1.7999999999999999999999999999999998" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfffcccc cccccccc cccccccc cccccccd +fI[1] = #bfffcccc cccccccc cccccccc cccccccc +fI[1] == strtod + + +Input: 1.9 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffe666 66666666 66666666 66666666 +g_Qfmt(0) gives 3 bytes: "1.9" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffe666 66666666 66666666 66666666 +fI[1] = #3fffe666 66666666 66666666 66666667 +fI[0] == strtod + + +Input: -1.9 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffe666 66666666 66666666 66666666 +g_Qfmt(0) gives 4 bytes: "-1.9" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffe666 66666666 66666666 66666667 +fI[1] = #bfffe666 66666666 66666666 66666666 +fI[1] == strtod + +Rounding mode for strtor... changed from 0 (toward zero) to 1 (nearest) + +Input: 1.1 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff1999 99999999 99999999 9999999a +g_Qfmt(0) gives 3 bytes: "1.1" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff1999 99999999 99999999 99999999 +fI[1] = #3fff1999 99999999 99999999 9999999a +fI[1] == strtod + + +Input: -1.1 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff1999 99999999 99999999 9999999a +g_Qfmt(0) gives 4 bytes: "-1.1" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff1999 99999999 99999999 9999999a +fI[1] = #bfff1999 99999999 99999999 99999999 +fI[0] == strtod + + +Input: 1.2 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff3333 33333333 33333333 33333333 +g_Qfmt(0) gives 3 bytes: "1.2" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff3333 33333333 33333333 33333333 +fI[1] = #3fff3333 33333333 33333333 33333334 +fI[0] == strtod + + +Input: -1.2 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff3333 33333333 33333333 33333333 +g_Qfmt(0) gives 4 bytes: "-1.2" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff3333 33333333 33333333 33333334 +fI[1] = #bfff3333 33333333 33333333 33333333 +fI[1] == strtod + + +Input: 1.3 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff4ccc cccccccc cccccccc cccccccd +g_Qfmt(0) gives 3 bytes: "1.3" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff4ccc cccccccc cccccccc cccccccc +fI[1] = #3fff4ccc cccccccc cccccccc cccccccd +fI[1] == strtod + + +Input: -1.3 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff4ccc cccccccc cccccccc cccccccd +g_Qfmt(0) gives 4 bytes: "-1.3" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff4ccc cccccccc cccccccc cccccccd +fI[1] = #bfff4ccc cccccccc cccccccc cccccccc +fI[0] == strtod + + +Input: 1.4 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff6666 66666666 66666666 66666666 +g_Qfmt(0) gives 3 bytes: "1.4" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff6666 66666666 66666666 66666666 +fI[1] = #3fff6666 66666666 66666666 66666667 +fI[0] == strtod + + +Input: -1.4 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff6666 66666666 66666666 66666666 +g_Qfmt(0) gives 4 bytes: "-1.4" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff6666 66666666 66666666 66666667 +fI[1] = #bfff6666 66666666 66666666 66666666 +fI[1] == strtod + + +Input: 1.5 + +strtoQ consumes 3 bytes and returns 1 +with bits = #3fff8000 0 0 0 +g_Qfmt(0) gives 3 bytes: "1.5" + +strtoIQ returns 1, consuming 3 bytes. +fI[0] == fI[1] = #3fff8000 0 0 0 + + +Input: -1.5 + +strtoQ consumes 4 bytes and returns 9 +with bits = #bfff8000 0 0 0 +g_Qfmt(0) gives 4 bytes: "-1.5" + +strtoIQ returns 9, consuming 4 bytes. +fI[0] == fI[1] = #bfff8000 0 0 0 + + +Input: 1.6 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff9999 99999999 99999999 9999999a +g_Qfmt(0) gives 3 bytes: "1.6" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff9999 99999999 99999999 99999999 +fI[1] = #3fff9999 99999999 99999999 9999999a +fI[1] == strtod + + +Input: -1.6 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff9999 99999999 99999999 9999999a +g_Qfmt(0) gives 4 bytes: "-1.6" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff9999 99999999 99999999 9999999a +fI[1] = #bfff9999 99999999 99999999 99999999 +fI[0] == strtod + + +Input: 1.7 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffb333 33333333 33333333 33333333 +g_Qfmt(0) gives 3 bytes: "1.7" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffb333 33333333 33333333 33333333 +fI[1] = #3fffb333 33333333 33333333 33333334 +fI[0] == strtod + + +Input: -1.7 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffb333 33333333 33333333 33333333 +g_Qfmt(0) gives 4 bytes: "-1.7" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffb333 33333333 33333333 33333334 +fI[1] = #bfffb333 33333333 33333333 33333333 +fI[1] == strtod + + +Input: 1.8 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fffcccc cccccccc cccccccc cccccccd +g_Qfmt(0) gives 3 bytes: "1.8" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fffcccc cccccccc cccccccc cccccccc +fI[1] = #3fffcccc cccccccc cccccccc cccccccd +fI[1] == strtod + + +Input: -1.8 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfffcccc cccccccc cccccccc cccccccd +g_Qfmt(0) gives 4 bytes: "-1.8" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfffcccc cccccccc cccccccc cccccccd +fI[1] = #bfffcccc cccccccc cccccccc cccccccc +fI[0] == strtod + + +Input: 1.9 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffe666 66666666 66666666 66666666 +g_Qfmt(0) gives 3 bytes: "1.9" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffe666 66666666 66666666 66666666 +fI[1] = #3fffe666 66666666 66666666 66666667 +fI[0] == strtod + + +Input: -1.9 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffe666 66666666 66666666 66666666 +g_Qfmt(0) gives 4 bytes: "-1.9" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffe666 66666666 66666666 66666667 +fI[1] = #bfffe666 66666666 66666666 66666666 +fI[1] == strtod + +Rounding mode for strtor... changed from 1 (nearest) to 2 (toward +Infinity) + +Input: 1.1 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff1999 99999999 99999999 9999999a +g_Qfmt(0) gives 3 bytes: "1.1" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff1999 99999999 99999999 99999999 +fI[1] = #3fff1999 99999999 99999999 9999999a +fI[1] == strtod + + +Input: -1.1 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff1999 99999999 99999999 99999999 +g_Qfmt(0) gives 37 bytes: "-1.0999999999999999999999999999999999" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff1999 99999999 99999999 9999999a +fI[1] = #bfff1999 99999999 99999999 99999999 +fI[1] == strtod + + +Input: 1.2 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff3333 33333333 33333333 33333334 +g_Qfmt(0) gives 36 bytes: "1.2000000000000000000000000000000002" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff3333 33333333 33333333 33333333 +fI[1] = #3fff3333 33333333 33333333 33333334 +fI[1] == strtod + + +Input: -1.2 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff3333 33333333 33333333 33333333 +g_Qfmt(0) gives 4 bytes: "-1.2" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff3333 33333333 33333333 33333334 +fI[1] = #bfff3333 33333333 33333333 33333333 +fI[1] == strtod + + +Input: 1.3 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff4ccc cccccccc cccccccc cccccccd +g_Qfmt(0) gives 3 bytes: "1.3" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff4ccc cccccccc cccccccc cccccccc +fI[1] = #3fff4ccc cccccccc cccccccc cccccccd +fI[1] == strtod + + +Input: -1.3 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff4ccc cccccccc cccccccc cccccccc +g_Qfmt(0) gives 37 bytes: "-1.2999999999999999999999999999999998" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff4ccc cccccccc cccccccc cccccccd +fI[1] = #bfff4ccc cccccccc cccccccc cccccccc +fI[1] == strtod + + +Input: 1.4 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff6666 66666666 66666666 66666667 +g_Qfmt(0) gives 36 bytes: "1.4000000000000000000000000000000001" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff6666 66666666 66666666 66666666 +fI[1] = #3fff6666 66666666 66666666 66666667 +fI[1] == strtod + + +Input: -1.4 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff6666 66666666 66666666 66666666 +g_Qfmt(0) gives 4 bytes: "-1.4" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff6666 66666666 66666666 66666667 +fI[1] = #bfff6666 66666666 66666666 66666666 +fI[1] == strtod + + +Input: 1.5 + +strtoQ consumes 3 bytes and returns 1 +with bits = #3fff8000 0 0 0 +g_Qfmt(0) gives 3 bytes: "1.5" + +strtoIQ returns 1, consuming 3 bytes. +fI[0] == fI[1] = #3fff8000 0 0 0 + + +Input: -1.5 + +strtoQ consumes 4 bytes and returns 9 +with bits = #bfff8000 0 0 0 +g_Qfmt(0) gives 4 bytes: "-1.5" + +strtoIQ returns 9, consuming 4 bytes. +fI[0] == fI[1] = #bfff8000 0 0 0 + + +Input: 1.6 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff9999 99999999 99999999 9999999a +g_Qfmt(0) gives 3 bytes: "1.6" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff9999 99999999 99999999 99999999 +fI[1] = #3fff9999 99999999 99999999 9999999a +fI[1] == strtod + + +Input: -1.6 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff9999 99999999 99999999 99999999 +g_Qfmt(0) gives 37 bytes: "-1.5999999999999999999999999999999999" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff9999 99999999 99999999 9999999a +fI[1] = #bfff9999 99999999 99999999 99999999 +fI[1] == strtod + + +Input: 1.7 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fffb333 33333333 33333333 33333334 +g_Qfmt(0) gives 36 bytes: "1.7000000000000000000000000000000002" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffb333 33333333 33333333 33333333 +fI[1] = #3fffb333 33333333 33333333 33333334 +fI[1] == strtod + + +Input: -1.7 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffb333 33333333 33333333 33333333 +g_Qfmt(0) gives 4 bytes: "-1.7" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffb333 33333333 33333333 33333334 +fI[1] = #bfffb333 33333333 33333333 33333333 +fI[1] == strtod + + +Input: 1.8 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fffcccc cccccccc cccccccc cccccccd +g_Qfmt(0) gives 3 bytes: "1.8" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fffcccc cccccccc cccccccc cccccccc +fI[1] = #3fffcccc cccccccc cccccccc cccccccd +fI[1] == strtod + + +Input: -1.8 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffcccc cccccccc cccccccc cccccccc +g_Qfmt(0) gives 37 bytes: "-1.7999999999999999999999999999999998" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfffcccc cccccccc cccccccc cccccccd +fI[1] = #bfffcccc cccccccc cccccccc cccccccc +fI[1] == strtod + + +Input: 1.9 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fffe666 66666666 66666666 66666667 +g_Qfmt(0) gives 36 bytes: "1.9000000000000000000000000000000001" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffe666 66666666 66666666 66666666 +fI[1] = #3fffe666 66666666 66666666 66666667 +fI[1] == strtod + + +Input: -1.9 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffe666 66666666 66666666 66666666 +g_Qfmt(0) gives 4 bytes: "-1.9" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffe666 66666666 66666666 66666667 +fI[1] = #bfffe666 66666666 66666666 66666666 +fI[1] == strtod + +Rounding mode for strtor... changed from 2 (toward +Infinity) to 3 (toward -Infinity) + +Input: 1.1 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff1999 99999999 99999999 99999999 +g_Qfmt(0) gives 36 bytes: "1.0999999999999999999999999999999999" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff1999 99999999 99999999 99999999 +fI[1] = #3fff1999 99999999 99999999 9999999a +fI[0] == strtod + + +Input: -1.1 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff1999 99999999 99999999 9999999a +g_Qfmt(0) gives 4 bytes: "-1.1" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff1999 99999999 99999999 9999999a +fI[1] = #bfff1999 99999999 99999999 99999999 +fI[0] == strtod + + +Input: 1.2 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff3333 33333333 33333333 33333333 +g_Qfmt(0) gives 3 bytes: "1.2" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff3333 33333333 33333333 33333333 +fI[1] = #3fff3333 33333333 33333333 33333334 +fI[0] == strtod + + +Input: -1.2 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff3333 33333333 33333333 33333334 +g_Qfmt(0) gives 37 bytes: "-1.2000000000000000000000000000000002" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff3333 33333333 33333333 33333334 +fI[1] = #bfff3333 33333333 33333333 33333333 +fI[0] == strtod + + +Input: 1.3 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff4ccc cccccccc cccccccc cccccccc +g_Qfmt(0) gives 36 bytes: "1.2999999999999999999999999999999998" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff4ccc cccccccc cccccccc cccccccc +fI[1] = #3fff4ccc cccccccc cccccccc cccccccd +fI[0] == strtod + + +Input: -1.3 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff4ccc cccccccc cccccccc cccccccd +g_Qfmt(0) gives 4 bytes: "-1.3" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff4ccc cccccccc cccccccc cccccccd +fI[1] = #bfff4ccc cccccccc cccccccc cccccccc +fI[0] == strtod + + +Input: 1.4 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff6666 66666666 66666666 66666666 +g_Qfmt(0) gives 3 bytes: "1.4" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff6666 66666666 66666666 66666666 +fI[1] = #3fff6666 66666666 66666666 66666667 +fI[0] == strtod + + +Input: -1.4 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff6666 66666666 66666666 66666667 +g_Qfmt(0) gives 37 bytes: "-1.4000000000000000000000000000000001" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff6666 66666666 66666666 66666667 +fI[1] = #bfff6666 66666666 66666666 66666666 +fI[0] == strtod + + +Input: 1.5 + +strtoQ consumes 3 bytes and returns 1 +with bits = #3fff8000 0 0 0 +g_Qfmt(0) gives 3 bytes: "1.5" + +strtoIQ returns 1, consuming 3 bytes. +fI[0] == fI[1] = #3fff8000 0 0 0 + + +Input: -1.5 + +strtoQ consumes 4 bytes and returns 9 +with bits = #bfff8000 0 0 0 +g_Qfmt(0) gives 4 bytes: "-1.5" + +strtoIQ returns 9, consuming 4 bytes. +fI[0] == fI[1] = #bfff8000 0 0 0 + + +Input: 1.6 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff9999 99999999 99999999 99999999 +g_Qfmt(0) gives 36 bytes: "1.5999999999999999999999999999999999" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff9999 99999999 99999999 99999999 +fI[1] = #3fff9999 99999999 99999999 9999999a +fI[0] == strtod + + +Input: -1.6 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff9999 99999999 99999999 9999999a +g_Qfmt(0) gives 4 bytes: "-1.6" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff9999 99999999 99999999 9999999a +fI[1] = #bfff9999 99999999 99999999 99999999 +fI[0] == strtod + + +Input: 1.7 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffb333 33333333 33333333 33333333 +g_Qfmt(0) gives 3 bytes: "1.7" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffb333 33333333 33333333 33333333 +fI[1] = #3fffb333 33333333 33333333 33333334 +fI[0] == strtod + + +Input: -1.7 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfffb333 33333333 33333333 33333334 +g_Qfmt(0) gives 37 bytes: "-1.7000000000000000000000000000000002" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffb333 33333333 33333333 33333334 +fI[1] = #bfffb333 33333333 33333333 33333333 +fI[0] == strtod + + +Input: 1.8 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffcccc cccccccc cccccccc cccccccc +g_Qfmt(0) gives 36 bytes: "1.7999999999999999999999999999999998" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fffcccc cccccccc cccccccc cccccccc +fI[1] = #3fffcccc cccccccc cccccccc cccccccd +fI[0] == strtod + + +Input: -1.8 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfffcccc cccccccc cccccccc cccccccd +g_Qfmt(0) gives 4 bytes: "-1.8" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfffcccc cccccccc cccccccc cccccccd +fI[1] = #bfffcccc cccccccc cccccccc cccccccc +fI[0] == strtod + + +Input: 1.9 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffe666 66666666 66666666 66666666 +g_Qfmt(0) gives 3 bytes: "1.9" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffe666 66666666 66666666 66666666 +fI[1] = #3fffe666 66666666 66666666 66666667 +fI[0] == strtod + + +Input: -1.9 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfffe666 66666666 66666666 66666667 +g_Qfmt(0) gives 37 bytes: "-1.9000000000000000000000000000000001" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffe666 66666666 66666666 66666667 +fI[1] = #bfffe666 66666666 66666666 66666666 +fI[0] == strtod + diff --git a/contrib/gdtoa/test/Q.ou1 b/contrib/gdtoa/test/Q.ou1 new file mode 100644 index 0000000..cb2a23f --- /dev/null +++ b/contrib/gdtoa/test/Q.ou1 @@ -0,0 +1,1468 @@ + +Input: 1.23 + +strtoQ consumes 4 bytes and returns 17 +with bits = #3fff3ae1 47ae147a e147ae14 7ae147ae +printf("%.35Lg") gives 1.23 +g_Qfmt(0) gives 4 bytes: "1.23" + +strtoIQ returns 17, consuming 4 bytes. +fI[0] = #3fff3ae1 47ae147a e147ae14 7ae147ae += 1.23 +fI[1] = #3fff3ae1 47ae147a e147ae14 7ae147af += 1.2300000000000000000000000000000002 +fI[0] == strtod + + +Input: 1.23e+20 + +strtoQ consumes 8 bytes and returns 1 +with bits = #4041aabd f2145b43 0 0 +printf("%.35Lg") gives 123000000000000000000 +g_Qfmt(0) gives 8 bytes: "1.23e+20" + +strtoIQ returns 1, consuming 8 bytes. +fI[0] == fI[1] = #4041aabd f2145b43 0 0 += 123000000000000000000 + + +Input: 1.23e-20 + +strtoQ consumes 8 bytes and returns 17 +with bits = #3fbcd0ae 4cf76753 9e4cbca ad934841 +printf("%.35Lg") gives 1.2299999999999999999999999999999999e-20 +g_Qfmt(0) gives 8 bytes: "1.23e-20" + +strtoIQ returns 17, consuming 8 bytes. +fI[0] = #3fbcd0ae 4cf76753 9e4cbca ad934841 += 1.2299999999999999999999999999999999e-20 +fI[1] = #3fbcd0ae 4cf76753 9e4cbca ad934842 += 1.2300000000000000000000000000000001e-20 +fI[0] == strtod + + +Input: 1.23456789 + +strtoQ consumes 10 bytes and returns 17 +with bits = #3fff3c0c a4283de1 b7eb6945 1304948f +printf("%.35Lg") gives 1.2345678899999999999999999999999999 +g_Qfmt(0) gives 10 bytes: "1.23456789" + +strtoIQ returns 17, consuming 10 bytes. +fI[0] = #3fff3c0c a4283de1 b7eb6945 1304948f += 1.2345678899999999999999999999999999 +fI[1] = #3fff3c0c a4283de1 b7eb6945 13049490 += 1.2345678900000000000000000000000001 +fI[0] == strtod + + +Input: 1.23456589e+20 + +strtoQ consumes 14 bytes and returns 1 +with bits = #4041ac53 7a660b99 74000000 0 +printf("%.35Lg") gives 123456589000000000000 +g_Qfmt(0) gives 14 bytes: "1.23456589e+20" + +strtoIQ returns 1, consuming 14 bytes. +fI[0] == fI[1] = #4041ac53 7a660b99 74000000 0 += 123456589000000000000 + + +Input: 1.23e+30 + +strtoQ consumes 8 bytes and returns 1 +with bits = #4062f0cb 4e8fb79 4945600 0 +printf("%.35Lg") gives 1230000000000000000000000000000 +g_Qfmt(0) gives 8 bytes: "1.23e+30" + +strtoIQ returns 1, consuming 8 bytes. +fI[0] == fI[1] = #4062f0cb 4e8fb79 4945600 0 += 1230000000000000000000000000000 + + +Input: 1.23e-30 + +strtoQ consumes 8 bytes and returns 17 +with bits = #3f9b8f28 66f5010a a9d63f9e d7e8ba14 +printf("%.35Lg") gives 1.2299999999999999999999999999999999e-30 +g_Qfmt(0) gives 8 bytes: "1.23e-30" + +strtoIQ returns 17, consuming 8 bytes. +fI[0] = #3f9b8f28 66f5010a a9d63f9e d7e8ba14 += 1.2299999999999999999999999999999999e-30 +fI[1] = #3f9b8f28 66f5010a a9d63f9e d7e8ba15 += 1.2300000000000000000000000000000001e-30 +fI[0] == strtod + + +Input: 1.23456789e-20 + +strtoQ consumes 14 bytes and returns 33 +with bits = #3fbcd268 1471e7ad a6a4a029 d86c1fa2 +printf("%.35Lg") gives 1.2345678900000000000000000000000001e-20 +g_Qfmt(0) gives 14 bytes: "1.23456789e-20" + +strtoIQ returns 33, consuming 14 bytes. +fI[0] = #3fbcd268 1471e7ad a6a4a029 d86c1fa1 += 1.2345678899999999999999999999999999e-20 +fI[1] = #3fbcd268 1471e7ad a6a4a029 d86c1fa2 += 1.2345678900000000000000000000000001e-20 +fI[1] == strtod + + +Input: 1.23456789e-30 + +strtoQ consumes 14 bytes and returns 17 +with bits = #3f9b90a3 e33bbd99 51f85855 5a6b19d4 +printf("%.35Lg") gives 1.23456789e-30 +g_Qfmt(0) gives 14 bytes: "1.23456789e-30" + +strtoIQ returns 17, consuming 14 bytes. +fI[0] = #3f9b90a3 e33bbd99 51f85855 5a6b19d4 += 1.23456789e-30 +fI[1] = #3f9b90a3 e33bbd99 51f85855 5a6b19d5 += 1.2345678900000000000000000000000001e-30 +fI[0] == strtod + + +Input: 1.234567890123456789 + +strtoQ consumes 20 bytes and returns 17 +with bits = #3fff3c0c a428c59f b71a4194 68dd175b +printf("%.35Lg") gives 1.234567890123456789 +g_Qfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIQ returns 17, consuming 20 bytes. +fI[0] = #3fff3c0c a428c59f b71a4194 68dd175b += 1.234567890123456789 +fI[1] = #3fff3c0c a428c59f b71a4194 68dd175c += 1.2345678901234567890000000000000002 +fI[0] == strtod + + +Input: 1.23456789012345678901234567890123456789 + +strtoQ consumes 40 bytes and returns 17 +with bits = #3fff3c0c a428c59f b71a7be1 6b6b6d5b +printf("%.35Lg") gives 1.2345678901234567890123456789012346 +g_Qfmt(0) gives 36 bytes: "1.2345678901234567890123456789012346" + +strtoIQ returns 17, consuming 40 bytes. +fI[0] = #3fff3c0c a428c59f b71a7be1 6b6b6d5b += 1.2345678901234567890123456789012346 +fI[1] = #3fff3c0c a428c59f b71a7be1 6b6b6d5c += 1.2345678901234567890123456789012347 +fI[0] == strtod + + +Input: 1.23e306 + +strtoQ consumes 8 bytes and returns 33 +with bits = #43f7c067 6cd1c61f 4daac5f1 e9fa3b55 +printf("%.35Lg") gives 1.23e+306 +g_Qfmt(0) gives 9 bytes: "1.23e+306" + +strtoIQ returns 33, consuming 8 bytes. +fI[0] = #43f7c067 6cd1c61f 4daac5f1 e9fa3b54 += 1.2299999999999999999999999999999999e+306 +fI[1] = #43f7c067 6cd1c61f 4daac5f1 e9fa3b55 += 1.23e+306 +fI[1] == strtod + + +Input: 1.23e-306 + +strtoQ consumes 9 bytes and returns 17 +with bits = #3c06ba3b 85da396e 7e496ab7 d233c3dd +printf("%.35Lg") gives 1.23e-306 +g_Qfmt(0) gives 9 bytes: "1.23e-306" + +strtoIQ returns 17, consuming 9 bytes. +fI[0] = #3c06ba3b 85da396e 7e496ab7 d233c3dd += 1.23e-306 +fI[1] = #3c06ba3b 85da396e 7e496ab7 d233c3de += 1.2300000000000000000000000000000001e-306 +fI[0] == strtod + + +Input: 1.23e-320 + +strtoQ consumes 9 bytes and returns 33 +with bits = #3bd83731 86e30898 7e33b2e8 355f847b +printf("%.35Lg") gives 1.2300000000000000000000000000000001e-320 +g_Qfmt(0) gives 9 bytes: "1.23e-320" + +strtoIQ returns 33, consuming 9 bytes. +fI[0] = #3bd83731 86e30898 7e33b2e8 355f847a += 1.2299999999999999999999999999999999e-320 +fI[1] = #3bd83731 86e30898 7e33b2e8 355f847b += 1.2300000000000000000000000000000001e-320 +fI[1] == strtod + + +Input: 1.23e-20 + +strtoQ consumes 8 bytes and returns 17 +with bits = #3fbcd0ae 4cf76753 9e4cbca ad934841 +printf("%.35Lg") gives 1.2299999999999999999999999999999999e-20 +g_Qfmt(0) gives 8 bytes: "1.23e-20" + +strtoIQ returns 17, consuming 8 bytes. +fI[0] = #3fbcd0ae 4cf76753 9e4cbca ad934841 += 1.2299999999999999999999999999999999e-20 +fI[1] = #3fbcd0ae 4cf76753 9e4cbca ad934842 += 1.2300000000000000000000000000000001e-20 +fI[0] == strtod + + +Input: 1.23456789e307 + +strtoQ consumes 14 bytes and returns 17 +with bits = #43fb194b 14bdaecd bcea468c 902464cf +printf("%.35Lg") gives 1.2345678899999999999999999999999999e+307 +g_Qfmt(0) gives 15 bytes: "1.23456789e+307" + +strtoIQ returns 17, consuming 14 bytes. +fI[0] = #43fb194b 14bdaecd bcea468c 902464cf += 1.2345678899999999999999999999999999e+307 +fI[1] = #43fb194b 14bdaecd bcea468c 902464d0 += 1.2345678900000000000000000000000001e+307 +fI[0] == strtod + + +Input: 1.23456589e-307 + +strtoQ consumes 15 bytes and returns 17 +with bits = #3c036319 6bb9845f a6d234e3 39163574 +printf("%.35Lg") gives 1.23456589e-307 +g_Qfmt(0) gives 15 bytes: "1.23456589e-307" + +strtoIQ returns 17, consuming 15 bytes. +fI[0] = #3c036319 6bb9845f a6d234e3 39163574 += 1.23456589e-307 +fI[1] = #3c036319 6bb9845f a6d234e3 39163575 += 1.2345658900000000000000000000000002e-307 +fI[0] == strtod + + +Input: 1.234567890123456789 + +strtoQ consumes 20 bytes and returns 17 +with bits = #3fff3c0c a428c59f b71a4194 68dd175b +printf("%.35Lg") gives 1.234567890123456789 +g_Qfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIQ returns 17, consuming 20 bytes. +fI[0] = #3fff3c0c a428c59f b71a4194 68dd175b += 1.234567890123456789 +fI[1] = #3fff3c0c a428c59f b71a4194 68dd175c += 1.2345678901234567890000000000000002 +fI[0] == strtod + + +Input: 1.234567890123456789e301 + +strtoQ consumes 24 bytes and returns 33 +with bits = #43e726f5 175f5641 3017ea80 763990ef +printf("%.35Lg") gives 1.2345678901234567890000000000000001e+301 +g_Qfmt(0) gives 25 bytes: "1.234567890123456789e+301" + +strtoIQ returns 33, consuming 24 bytes. +fI[0] = #43e726f5 175f5641 3017ea80 763990ee += 1.2345678901234567889999999999999999e+301 +fI[1] = #43e726f5 175f5641 3017ea80 763990ef += 1.2345678901234567890000000000000001e+301 +fI[1] == strtod + + +Input: 1.234567890123456789e-301 + +strtoQ consumes 25 bytes and returns 17 +with bits = #3c1752a6 4e34ba0d 35b19b04 3222fce5 +printf("%.35Lg") gives 1.234567890123456789e-301 +g_Qfmt(0) gives 25 bytes: "1.234567890123456789e-301" + +strtoIQ returns 17, consuming 25 bytes. +fI[0] = #3c1752a6 4e34ba0d 35b19b04 3222fce5 += 1.234567890123456789e-301 +fI[1] = #3c1752a6 4e34ba0d 35b19b04 3222fce6 += 1.2345678901234567890000000000000002e-301 +fI[0] == strtod + + +Input: 1.234567890123456789e-321 + +strtoQ consumes 25 bytes and returns 17 +with bits = #3bd4f3c2 3699d4db 99d1ea94 2fecd7de +printf("%.35Lg") gives 1.234567890123456789e-321 +g_Qfmt(0) gives 25 bytes: "1.234567890123456789e-321" + +strtoIQ returns 17, consuming 25 bytes. +fI[0] = #3bd4f3c2 3699d4db 99d1ea94 2fecd7de += 1.234567890123456789e-321 +fI[1] = #3bd4f3c2 3699d4db 99d1ea94 2fecd7df += 1.2345678901234567890000000000000001e-321 +fI[0] == strtod + + +Input: 1e23 + +strtoQ consumes 4 bytes and returns 1 +with bits = #404b52d0 2c7e14af 68000000 0 +printf("%.35Lg") gives 100000000000000000000000 +g_Qfmt(0) gives 5 bytes: "1e+23" + +strtoIQ returns 1, consuming 4 bytes. +fI[0] == fI[1] = #404b52d0 2c7e14af 68000000 0 += 100000000000000000000000 + + +Input: 1e310 + +strtoQ consumes 5 bytes and returns 33 +with bits = #4404bd03 c8140697 9e9ff00e fefd4cbd +printf("%.35Lg") gives 1e+310 +g_Qfmt(0) gives 6 bytes: "1e+310" + +strtoIQ returns 33, consuming 5 bytes. +fI[0] = #4404bd03 c8140697 9e9ff00e fefd4cbc += 9.9999999999999999999999999999999992e+309 +fI[1] = #4404bd03 c8140697 9e9ff00e fefd4cbd += 1e+310 +fI[1] == strtod + + +Input: 9.0259718793241475e-277 + +strtoQ consumes 23 bytes and returns 17 +with bits = #3c69ffff ffffffff f9ed5779 ac118fe1 +printf("%.35Lg") gives 9.0259718793241474999999999999999997e-277 +g_Qfmt(0) gives 23 bytes: "9.0259718793241475e-277" + +strtoIQ returns 17, consuming 23 bytes. +fI[0] = #3c69ffff ffffffff f9ed5779 ac118fe1 += 9.0259718793241474999999999999999997e-277 +fI[1] = #3c69ffff ffffffff f9ed5779 ac118fe2 += 9.0259718793241475000000000000000006e-277 +fI[0] == strtod + + +Input: 9.025971879324147880346310405869e-277 + +strtoQ consumes 37 bytes and returns 33 +with bits = #3c6a0000 0 0 9a +printf("%.35Lg") gives 9.0259718793241478803463104058690004e-277 +g_Qfmt(0) gives 37 bytes: "9.025971879324147880346310405869e-277" + +strtoIQ returns 33, consuming 37 bytes. +fI[0] = #3c6a0000 0 0 99 += 9.0259718793241478803463104058689987e-277 +fI[1] = #3c6a0000 0 0 9a += 9.0259718793241478803463104058690004e-277 +fI[1] == strtod + + +Input: 9.025971879324147880346310405868e-277 + +strtoQ consumes 37 bytes and returns 17 +with bits = #3c69ffff ffffffff ffffffff fffffcb5 +printf("%.35Lg") gives 9.025971879324147880346310405868e-277 +g_Qfmt(0) gives 37 bytes: "9.025971879324147880346310405868e-277" + +strtoIQ returns 17, consuming 37 bytes. +fI[0] = #3c69ffff ffffffff ffffffff fffffcb5 += 9.025971879324147880346310405868e-277 +fI[1] = #3c69ffff ffffffff ffffffff fffffcb6 += 9.0259718793241478803463104058680009e-277 +fI[0] == strtod + + +Input: 2.2250738585072014e-308 + +strtoQ consumes 23 bytes and returns 33 +with bits = #3c010000 0 8c304c cf867de0 +printf("%.35Lg") gives 2.2250738585072014000000000000000001e-308 +g_Qfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoIQ returns 33, consuming 23 bytes. +fI[0] = #3c010000 0 8c304c cf867ddf += 2.2250738585072013999999999999999997e-308 +fI[1] = #3c010000 0 8c304c cf867de0 += 2.2250738585072014000000000000000001e-308 +fI[1] == strtod + + +Input: 2.2250738585072013e-308 + +strtoQ consumes 23 bytes and returns 33 +with bits = #3c00ffff ffffffff fa9e4c4f 4c1e8a10 +printf("%.35Lg") gives 2.2250738585072013e-308 +g_Qfmt(0) gives 23 bytes: "2.2250738585072013e-308" + +strtoIQ returns 33, consuming 23 bytes. +fI[0] = #3c00ffff ffffffff fa9e4c4f 4c1e8a0f += 2.2250738585072012999999999999999998e-308 +fI[1] = #3c00ffff ffffffff fa9e4c4f 4c1e8a10 += 2.2250738585072013e-308 +fI[1] == strtod + +Rounding mode for strtor... changed from 1 (nearest) to 0 (toward zero) + +Input: 1.1 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff1999 99999999 99999999 99999999 +printf("%.35Lg") gives 1.0999999999999999999999999999999999 +g_Qfmt(0) gives 36 bytes: "1.0999999999999999999999999999999999" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff1999 99999999 99999999 99999999 += 1.0999999999999999999999999999999999 +fI[1] = #3fff1999 99999999 99999999 9999999a += 1.1000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.1 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff1999 99999999 99999999 99999999 +printf("%.35Lg") gives -1.0999999999999999999999999999999999 +g_Qfmt(0) gives 37 bytes: "-1.0999999999999999999999999999999999" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff1999 99999999 99999999 9999999a += -1.1000000000000000000000000000000001 +fI[1] = #bfff1999 99999999 99999999 99999999 += -1.0999999999999999999999999999999999 +fI[1] == strtod + + +Input: 1.2 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff3333 33333333 33333333 33333333 +printf("%.35Lg") gives 1.2 +g_Qfmt(0) gives 3 bytes: "1.2" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff3333 33333333 33333333 33333333 += 1.2 +fI[1] = #3fff3333 33333333 33333333 33333334 += 1.2000000000000000000000000000000002 +fI[0] == strtod + + +Input: -1.2 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff3333 33333333 33333333 33333333 +printf("%.35Lg") gives -1.2 +g_Qfmt(0) gives 4 bytes: "-1.2" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff3333 33333333 33333333 33333334 += -1.2000000000000000000000000000000002 +fI[1] = #bfff3333 33333333 33333333 33333333 += -1.2 +fI[1] == strtod + + +Input: 1.3 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff4ccc cccccccc cccccccc cccccccc +printf("%.35Lg") gives 1.2999999999999999999999999999999998 +g_Qfmt(0) gives 36 bytes: "1.2999999999999999999999999999999998" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff4ccc cccccccc cccccccc cccccccc += 1.2999999999999999999999999999999998 +fI[1] = #3fff4ccc cccccccc cccccccc cccccccd += 1.3 +fI[0] == strtod + + +Input: -1.3 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff4ccc cccccccc cccccccc cccccccc +printf("%.35Lg") gives -1.2999999999999999999999999999999998 +g_Qfmt(0) gives 37 bytes: "-1.2999999999999999999999999999999998" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff4ccc cccccccc cccccccc cccccccd += -1.3 +fI[1] = #bfff4ccc cccccccc cccccccc cccccccc += -1.2999999999999999999999999999999998 +fI[1] == strtod + + +Input: 1.4 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff6666 66666666 66666666 66666666 +printf("%.35Lg") gives 1.3999999999999999999999999999999999 +g_Qfmt(0) gives 3 bytes: "1.4" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff6666 66666666 66666666 66666666 += 1.3999999999999999999999999999999999 +fI[1] = #3fff6666 66666666 66666666 66666667 += 1.4000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.4 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff6666 66666666 66666666 66666666 +printf("%.35Lg") gives -1.3999999999999999999999999999999999 +g_Qfmt(0) gives 4 bytes: "-1.4" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff6666 66666666 66666666 66666667 += -1.4000000000000000000000000000000001 +fI[1] = #bfff6666 66666666 66666666 66666666 += -1.3999999999999999999999999999999999 +fI[1] == strtod + + +Input: 1.5 + +strtoQ consumes 3 bytes and returns 1 +with bits = #3fff8000 0 0 0 +printf("%.35Lg") gives 1.5 +g_Qfmt(0) gives 3 bytes: "1.5" + +strtoIQ returns 1, consuming 3 bytes. +fI[0] == fI[1] = #3fff8000 0 0 0 += 1.5 + + +Input: -1.5 + +strtoQ consumes 4 bytes and returns 9 +with bits = #bfff8000 0 0 0 +printf("%.35Lg") gives -1.5 +g_Qfmt(0) gives 4 bytes: "-1.5" + +strtoIQ returns 9, consuming 4 bytes. +fI[0] == fI[1] = #bfff8000 0 0 0 += -1.5 + + +Input: 1.6 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff9999 99999999 99999999 99999999 +printf("%.35Lg") gives 1.5999999999999999999999999999999999 +g_Qfmt(0) gives 36 bytes: "1.5999999999999999999999999999999999" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff9999 99999999 99999999 99999999 += 1.5999999999999999999999999999999999 +fI[1] = #3fff9999 99999999 99999999 9999999a += 1.6000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.6 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff9999 99999999 99999999 99999999 +printf("%.35Lg") gives -1.5999999999999999999999999999999999 +g_Qfmt(0) gives 37 bytes: "-1.5999999999999999999999999999999999" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff9999 99999999 99999999 9999999a += -1.6000000000000000000000000000000001 +fI[1] = #bfff9999 99999999 99999999 99999999 += -1.5999999999999999999999999999999999 +fI[1] == strtod + + +Input: 1.7 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffb333 33333333 33333333 33333333 +printf("%.35Lg") gives 1.7 +g_Qfmt(0) gives 3 bytes: "1.7" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffb333 33333333 33333333 33333333 += 1.7 +fI[1] = #3fffb333 33333333 33333333 33333334 += 1.7000000000000000000000000000000002 +fI[0] == strtod + + +Input: -1.7 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffb333 33333333 33333333 33333333 +printf("%.35Lg") gives -1.7 +g_Qfmt(0) gives 4 bytes: "-1.7" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffb333 33333333 33333333 33333334 += -1.7000000000000000000000000000000002 +fI[1] = #bfffb333 33333333 33333333 33333333 += -1.7 +fI[1] == strtod + + +Input: 1.8 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffcccc cccccccc cccccccc cccccccc +printf("%.35Lg") gives 1.7999999999999999999999999999999998 +g_Qfmt(0) gives 36 bytes: "1.7999999999999999999999999999999998" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fffcccc cccccccc cccccccc cccccccc += 1.7999999999999999999999999999999998 +fI[1] = #3fffcccc cccccccc cccccccc cccccccd += 1.8 +fI[0] == strtod + + +Input: -1.8 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffcccc cccccccc cccccccc cccccccc +printf("%.35Lg") gives -1.7999999999999999999999999999999998 +g_Qfmt(0) gives 37 bytes: "-1.7999999999999999999999999999999998" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfffcccc cccccccc cccccccc cccccccd += -1.8 +fI[1] = #bfffcccc cccccccc cccccccc cccccccc += -1.7999999999999999999999999999999998 +fI[1] == strtod + + +Input: 1.9 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffe666 66666666 66666666 66666666 +printf("%.35Lg") gives 1.8999999999999999999999999999999999 +g_Qfmt(0) gives 3 bytes: "1.9" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffe666 66666666 66666666 66666666 += 1.8999999999999999999999999999999999 +fI[1] = #3fffe666 66666666 66666666 66666667 += 1.9000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.9 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffe666 66666666 66666666 66666666 +printf("%.35Lg") gives -1.8999999999999999999999999999999999 +g_Qfmt(0) gives 4 bytes: "-1.9" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffe666 66666666 66666666 66666667 += -1.9000000000000000000000000000000001 +fI[1] = #bfffe666 66666666 66666666 66666666 += -1.8999999999999999999999999999999999 +fI[1] == strtod + +Rounding mode for strtor... changed from 0 (toward zero) to 1 (nearest) + +Input: 1.1 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff1999 99999999 99999999 9999999a +printf("%.35Lg") gives 1.1000000000000000000000000000000001 +g_Qfmt(0) gives 3 bytes: "1.1" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff1999 99999999 99999999 99999999 += 1.0999999999999999999999999999999999 +fI[1] = #3fff1999 99999999 99999999 9999999a += 1.1000000000000000000000000000000001 +fI[1] == strtod + + +Input: -1.1 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff1999 99999999 99999999 9999999a +printf("%.35Lg") gives -1.1000000000000000000000000000000001 +g_Qfmt(0) gives 4 bytes: "-1.1" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff1999 99999999 99999999 9999999a += -1.1000000000000000000000000000000001 +fI[1] = #bfff1999 99999999 99999999 99999999 += -1.0999999999999999999999999999999999 +fI[0] == strtod + + +Input: 1.2 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff3333 33333333 33333333 33333333 +printf("%.35Lg") gives 1.2 +g_Qfmt(0) gives 3 bytes: "1.2" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff3333 33333333 33333333 33333333 += 1.2 +fI[1] = #3fff3333 33333333 33333333 33333334 += 1.2000000000000000000000000000000002 +fI[0] == strtod + + +Input: -1.2 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff3333 33333333 33333333 33333333 +printf("%.35Lg") gives -1.2 +g_Qfmt(0) gives 4 bytes: "-1.2" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff3333 33333333 33333333 33333334 += -1.2000000000000000000000000000000002 +fI[1] = #bfff3333 33333333 33333333 33333333 += -1.2 +fI[1] == strtod + + +Input: 1.3 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff4ccc cccccccc cccccccc cccccccd +printf("%.35Lg") gives 1.3 +g_Qfmt(0) gives 3 bytes: "1.3" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff4ccc cccccccc cccccccc cccccccc += 1.2999999999999999999999999999999998 +fI[1] = #3fff4ccc cccccccc cccccccc cccccccd += 1.3 +fI[1] == strtod + + +Input: -1.3 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff4ccc cccccccc cccccccc cccccccd +printf("%.35Lg") gives -1.3 +g_Qfmt(0) gives 4 bytes: "-1.3" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff4ccc cccccccc cccccccc cccccccd += -1.3 +fI[1] = #bfff4ccc cccccccc cccccccc cccccccc += -1.2999999999999999999999999999999998 +fI[0] == strtod + + +Input: 1.4 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff6666 66666666 66666666 66666666 +printf("%.35Lg") gives 1.3999999999999999999999999999999999 +g_Qfmt(0) gives 3 bytes: "1.4" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff6666 66666666 66666666 66666666 += 1.3999999999999999999999999999999999 +fI[1] = #3fff6666 66666666 66666666 66666667 += 1.4000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.4 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff6666 66666666 66666666 66666666 +printf("%.35Lg") gives -1.3999999999999999999999999999999999 +g_Qfmt(0) gives 4 bytes: "-1.4" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff6666 66666666 66666666 66666667 += -1.4000000000000000000000000000000001 +fI[1] = #bfff6666 66666666 66666666 66666666 += -1.3999999999999999999999999999999999 +fI[1] == strtod + + +Input: 1.5 + +strtoQ consumes 3 bytes and returns 1 +with bits = #3fff8000 0 0 0 +printf("%.35Lg") gives 1.5 +g_Qfmt(0) gives 3 bytes: "1.5" + +strtoIQ returns 1, consuming 3 bytes. +fI[0] == fI[1] = #3fff8000 0 0 0 += 1.5 + + +Input: -1.5 + +strtoQ consumes 4 bytes and returns 9 +with bits = #bfff8000 0 0 0 +printf("%.35Lg") gives -1.5 +g_Qfmt(0) gives 4 bytes: "-1.5" + +strtoIQ returns 9, consuming 4 bytes. +fI[0] == fI[1] = #bfff8000 0 0 0 += -1.5 + + +Input: 1.6 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff9999 99999999 99999999 9999999a +printf("%.35Lg") gives 1.6000000000000000000000000000000001 +g_Qfmt(0) gives 3 bytes: "1.6" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff9999 99999999 99999999 99999999 += 1.5999999999999999999999999999999999 +fI[1] = #3fff9999 99999999 99999999 9999999a += 1.6000000000000000000000000000000001 +fI[1] == strtod + + +Input: -1.6 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff9999 99999999 99999999 9999999a +printf("%.35Lg") gives -1.6000000000000000000000000000000001 +g_Qfmt(0) gives 4 bytes: "-1.6" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff9999 99999999 99999999 9999999a += -1.6000000000000000000000000000000001 +fI[1] = #bfff9999 99999999 99999999 99999999 += -1.5999999999999999999999999999999999 +fI[0] == strtod + + +Input: 1.7 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffb333 33333333 33333333 33333333 +printf("%.35Lg") gives 1.7 +g_Qfmt(0) gives 3 bytes: "1.7" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffb333 33333333 33333333 33333333 += 1.7 +fI[1] = #3fffb333 33333333 33333333 33333334 += 1.7000000000000000000000000000000002 +fI[0] == strtod + + +Input: -1.7 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffb333 33333333 33333333 33333333 +printf("%.35Lg") gives -1.7 +g_Qfmt(0) gives 4 bytes: "-1.7" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffb333 33333333 33333333 33333334 += -1.7000000000000000000000000000000002 +fI[1] = #bfffb333 33333333 33333333 33333333 += -1.7 +fI[1] == strtod + + +Input: 1.8 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fffcccc cccccccc cccccccc cccccccd +printf("%.35Lg") gives 1.8 +g_Qfmt(0) gives 3 bytes: "1.8" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fffcccc cccccccc cccccccc cccccccc += 1.7999999999999999999999999999999998 +fI[1] = #3fffcccc cccccccc cccccccc cccccccd += 1.8 +fI[1] == strtod + + +Input: -1.8 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfffcccc cccccccc cccccccc cccccccd +printf("%.35Lg") gives -1.8 +g_Qfmt(0) gives 4 bytes: "-1.8" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfffcccc cccccccc cccccccc cccccccd += -1.8 +fI[1] = #bfffcccc cccccccc cccccccc cccccccc += -1.7999999999999999999999999999999998 +fI[0] == strtod + + +Input: 1.9 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffe666 66666666 66666666 66666666 +printf("%.35Lg") gives 1.8999999999999999999999999999999999 +g_Qfmt(0) gives 3 bytes: "1.9" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffe666 66666666 66666666 66666666 += 1.8999999999999999999999999999999999 +fI[1] = #3fffe666 66666666 66666666 66666667 += 1.9000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.9 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffe666 66666666 66666666 66666666 +printf("%.35Lg") gives -1.8999999999999999999999999999999999 +g_Qfmt(0) gives 4 bytes: "-1.9" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffe666 66666666 66666666 66666667 += -1.9000000000000000000000000000000001 +fI[1] = #bfffe666 66666666 66666666 66666666 += -1.8999999999999999999999999999999999 +fI[1] == strtod + +Rounding mode for strtor... changed from 1 (nearest) to 2 (toward +Infinity) + +Input: 1.1 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff1999 99999999 99999999 9999999a +printf("%.35Lg") gives 1.1000000000000000000000000000000001 +g_Qfmt(0) gives 3 bytes: "1.1" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff1999 99999999 99999999 99999999 += 1.0999999999999999999999999999999999 +fI[1] = #3fff1999 99999999 99999999 9999999a += 1.1000000000000000000000000000000001 +fI[1] == strtod + + +Input: -1.1 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff1999 99999999 99999999 99999999 +printf("%.35Lg") gives -1.0999999999999999999999999999999999 +g_Qfmt(0) gives 37 bytes: "-1.0999999999999999999999999999999999" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff1999 99999999 99999999 9999999a += -1.1000000000000000000000000000000001 +fI[1] = #bfff1999 99999999 99999999 99999999 += -1.0999999999999999999999999999999999 +fI[1] == strtod + + +Input: 1.2 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff3333 33333333 33333333 33333334 +printf("%.35Lg") gives 1.2000000000000000000000000000000002 +g_Qfmt(0) gives 36 bytes: "1.2000000000000000000000000000000002" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff3333 33333333 33333333 33333333 += 1.2 +fI[1] = #3fff3333 33333333 33333333 33333334 += 1.2000000000000000000000000000000002 +fI[1] == strtod + + +Input: -1.2 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff3333 33333333 33333333 33333333 +printf("%.35Lg") gives -1.2 +g_Qfmt(0) gives 4 bytes: "-1.2" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff3333 33333333 33333333 33333334 += -1.2000000000000000000000000000000002 +fI[1] = #bfff3333 33333333 33333333 33333333 += -1.2 +fI[1] == strtod + + +Input: 1.3 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff4ccc cccccccc cccccccc cccccccd +printf("%.35Lg") gives 1.3 +g_Qfmt(0) gives 3 bytes: "1.3" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff4ccc cccccccc cccccccc cccccccc += 1.2999999999999999999999999999999998 +fI[1] = #3fff4ccc cccccccc cccccccc cccccccd += 1.3 +fI[1] == strtod + + +Input: -1.3 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff4ccc cccccccc cccccccc cccccccc +printf("%.35Lg") gives -1.2999999999999999999999999999999998 +g_Qfmt(0) gives 37 bytes: "-1.2999999999999999999999999999999998" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff4ccc cccccccc cccccccc cccccccd += -1.3 +fI[1] = #bfff4ccc cccccccc cccccccc cccccccc += -1.2999999999999999999999999999999998 +fI[1] == strtod + + +Input: 1.4 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff6666 66666666 66666666 66666667 +printf("%.35Lg") gives 1.4000000000000000000000000000000001 +g_Qfmt(0) gives 36 bytes: "1.4000000000000000000000000000000001" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff6666 66666666 66666666 66666666 += 1.3999999999999999999999999999999999 +fI[1] = #3fff6666 66666666 66666666 66666667 += 1.4000000000000000000000000000000001 +fI[1] == strtod + + +Input: -1.4 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff6666 66666666 66666666 66666666 +printf("%.35Lg") gives -1.3999999999999999999999999999999999 +g_Qfmt(0) gives 4 bytes: "-1.4" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff6666 66666666 66666666 66666667 += -1.4000000000000000000000000000000001 +fI[1] = #bfff6666 66666666 66666666 66666666 += -1.3999999999999999999999999999999999 +fI[1] == strtod + + +Input: 1.5 + +strtoQ consumes 3 bytes and returns 1 +with bits = #3fff8000 0 0 0 +printf("%.35Lg") gives 1.5 +g_Qfmt(0) gives 3 bytes: "1.5" + +strtoIQ returns 1, consuming 3 bytes. +fI[0] == fI[1] = #3fff8000 0 0 0 += 1.5 + + +Input: -1.5 + +strtoQ consumes 4 bytes and returns 9 +with bits = #bfff8000 0 0 0 +printf("%.35Lg") gives -1.5 +g_Qfmt(0) gives 4 bytes: "-1.5" + +strtoIQ returns 9, consuming 4 bytes. +fI[0] == fI[1] = #bfff8000 0 0 0 += -1.5 + + +Input: 1.6 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fff9999 99999999 99999999 9999999a +printf("%.35Lg") gives 1.6000000000000000000000000000000001 +g_Qfmt(0) gives 3 bytes: "1.6" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff9999 99999999 99999999 99999999 += 1.5999999999999999999999999999999999 +fI[1] = #3fff9999 99999999 99999999 9999999a += 1.6000000000000000000000000000000001 +fI[1] == strtod + + +Input: -1.6 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfff9999 99999999 99999999 99999999 +printf("%.35Lg") gives -1.5999999999999999999999999999999999 +g_Qfmt(0) gives 37 bytes: "-1.5999999999999999999999999999999999" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff9999 99999999 99999999 9999999a += -1.6000000000000000000000000000000001 +fI[1] = #bfff9999 99999999 99999999 99999999 += -1.5999999999999999999999999999999999 +fI[1] == strtod + + +Input: 1.7 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fffb333 33333333 33333333 33333334 +printf("%.35Lg") gives 1.7000000000000000000000000000000002 +g_Qfmt(0) gives 36 bytes: "1.7000000000000000000000000000000002" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffb333 33333333 33333333 33333333 += 1.7 +fI[1] = #3fffb333 33333333 33333333 33333334 += 1.7000000000000000000000000000000002 +fI[1] == strtod + + +Input: -1.7 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffb333 33333333 33333333 33333333 +printf("%.35Lg") gives -1.7 +g_Qfmt(0) gives 4 bytes: "-1.7" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffb333 33333333 33333333 33333334 += -1.7000000000000000000000000000000002 +fI[1] = #bfffb333 33333333 33333333 33333333 += -1.7 +fI[1] == strtod + + +Input: 1.8 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fffcccc cccccccc cccccccc cccccccd +printf("%.35Lg") gives 1.8 +g_Qfmt(0) gives 3 bytes: "1.8" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fffcccc cccccccc cccccccc cccccccc += 1.7999999999999999999999999999999998 +fI[1] = #3fffcccc cccccccc cccccccc cccccccd += 1.8 +fI[1] == strtod + + +Input: -1.8 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffcccc cccccccc cccccccc cccccccc +printf("%.35Lg") gives -1.7999999999999999999999999999999998 +g_Qfmt(0) gives 37 bytes: "-1.7999999999999999999999999999999998" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfffcccc cccccccc cccccccc cccccccd += -1.8 +fI[1] = #bfffcccc cccccccc cccccccc cccccccc += -1.7999999999999999999999999999999998 +fI[1] == strtod + + +Input: 1.9 + +strtoQ consumes 3 bytes and returns 33 +with bits = #3fffe666 66666666 66666666 66666667 +printf("%.35Lg") gives 1.9000000000000000000000000000000001 +g_Qfmt(0) gives 36 bytes: "1.9000000000000000000000000000000001" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffe666 66666666 66666666 66666666 += 1.8999999999999999999999999999999999 +fI[1] = #3fffe666 66666666 66666666 66666667 += 1.9000000000000000000000000000000001 +fI[1] == strtod + + +Input: -1.9 + +strtoQ consumes 4 bytes and returns 25 +with bits = #bfffe666 66666666 66666666 66666666 +printf("%.35Lg") gives -1.8999999999999999999999999999999999 +g_Qfmt(0) gives 4 bytes: "-1.9" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffe666 66666666 66666666 66666667 += -1.9000000000000000000000000000000001 +fI[1] = #bfffe666 66666666 66666666 66666666 += -1.8999999999999999999999999999999999 +fI[1] == strtod + +Rounding mode for strtor... changed from 2 (toward +Infinity) to 3 (toward -Infinity) + +Input: 1.1 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff1999 99999999 99999999 99999999 +printf("%.35Lg") gives 1.0999999999999999999999999999999999 +g_Qfmt(0) gives 36 bytes: "1.0999999999999999999999999999999999" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff1999 99999999 99999999 99999999 += 1.0999999999999999999999999999999999 +fI[1] = #3fff1999 99999999 99999999 9999999a += 1.1000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.1 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff1999 99999999 99999999 9999999a +printf("%.35Lg") gives -1.1000000000000000000000000000000001 +g_Qfmt(0) gives 4 bytes: "-1.1" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff1999 99999999 99999999 9999999a += -1.1000000000000000000000000000000001 +fI[1] = #bfff1999 99999999 99999999 99999999 += -1.0999999999999999999999999999999999 +fI[0] == strtod + + +Input: 1.2 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff3333 33333333 33333333 33333333 +printf("%.35Lg") gives 1.2 +g_Qfmt(0) gives 3 bytes: "1.2" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff3333 33333333 33333333 33333333 += 1.2 +fI[1] = #3fff3333 33333333 33333333 33333334 += 1.2000000000000000000000000000000002 +fI[0] == strtod + + +Input: -1.2 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff3333 33333333 33333333 33333334 +printf("%.35Lg") gives -1.2000000000000000000000000000000002 +g_Qfmt(0) gives 37 bytes: "-1.2000000000000000000000000000000002" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff3333 33333333 33333333 33333334 += -1.2000000000000000000000000000000002 +fI[1] = #bfff3333 33333333 33333333 33333333 += -1.2 +fI[0] == strtod + + +Input: 1.3 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff4ccc cccccccc cccccccc cccccccc +printf("%.35Lg") gives 1.2999999999999999999999999999999998 +g_Qfmt(0) gives 36 bytes: "1.2999999999999999999999999999999998" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff4ccc cccccccc cccccccc cccccccc += 1.2999999999999999999999999999999998 +fI[1] = #3fff4ccc cccccccc cccccccc cccccccd += 1.3 +fI[0] == strtod + + +Input: -1.3 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff4ccc cccccccc cccccccc cccccccd +printf("%.35Lg") gives -1.3 +g_Qfmt(0) gives 4 bytes: "-1.3" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff4ccc cccccccc cccccccc cccccccd += -1.3 +fI[1] = #bfff4ccc cccccccc cccccccc cccccccc += -1.2999999999999999999999999999999998 +fI[0] == strtod + + +Input: 1.4 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff6666 66666666 66666666 66666666 +printf("%.35Lg") gives 1.3999999999999999999999999999999999 +g_Qfmt(0) gives 3 bytes: "1.4" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fff6666 66666666 66666666 66666666 += 1.3999999999999999999999999999999999 +fI[1] = #3fff6666 66666666 66666666 66666667 += 1.4000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.4 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff6666 66666666 66666666 66666667 +printf("%.35Lg") gives -1.4000000000000000000000000000000001 +g_Qfmt(0) gives 37 bytes: "-1.4000000000000000000000000000000001" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfff6666 66666666 66666666 66666667 += -1.4000000000000000000000000000000001 +fI[1] = #bfff6666 66666666 66666666 66666666 += -1.3999999999999999999999999999999999 +fI[0] == strtod + + +Input: 1.5 + +strtoQ consumes 3 bytes and returns 1 +with bits = #3fff8000 0 0 0 +printf("%.35Lg") gives 1.5 +g_Qfmt(0) gives 3 bytes: "1.5" + +strtoIQ returns 1, consuming 3 bytes. +fI[0] == fI[1] = #3fff8000 0 0 0 += 1.5 + + +Input: -1.5 + +strtoQ consumes 4 bytes and returns 9 +with bits = #bfff8000 0 0 0 +printf("%.35Lg") gives -1.5 +g_Qfmt(0) gives 4 bytes: "-1.5" + +strtoIQ returns 9, consuming 4 bytes. +fI[0] == fI[1] = #bfff8000 0 0 0 += -1.5 + + +Input: 1.6 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fff9999 99999999 99999999 99999999 +printf("%.35Lg") gives 1.5999999999999999999999999999999999 +g_Qfmt(0) gives 36 bytes: "1.5999999999999999999999999999999999" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fff9999 99999999 99999999 99999999 += 1.5999999999999999999999999999999999 +fI[1] = #3fff9999 99999999 99999999 9999999a += 1.6000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.6 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfff9999 99999999 99999999 9999999a +printf("%.35Lg") gives -1.6000000000000000000000000000000001 +g_Qfmt(0) gives 4 bytes: "-1.6" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfff9999 99999999 99999999 9999999a += -1.6000000000000000000000000000000001 +fI[1] = #bfff9999 99999999 99999999 99999999 += -1.5999999999999999999999999999999999 +fI[0] == strtod + + +Input: 1.7 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffb333 33333333 33333333 33333333 +printf("%.35Lg") gives 1.7 +g_Qfmt(0) gives 3 bytes: "1.7" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffb333 33333333 33333333 33333333 += 1.7 +fI[1] = #3fffb333 33333333 33333333 33333334 += 1.7000000000000000000000000000000002 +fI[0] == strtod + + +Input: -1.7 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfffb333 33333333 33333333 33333334 +printf("%.35Lg") gives -1.7000000000000000000000000000000002 +g_Qfmt(0) gives 37 bytes: "-1.7000000000000000000000000000000002" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffb333 33333333 33333333 33333334 += -1.7000000000000000000000000000000002 +fI[1] = #bfffb333 33333333 33333333 33333333 += -1.7 +fI[0] == strtod + + +Input: 1.8 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffcccc cccccccc cccccccc cccccccc +printf("%.35Lg") gives 1.7999999999999999999999999999999998 +g_Qfmt(0) gives 36 bytes: "1.7999999999999999999999999999999998" + +strtoIQ returns 33, consuming 3 bytes. +fI[0] = #3fffcccc cccccccc cccccccc cccccccc += 1.7999999999999999999999999999999998 +fI[1] = #3fffcccc cccccccc cccccccc cccccccd += 1.8 +fI[0] == strtod + + +Input: -1.8 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfffcccc cccccccc cccccccc cccccccd +printf("%.35Lg") gives -1.8 +g_Qfmt(0) gives 4 bytes: "-1.8" + +strtoIQ returns 41, consuming 4 bytes. +fI[0] = #bfffcccc cccccccc cccccccc cccccccd += -1.8 +fI[1] = #bfffcccc cccccccc cccccccc cccccccc += -1.7999999999999999999999999999999998 +fI[0] == strtod + + +Input: 1.9 + +strtoQ consumes 3 bytes and returns 17 +with bits = #3fffe666 66666666 66666666 66666666 +printf("%.35Lg") gives 1.8999999999999999999999999999999999 +g_Qfmt(0) gives 3 bytes: "1.9" + +strtoIQ returns 17, consuming 3 bytes. +fI[0] = #3fffe666 66666666 66666666 66666666 += 1.8999999999999999999999999999999999 +fI[1] = #3fffe666 66666666 66666666 66666667 += 1.9000000000000000000000000000000001 +fI[0] == strtod + + +Input: -1.9 + +strtoQ consumes 4 bytes and returns 41 +with bits = #bfffe666 66666666 66666666 66666667 +printf("%.35Lg") gives -1.9000000000000000000000000000000001 +g_Qfmt(0) gives 37 bytes: "-1.9000000000000000000000000000000001" + +strtoIQ returns 25, consuming 4 bytes. +fI[0] = #bfffe666 66666666 66666666 66666667 += -1.9000000000000000000000000000000001 +fI[1] = #bfffe666 66666666 66666666 66666666 += -1.8999999999999999999999999999999999 +fI[0] == strtod + diff --git a/contrib/gdtoa/test/Qtest.c b/contrib/gdtoa/test/Qtest.c new file mode 100644 index 0000000..14e5de7 --- /dev/null +++ b/contrib/gdtoa/test/Qtest.c @@ -0,0 +1,170 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +/* Test program for g_Qfmt, strtoIQ, strtopQ, and strtorQ. + * + * Inputs (on stdin): + * r rounding_mode + * n ndig + * number + * #hex0 hex1 hex2 hex3 + * + * rounding_mode values: + * 0 = toward zero + * 1 = nearest + * 2 = toward +Infinity + * 3 = toward -Infinity + * + * where number is a decimal floating-point number, + * hex0 is a string of <= 8 Hex digits for the most significant + * word of the number, hex1 is a similar string for the next + * word, etc., and ndig is a parameters to g_Qfmt. + */ + +#include "gdtoa.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + extern int getround ANSI((int,char*)); + + static char ibuf[2048], obuf[2048]; +#undef _0 +#undef _1 + +/* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */ + +#ifdef IEEE_MC68k +#define _0 0 +#define _1 1 +#define _2 2 +#define _3 3 +#endif +#ifdef IEEE_8087 +#define _0 3 +#define _1 2 +#define _2 1 +#define _3 0 +#endif + +#define U (unsigned long) + + int +main(Void) +{ + char *s, *se, *se1; + int i, dItry, ndig = 0, r = 1; + union { long double d; ULong bits[4]; } u, v[2]; + + while( (s = fgets(ibuf, sizeof(ibuf), stdin)) !=0) { + while(*s <= ' ') + if (!*s++) + continue; + dItry = 0; + switch(*s) { + case 'r': + r = getround(r, s); + continue; + case 'n': + i = s[1]; + if (i <= ' ' || i >= '0' && i <= '9') { + ndig = atoi(s+1); + continue; + } + break; /* nan? */ + case '#': + sscanf(s+1, "%lx %lx %lx %lx", &u.bits[_0], + &u.bits[_1], &u.bits[_2], &u.bits[_3]); + printf("\nInput: %s", ibuf); + printf(" --> f = #%lx %lx %lx %lx\n", u.bits[_0], + u.bits[_1], u.bits[_2], u.bits[_3]); + goto fmt_test; + } + dItry = 1; + printf("\nInput: %s", ibuf); + i = strtorQ(ibuf, &se, r, u.bits); + if (r == 1 && (strtopQ(ibuf,&se1,v[0].bits) != i + || se != se1 || memcmp(u.bits, v[0].bits, 16))) + printf("***strtoQ and strtorQ disagree!!\n:"); + printf("\nstrtoQ consumes %d bytes and returns %d\n", + (int)(se-ibuf), i); + printf("with bits = #%lx %lx %lx %lx\n", + U u.bits[_0], U u.bits[_1], U u.bits[_2], U u.bits[_3]); + fmt_test: + if (sizeof(long double) == 16) + printf("printf(\"%%.35Lg\") gives %.35Lg\n", u.d); + se = g_Qfmt(obuf, u.bits, ndig, sizeof(obuf)); + printf("g_Qfmt(%d) gives %d bytes: \"%s\"\n\n", ndig, + (int)(se-obuf), se ? obuf : "<null>"); + if (!dItry) + continue; + printf("strtoIQ returns %d,", + strtoIQ(ibuf, &se, v[0].bits, v[1].bits)); + printf(" consuming %d bytes.\n", (int)(se-ibuf)); + if (!memcmp(v[0].bits, v[1].bits, 16)) { + if (!memcpy(u.bits, v[0].bits, 16)) + printf("fI[0] == fI[1] == strtoQ\n"); + else { + printf("fI[0] == fI[1] = #%lx %lx %lx %lx\n", + U v[0].bits[_0], U v[0].bits[_1], + U v[0].bits[_2], U v[0].bits[_3]); + if (sizeof(long double) == 16) + printf("= %.35Lg\n", v[0].d); + } + } + else { + printf("fI[0] = #%lx %lx %lx %lx\n", + U v[0].bits[_0], U v[0].bits[_1], + U v[0].bits[_2], U v[0].bits[_3]); + if (sizeof(long double) == 16) + printf("= %.35Lg\n", v[0].d); + printf("fI[1] = #%lx %lx %lx %lx\n", + U v[1].bits[_0], U v[1].bits[_1], + U v[1].bits[_2], U v[1].bits[_3]); + if (sizeof(long double) == 16) + printf("= %.35Lg\n", v[1].d); + if (!memcmp(v[0].bits, u.bits, 16)) + printf("fI[0] == strtod\n"); + else if (!memcmp(v[1].bits, u.bits, 16)) + printf("fI[1] == strtod\n"); + else + printf("**** Both differ from strtod ****\n"); + } + printf("\n"); + } + return 0; + } diff --git a/contrib/gdtoa/test/README b/contrib/gdtoa/test/README new file mode 100644 index 0000000..79b1c91 --- /dev/null +++ b/contrib/gdtoa/test/README @@ -0,0 +1,61 @@ +This directory contains source for several test programs: + +dt is for conversion to/from double; it permits input of pairs of +32-bit hex integers as #hhhhhhhh hhhhhhhh (i.e., the initial '#' +indicates hex input). No initial # ==> decimal input. +After the input number is an optional : mode ndigits +(colon, and decimal integers for parameters "mode" and "ndigits" +to gdtoa). + +Qtest, ddtest, dtest, ftest, xLtest and xtest are for conversion to/from + + f IEEE single precision + d IEEE double precision + xL IEEE extended precision, as on Motorola 680x0 chips + x IEEE extended precision, as on Intel 80x87 chips or + software emulation of Motorola 680x0 chips + Q quad precision, as on Sun Sparc chips + dd double double, pairs of IEEE double numbers + whose sum is the desired value + +They're all similar, except for the precision. They test both +directed roundings and interval input (the strtoI* routines). +Lines that begin with "r" specify or interrogate the desired rounding +direction: + + 0 = toward 0 + 1 = nearest (default) + 2 = toward +Infinity + 3 = toward -Infinity + +These are the FPI_Round_* values in gdota.h. The "r" value is sticky: +it stays in effect til changed. To change the value, give a line that +starts with r followed by 0, 1, 2, or 3. To check the value, give "r" +by itself. + +Lines that begin with n followed by a number specify the ndig +argument for subsequent calls to the relevant g_*fmt routine. + +Lines that start with # followed by the appropriate number of +hexadecimal strings (see the comments) give the big-endian +internal representation of the desired number. + +When routines Qtest, xLtest, and xtest are used on machines whose +long double is of type "quad" (for Qtest) or "extended" (for x*test), +they try to print with %Lg as another way to show binary values. + +Program ddtest also accepts (white-space separated) pairs of decimal +input numbers; it converts both with strtod and feeds the result +to g_ddfmt. + +Program dItest exercises strtodI and strtoId. + +Programs dItestsi and ddtestsi are for testing the sudden-underflow +logic (on double and double-double conversions). + +Program strtodt tests strtod on some hard cases (in file testnos3) +posted by Fred Tydeman to comp.arch.arithmetic on 26 Feb. 1996. + +These are simple test programs, not meant for exhaustive testing, +but for manually testing "interesting" cases. Paxson's testbase +is good for more exhaustive testing, in part with random inputs. diff --git a/contrib/gdtoa/test/d.out b/contrib/gdtoa/test/d.out new file mode 100644 index 0000000..a0ac991 --- /dev/null +++ b/contrib/gdtoa/test/d.out @@ -0,0 +1,986 @@ + +Input: 1.23 +strtod consumes 4 bytes and returns 17 with f = 1.23 = #3ff3ae14 7ae147ae +g_dfmt(0) gives 4 bytes: "1.23" + +strtoId returns 17, consuming 4 bytes. +fI[0] = #3ff3ae14 7ae147ae = 1.23 +fI[1] = #3ff3ae14 7ae147af = 1.2300000000000002 +fI[0] == strtod + + +Input: 1.23e+20 +strtod consumes 8 bytes and returns 1 with f = 1.23e+20 = #441aabdf 2145b430 +g_dfmt(0) gives 8 bytes: "1.23e+20" + +strtoId returns 1, consuming 8 bytes. +fI[0] == fI[1] == strtod + + +Input: 1.23e-20 +strtod consumes 8 bytes and returns 33 with f = 1.2300000000000001e-20 = #3bcd0ae4 cf767531 +g_dfmt(0) gives 8 bytes: "1.23e-20" + +strtoId returns 33, consuming 8 bytes. +fI[0] = #3bcd0ae4 cf767530 = 1.2299999999999999e-20 +fI[1] = #3bcd0ae4 cf767531 = 1.2300000000000001e-20 +fI[1] == strtod + + +Input: 1.23456789 +strtod consumes 10 bytes and returns 17 with f = 1.2345678899999999 = #3ff3c0ca 4283de1b +g_dfmt(0) gives 10 bytes: "1.23456789" + +strtoId returns 17, consuming 10 bytes. +fI[0] = #3ff3c0ca 4283de1b = 1.2345678899999999 +fI[1] = #3ff3c0ca 4283de1c = 1.2345678900000001 +fI[0] == strtod + + +Input: 1.23456589e+20 +strtod consumes 14 bytes and returns 17 with f = 1.23456589e+20 = #441ac537 a660b997 +g_dfmt(0) gives 14 bytes: "1.23456589e+20" + +strtoId returns 17, consuming 14 bytes. +fI[0] = #441ac537 a660b997 = 1.23456589e+20 +fI[1] = #441ac537 a660b998 = 1.2345658900000001e+20 +fI[0] == strtod + + +Input: 1.23e+30 +strtod consumes 8 bytes and returns 17 with f = 1.23e+30 = #462f0cb0 4e8fb790 +g_dfmt(0) gives 8 bytes: "1.23e+30" + +strtoId returns 17, consuming 8 bytes. +fI[0] = #462f0cb0 4e8fb790 = 1.23e+30 +fI[1] = #462f0cb0 4e8fb791 = 1.2300000000000001e+30 +fI[0] == strtod + + +Input: 1.23e-30 +strtod consumes 8 bytes and returns 33 with f = 1.2300000000000001e-30 = #39b8f286 6f5010ab +g_dfmt(0) gives 8 bytes: "1.23e-30" + +strtoId returns 33, consuming 8 bytes. +fI[0] = #39b8f286 6f5010aa = 1.2299999999999999e-30 +fI[1] = #39b8f286 6f5010ab = 1.2300000000000001e-30 +fI[1] == strtod + + +Input: 1.23456789e-20 +strtod consumes 14 bytes and returns 17 with f = 1.2345678899999999e-20 = #3bcd2681 471e7ada +g_dfmt(0) gives 14 bytes: "1.23456789e-20" + +strtoId returns 17, consuming 14 bytes. +fI[0] = #3bcd2681 471e7ada = 1.2345678899999999e-20 +fI[1] = #3bcd2681 471e7adb = 1.2345678900000001e-20 +fI[0] == strtod + + +Input: 1.23456789e-30 +strtod consumes 14 bytes and returns 17 with f = 1.23456789e-30 = #39b90a3e 33bbd995 +g_dfmt(0) gives 14 bytes: "1.23456789e-30" + +strtoId returns 17, consuming 14 bytes. +fI[0] = #39b90a3e 33bbd995 = 1.23456789e-30 +fI[1] = #39b90a3e 33bbd996 = 1.2345678900000002e-30 +fI[0] == strtod + + +Input: 1.234567890123456789 +strtod consumes 20 bytes and returns 17 with f = 1.2345678901234567 = #3ff3c0ca 428c59fb +g_dfmt(0) gives 18 bytes: "1.2345678901234567" + +strtoId returns 17, consuming 20 bytes. +fI[0] = #3ff3c0ca 428c59fb = 1.2345678901234567 +fI[1] = #3ff3c0ca 428c59fc = 1.2345678901234569 +fI[0] == strtod + + +Input: 1.23456789012345678901234567890123456789 +strtod consumes 40 bytes and returns 17 with f = 1.2345678901234567 = #3ff3c0ca 428c59fb +g_dfmt(0) gives 18 bytes: "1.2345678901234567" + +strtoId returns 17, consuming 40 bytes. +fI[0] = #3ff3c0ca 428c59fb = 1.2345678901234567 +fI[1] = #3ff3c0ca 428c59fc = 1.2345678901234569 +fI[0] == strtod + + +Input: 1.23e306 +strtod consumes 8 bytes and returns 33 with f = 1.23e+306 = #7f7c0676 cd1c61f5 +g_dfmt(0) gives 9 bytes: "1.23e+306" + +strtoId returns 33, consuming 8 bytes. +fI[0] = #7f7c0676 cd1c61f4 = 1.2299999999999999e+306 +fI[1] = #7f7c0676 cd1c61f5 = 1.23e+306 +fI[1] == strtod + + +Input: 1.23e-306 +strtod consumes 9 bytes and returns 33 with f = 1.23e-306 = #6ba3b8 5da396e8 +g_dfmt(0) gives 9 bytes: "1.23e-306" + +strtoId returns 33, consuming 9 bytes. +fI[0] = #6ba3b8 5da396e7 = 1.2299999999999999e-306 +fI[1] = #6ba3b8 5da396e8 = 1.23e-306 +fI[1] == strtod + + +Input: 1.23e-320 +strtod consumes 9 bytes and returns 98 with f = 1.2302234581447039e-320 = #0 9ba +g_dfmt(0) gives 9 bytes: "1.23e-320" + +strtoId returns 98, consuming 9 bytes. +fI[0] = #0 9b9 = 1.2297293924988626e-320 +fI[1] = #0 9ba = 1.2302234581447039e-320 +fI[1] == strtod + + +Input: 1.23e-20 +strtod consumes 8 bytes and returns 33 with f = 1.2300000000000001e-20 = #3bcd0ae4 cf767531 +g_dfmt(0) gives 8 bytes: "1.23e-20" + +strtoId returns 33, consuming 8 bytes. +fI[0] = #3bcd0ae4 cf767530 = 1.2299999999999999e-20 +fI[1] = #3bcd0ae4 cf767531 = 1.2300000000000001e-20 +fI[1] == strtod + + +Input: 1.23456789e307 +strtod consumes 14 bytes and returns 33 with f = 1.23456789e+307 = #7fb194b1 4bdaecdc +g_dfmt(0) gives 15 bytes: "1.23456789e+307" + +strtoId returns 33, consuming 14 bytes. +fI[0] = #7fb194b1 4bdaecdb = 1.2345678899999998e+307 +fI[1] = #7fb194b1 4bdaecdc = 1.23456789e+307 +fI[1] == strtod + + +Input: 1.23456589e-307 +strtod consumes 15 bytes and returns 17 with f = 1.2345658899999999e-307 = #363196 bb9845fa +g_dfmt(0) gives 15 bytes: "1.23456589e-307" + +strtoId returns 17, consuming 15 bytes. +fI[0] = #363196 bb9845fa = 1.2345658899999999e-307 +fI[1] = #363196 bb9845fb = 1.2345658900000001e-307 +fI[0] == strtod + + +Input: 1.234567890123456789 +strtod consumes 20 bytes and returns 17 with f = 1.2345678901234567 = #3ff3c0ca 428c59fb +g_dfmt(0) gives 18 bytes: "1.2345678901234567" + +strtoId returns 17, consuming 20 bytes. +fI[0] = #3ff3c0ca 428c59fb = 1.2345678901234567 +fI[1] = #3ff3c0ca 428c59fc = 1.2345678901234569 +fI[0] == strtod + + +Input: 1.234567890123456789e301 +strtod consumes 24 bytes and returns 17 with f = 1.2345678901234568e+301 = #7e726f51 75f56413 +g_dfmt(0) gives 23 bytes: "1.2345678901234568e+301" + +strtoId returns 17, consuming 24 bytes. +fI[0] = #7e726f51 75f56413 = 1.2345678901234568e+301 +fI[1] = #7e726f51 75f56414 = 1.234567890123457e+301 +fI[0] == strtod + + +Input: 1.234567890123456789e-301 +strtod consumes 25 bytes and returns 17 with f = 1.2345678901234567e-301 = #1752a64 e34ba0d3 +g_dfmt(0) gives 23 bytes: "1.2345678901234567e-301" + +strtoId returns 17, consuming 25 bytes. +fI[0] = #1752a64 e34ba0d3 = 1.2345678901234567e-301 +fI[1] = #1752a64 e34ba0d4 = 1.2345678901234569e-301 +fI[0] == strtod + + +Input: 1.234567890123456789e-321 +strtod consumes 25 bytes and returns 98 with f = 1.2351641146031164e-321 = #0 fa +g_dfmt(0) gives 10 bytes: "1.235e-321" + +strtoId returns 98, consuming 25 bytes. +fI[0] = #0 f9 = 1.2302234581447039e-321 +fI[1] = #0 fa = 1.2351641146031164e-321 +fI[1] == strtod + + +Input: 1e23 +strtod consumes 4 bytes and returns 17 with f = 9.9999999999999992e+22 = #44b52d02 c7e14af6 +g_dfmt(0) gives 5 bytes: "1e+23" + +strtoId returns 17, consuming 4 bytes. +fI[0] = #44b52d02 c7e14af6 = 9.9999999999999992e+22 +fI[1] = #44b52d02 c7e14af7 = 1.0000000000000001e+23 +fI[0] == strtod + + +Input: 1e310 +strtod consumes 5 bytes and returns 163 with f = Infinity = #7ff00000 0 +g_dfmt(0) gives 8 bytes: "Infinity" + +strtoId returns 163, consuming 5 bytes. +fI[0] = #7fefffff ffffffff = 1.7976931348623157e+308 +fI[1] = #7ff00000 0 = Infinity +fI[1] == strtod + + +Input: 9.0259718793241475e-277 +strtod consumes 23 bytes and returns 33 with f = 9.0259718793241479e-277 = #6a00000 0 +g_dfmt(0) gives 22 bytes: "9.025971879324148e-277" + +strtoId returns 33, consuming 23 bytes. +fI[0] = #69fffff ffffffff = 9.0259718793241469e-277 +fI[1] = #6a00000 0 = 9.0259718793241479e-277 +fI[1] == strtod + + +Input: 9.025971879324147880346310405869e-277 +strtod consumes 37 bytes and returns 17 with f = 9.0259718793241479e-277 = #6a00000 0 +g_dfmt(0) gives 22 bytes: "9.025971879324148e-277" + +strtoId returns 17, consuming 37 bytes. +fI[0] = #6a00000 0 = 9.0259718793241479e-277 +fI[1] = #6a00000 1 = 9.0259718793241499e-277 +fI[0] == strtod + + +Input: 9.025971879324147880346310405868e-277 +strtod consumes 37 bytes and returns 33 with f = 9.0259718793241479e-277 = #6a00000 0 +g_dfmt(0) gives 22 bytes: "9.025971879324148e-277" + +strtoId returns 33, consuming 37 bytes. +fI[0] = #69fffff ffffffff = 9.0259718793241469e-277 +fI[1] = #6a00000 0 = 9.0259718793241479e-277 +fI[1] == strtod + + +Input: 2.2250738585072014e-308 +strtod consumes 23 bytes and returns 17 with f = 2.2250738585072014e-308 = #100000 0 +g_dfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoId returns 17, consuming 23 bytes. +fI[0] = #100000 0 = 2.2250738585072014e-308 +fI[1] = #100000 1 = 2.2250738585072019e-308 +fI[0] == strtod + + +Input: 2.2250738585072013e-308 +strtod consumes 23 bytes and returns 33 with f = 2.2250738585072014e-308 = #100000 0 +g_dfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoId returns 33, consuming 23 bytes. +fI[0] = #fffff ffffffff = 2.2250738585072009e-308 +fI[1] = #100000 0 = 2.2250738585072014e-308 +fI[1] == strtod + +Rounding mode for strtor... changed from 1 (nearest) to 0 (toward zero) + +Input: 1.1 +strtod consumes 3 bytes and returns 17 with f = 1.0999999999999999 = #3ff19999 99999999 +g_dfmt(0) gives 18 bytes: "1.0999999999999999" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff19999 99999999 = 1.0999999999999999 +fI[1] = #3ff19999 9999999a = 1.1000000000000001 +fI[0] == strtod + + +Input: -1.1 +strtod consumes 4 bytes and returns 25 with f = -1.0999999999999999 = #bff19999 99999999 +g_dfmt(0) gives 19 bytes: "-1.0999999999999999" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff19999 9999999a = -1.1000000000000001 +fI[1] = #bff19999 99999999 = -1.0999999999999999 +fI[1] == strtod + + +Input: 1.2 +strtod consumes 3 bytes and returns 17 with f = 1.2 = #3ff33333 33333333 +g_dfmt(0) gives 3 bytes: "1.2" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ff33333 33333333 = 1.2 +fI[1] = #3ff33333 33333334 = 1.2000000000000002 +fI[0] == strtod + + +Input: -1.2 +strtod consumes 4 bytes and returns 25 with f = -1.2 = #bff33333 33333333 +g_dfmt(0) gives 4 bytes: "-1.2" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bff33333 33333334 = -1.2000000000000002 +fI[1] = #bff33333 33333333 = -1.2 +fI[1] == strtod + + +Input: 1.3 +strtod consumes 3 bytes and returns 17 with f = 1.2999999999999998 = #3ff4cccc cccccccc +g_dfmt(0) gives 18 bytes: "1.2999999999999998" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff4cccc cccccccc = 1.2999999999999998 +fI[1] = #3ff4cccc cccccccd = 1.3 +fI[0] == strtod + + +Input: -1.3 +strtod consumes 4 bytes and returns 25 with f = -1.2999999999999998 = #bff4cccc cccccccc +g_dfmt(0) gives 19 bytes: "-1.2999999999999998" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff4cccc cccccccd = -1.3 +fI[1] = #bff4cccc cccccccc = -1.2999999999999998 +fI[1] == strtod + + +Input: 1.4 +strtod consumes 3 bytes and returns 17 with f = 1.3999999999999999 = #3ff66666 66666666 +g_dfmt(0) gives 3 bytes: "1.4" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ff66666 66666666 = 1.3999999999999999 +fI[1] = #3ff66666 66666667 = 1.4000000000000001 +fI[0] == strtod + + +Input: -1.4 +strtod consumes 4 bytes and returns 25 with f = -1.3999999999999999 = #bff66666 66666666 +g_dfmt(0) gives 4 bytes: "-1.4" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bff66666 66666667 = -1.4000000000000001 +fI[1] = #bff66666 66666666 = -1.3999999999999999 +fI[1] == strtod + + +Input: 1.5 +strtod consumes 3 bytes and returns 1 with f = 1.5 = #3ff80000 0 +g_dfmt(0) gives 3 bytes: "1.5" + +strtoId returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtod + + +Input: -1.5 +strtod consumes 4 bytes and returns 9 with f = -1.5 = #bff80000 0 +g_dfmt(0) gives 4 bytes: "-1.5" + +strtoId returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtod + + +Input: 1.6 +strtod consumes 3 bytes and returns 17 with f = 1.5999999999999999 = #3ff99999 99999999 +g_dfmt(0) gives 18 bytes: "1.5999999999999999" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff99999 99999999 = 1.5999999999999999 +fI[1] = #3ff99999 9999999a = 1.6000000000000001 +fI[0] == strtod + + +Input: -1.6 +strtod consumes 4 bytes and returns 25 with f = -1.5999999999999999 = #bff99999 99999999 +g_dfmt(0) gives 19 bytes: "-1.5999999999999999" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff99999 9999999a = -1.6000000000000001 +fI[1] = #bff99999 99999999 = -1.5999999999999999 +fI[1] == strtod + + +Input: 1.7 +strtod consumes 3 bytes and returns 17 with f = 1.7 = #3ffb3333 33333333 +g_dfmt(0) gives 3 bytes: "1.7" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ffb3333 33333333 = 1.7 +fI[1] = #3ffb3333 33333334 = 1.7000000000000002 +fI[0] == strtod + + +Input: -1.7 +strtod consumes 4 bytes and returns 25 with f = -1.7 = #bffb3333 33333333 +g_dfmt(0) gives 4 bytes: "-1.7" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bffb3333 33333334 = -1.7000000000000002 +fI[1] = #bffb3333 33333333 = -1.7 +fI[1] == strtod + + +Input: 1.8 +strtod consumes 3 bytes and returns 17 with f = 1.7999999999999998 = #3ffccccc cccccccc +g_dfmt(0) gives 18 bytes: "1.7999999999999998" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ffccccc cccccccc = 1.7999999999999998 +fI[1] = #3ffccccc cccccccd = 1.8 +fI[0] == strtod + + +Input: -1.8 +strtod consumes 4 bytes and returns 25 with f = -1.7999999999999998 = #bffccccc cccccccc +g_dfmt(0) gives 19 bytes: "-1.7999999999999998" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bffccccc cccccccd = -1.8 +fI[1] = #bffccccc cccccccc = -1.7999999999999998 +fI[1] == strtod + + +Input: 1.9 +strtod consumes 3 bytes and returns 17 with f = 1.8999999999999999 = #3ffe6666 66666666 +g_dfmt(0) gives 3 bytes: "1.9" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ffe6666 66666666 = 1.8999999999999999 +fI[1] = #3ffe6666 66666667 = 1.9000000000000001 +fI[0] == strtod + + +Input: -1.9 +strtod consumes 4 bytes and returns 25 with f = -1.8999999999999999 = #bffe6666 66666666 +g_dfmt(0) gives 4 bytes: "-1.9" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bffe6666 66666667 = -1.9000000000000001 +fI[1] = #bffe6666 66666666 = -1.8999999999999999 +fI[1] == strtod + +Rounding mode for strtor... changed from 0 (toward zero) to 1 (nearest) + +Input: 1.1 +strtod consumes 3 bytes and returns 33 with f = 1.1000000000000001 = #3ff19999 9999999a +g_dfmt(0) gives 3 bytes: "1.1" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff19999 99999999 = 1.0999999999999999 +fI[1] = #3ff19999 9999999a = 1.1000000000000001 +fI[1] == strtod + + +Input: -1.1 +strtod consumes 4 bytes and returns 41 with f = -1.1000000000000001 = #bff19999 9999999a +g_dfmt(0) gives 4 bytes: "-1.1" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff19999 9999999a = -1.1000000000000001 +fI[1] = #bff19999 99999999 = -1.0999999999999999 +fI[0] == strtod + + +Input: 1.2 +strtod consumes 3 bytes and returns 17 with f = 1.2 = #3ff33333 33333333 +g_dfmt(0) gives 3 bytes: "1.2" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ff33333 33333333 = 1.2 +fI[1] = #3ff33333 33333334 = 1.2000000000000002 +fI[0] == strtod + + +Input: -1.2 +strtod consumes 4 bytes and returns 25 with f = -1.2 = #bff33333 33333333 +g_dfmt(0) gives 4 bytes: "-1.2" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bff33333 33333334 = -1.2000000000000002 +fI[1] = #bff33333 33333333 = -1.2 +fI[1] == strtod + + +Input: 1.3 +strtod consumes 3 bytes and returns 33 with f = 1.3 = #3ff4cccc cccccccd +g_dfmt(0) gives 3 bytes: "1.3" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff4cccc cccccccc = 1.2999999999999998 +fI[1] = #3ff4cccc cccccccd = 1.3 +fI[1] == strtod + + +Input: -1.3 +strtod consumes 4 bytes and returns 41 with f = -1.3 = #bff4cccc cccccccd +g_dfmt(0) gives 4 bytes: "-1.3" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff4cccc cccccccd = -1.3 +fI[1] = #bff4cccc cccccccc = -1.2999999999999998 +fI[0] == strtod + + +Input: 1.4 +strtod consumes 3 bytes and returns 17 with f = 1.3999999999999999 = #3ff66666 66666666 +g_dfmt(0) gives 3 bytes: "1.4" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ff66666 66666666 = 1.3999999999999999 +fI[1] = #3ff66666 66666667 = 1.4000000000000001 +fI[0] == strtod + + +Input: -1.4 +strtod consumes 4 bytes and returns 25 with f = -1.3999999999999999 = #bff66666 66666666 +g_dfmt(0) gives 4 bytes: "-1.4" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bff66666 66666667 = -1.4000000000000001 +fI[1] = #bff66666 66666666 = -1.3999999999999999 +fI[1] == strtod + + +Input: 1.5 +strtod consumes 3 bytes and returns 1 with f = 1.5 = #3ff80000 0 +g_dfmt(0) gives 3 bytes: "1.5" + +strtoId returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtod + + +Input: -1.5 +strtod consumes 4 bytes and returns 9 with f = -1.5 = #bff80000 0 +g_dfmt(0) gives 4 bytes: "-1.5" + +strtoId returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtod + + +Input: 1.6 +strtod consumes 3 bytes and returns 33 with f = 1.6000000000000001 = #3ff99999 9999999a +g_dfmt(0) gives 3 bytes: "1.6" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff99999 99999999 = 1.5999999999999999 +fI[1] = #3ff99999 9999999a = 1.6000000000000001 +fI[1] == strtod + + +Input: -1.6 +strtod consumes 4 bytes and returns 41 with f = -1.6000000000000001 = #bff99999 9999999a +g_dfmt(0) gives 4 bytes: "-1.6" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff99999 9999999a = -1.6000000000000001 +fI[1] = #bff99999 99999999 = -1.5999999999999999 +fI[0] == strtod + + +Input: 1.7 +strtod consumes 3 bytes and returns 17 with f = 1.7 = #3ffb3333 33333333 +g_dfmt(0) gives 3 bytes: "1.7" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ffb3333 33333333 = 1.7 +fI[1] = #3ffb3333 33333334 = 1.7000000000000002 +fI[0] == strtod + + +Input: -1.7 +strtod consumes 4 bytes and returns 25 with f = -1.7 = #bffb3333 33333333 +g_dfmt(0) gives 4 bytes: "-1.7" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bffb3333 33333334 = -1.7000000000000002 +fI[1] = #bffb3333 33333333 = -1.7 +fI[1] == strtod + + +Input: 1.8 +strtod consumes 3 bytes and returns 33 with f = 1.8 = #3ffccccc cccccccd +g_dfmt(0) gives 3 bytes: "1.8" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ffccccc cccccccc = 1.7999999999999998 +fI[1] = #3ffccccc cccccccd = 1.8 +fI[1] == strtod + + +Input: -1.8 +strtod consumes 4 bytes and returns 41 with f = -1.8 = #bffccccc cccccccd +g_dfmt(0) gives 4 bytes: "-1.8" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bffccccc cccccccd = -1.8 +fI[1] = #bffccccc cccccccc = -1.7999999999999998 +fI[0] == strtod + + +Input: 1.9 +strtod consumes 3 bytes and returns 17 with f = 1.8999999999999999 = #3ffe6666 66666666 +g_dfmt(0) gives 3 bytes: "1.9" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ffe6666 66666666 = 1.8999999999999999 +fI[1] = #3ffe6666 66666667 = 1.9000000000000001 +fI[0] == strtod + + +Input: -1.9 +strtod consumes 4 bytes and returns 25 with f = -1.8999999999999999 = #bffe6666 66666666 +g_dfmt(0) gives 4 bytes: "-1.9" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bffe6666 66666667 = -1.9000000000000001 +fI[1] = #bffe6666 66666666 = -1.8999999999999999 +fI[1] == strtod + +Rounding mode for strtor... changed from 1 (nearest) to 2 (toward +Infinity) + +Input: 1.1 +strtod consumes 3 bytes and returns 33 with f = 1.1000000000000001 = #3ff19999 9999999a +g_dfmt(0) gives 3 bytes: "1.1" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff19999 99999999 = 1.0999999999999999 +fI[1] = #3ff19999 9999999a = 1.1000000000000001 +fI[1] == strtod + + +Input: -1.1 +strtod consumes 4 bytes and returns 25 with f = -1.0999999999999999 = #bff19999 99999999 +g_dfmt(0) gives 19 bytes: "-1.0999999999999999" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff19999 9999999a = -1.1000000000000001 +fI[1] = #bff19999 99999999 = -1.0999999999999999 +fI[1] == strtod + + +Input: 1.2 +strtod consumes 3 bytes and returns 33 with f = 1.2000000000000002 = #3ff33333 33333334 +g_dfmt(0) gives 18 bytes: "1.2000000000000002" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ff33333 33333333 = 1.2 +fI[1] = #3ff33333 33333334 = 1.2000000000000002 +fI[1] == strtod + + +Input: -1.2 +strtod consumes 4 bytes and returns 25 with f = -1.2 = #bff33333 33333333 +g_dfmt(0) gives 4 bytes: "-1.2" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bff33333 33333334 = -1.2000000000000002 +fI[1] = #bff33333 33333333 = -1.2 +fI[1] == strtod + + +Input: 1.3 +strtod consumes 3 bytes and returns 33 with f = 1.3 = #3ff4cccc cccccccd +g_dfmt(0) gives 3 bytes: "1.3" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff4cccc cccccccc = 1.2999999999999998 +fI[1] = #3ff4cccc cccccccd = 1.3 +fI[1] == strtod + + +Input: -1.3 +strtod consumes 4 bytes and returns 25 with f = -1.2999999999999998 = #bff4cccc cccccccc +g_dfmt(0) gives 19 bytes: "-1.2999999999999998" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff4cccc cccccccd = -1.3 +fI[1] = #bff4cccc cccccccc = -1.2999999999999998 +fI[1] == strtod + + +Input: 1.4 +strtod consumes 3 bytes and returns 33 with f = 1.4000000000000001 = #3ff66666 66666667 +g_dfmt(0) gives 18 bytes: "1.4000000000000001" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ff66666 66666666 = 1.3999999999999999 +fI[1] = #3ff66666 66666667 = 1.4000000000000001 +fI[1] == strtod + + +Input: -1.4 +strtod consumes 4 bytes and returns 25 with f = -1.3999999999999999 = #bff66666 66666666 +g_dfmt(0) gives 4 bytes: "-1.4" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bff66666 66666667 = -1.4000000000000001 +fI[1] = #bff66666 66666666 = -1.3999999999999999 +fI[1] == strtod + + +Input: 1.5 +strtod consumes 3 bytes and returns 1 with f = 1.5 = #3ff80000 0 +g_dfmt(0) gives 3 bytes: "1.5" + +strtoId returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtod + + +Input: -1.5 +strtod consumes 4 bytes and returns 9 with f = -1.5 = #bff80000 0 +g_dfmt(0) gives 4 bytes: "-1.5" + +strtoId returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtod + + +Input: 1.6 +strtod consumes 3 bytes and returns 33 with f = 1.6000000000000001 = #3ff99999 9999999a +g_dfmt(0) gives 3 bytes: "1.6" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff99999 99999999 = 1.5999999999999999 +fI[1] = #3ff99999 9999999a = 1.6000000000000001 +fI[1] == strtod + + +Input: -1.6 +strtod consumes 4 bytes and returns 25 with f = -1.5999999999999999 = #bff99999 99999999 +g_dfmt(0) gives 19 bytes: "-1.5999999999999999" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff99999 9999999a = -1.6000000000000001 +fI[1] = #bff99999 99999999 = -1.5999999999999999 +fI[1] == strtod + + +Input: 1.7 +strtod consumes 3 bytes and returns 33 with f = 1.7000000000000002 = #3ffb3333 33333334 +g_dfmt(0) gives 18 bytes: "1.7000000000000002" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ffb3333 33333333 = 1.7 +fI[1] = #3ffb3333 33333334 = 1.7000000000000002 +fI[1] == strtod + + +Input: -1.7 +strtod consumes 4 bytes and returns 25 with f = -1.7 = #bffb3333 33333333 +g_dfmt(0) gives 4 bytes: "-1.7" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bffb3333 33333334 = -1.7000000000000002 +fI[1] = #bffb3333 33333333 = -1.7 +fI[1] == strtod + + +Input: 1.8 +strtod consumes 3 bytes and returns 33 with f = 1.8 = #3ffccccc cccccccd +g_dfmt(0) gives 3 bytes: "1.8" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ffccccc cccccccc = 1.7999999999999998 +fI[1] = #3ffccccc cccccccd = 1.8 +fI[1] == strtod + + +Input: -1.8 +strtod consumes 4 bytes and returns 25 with f = -1.7999999999999998 = #bffccccc cccccccc +g_dfmt(0) gives 19 bytes: "-1.7999999999999998" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bffccccc cccccccd = -1.8 +fI[1] = #bffccccc cccccccc = -1.7999999999999998 +fI[1] == strtod + + +Input: 1.9 +strtod consumes 3 bytes and returns 33 with f = 1.9000000000000001 = #3ffe6666 66666667 +g_dfmt(0) gives 18 bytes: "1.9000000000000001" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ffe6666 66666666 = 1.8999999999999999 +fI[1] = #3ffe6666 66666667 = 1.9000000000000001 +fI[1] == strtod + + +Input: -1.9 +strtod consumes 4 bytes and returns 25 with f = -1.8999999999999999 = #bffe6666 66666666 +g_dfmt(0) gives 4 bytes: "-1.9" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bffe6666 66666667 = -1.9000000000000001 +fI[1] = #bffe6666 66666666 = -1.8999999999999999 +fI[1] == strtod + +Rounding mode for strtor... changed from 2 (toward +Infinity) to 3 (toward -Infinity) + +Input: 1.1 +strtod consumes 3 bytes and returns 17 with f = 1.0999999999999999 = #3ff19999 99999999 +g_dfmt(0) gives 18 bytes: "1.0999999999999999" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff19999 99999999 = 1.0999999999999999 +fI[1] = #3ff19999 9999999a = 1.1000000000000001 +fI[0] == strtod + + +Input: -1.1 +strtod consumes 4 bytes and returns 41 with f = -1.1000000000000001 = #bff19999 9999999a +g_dfmt(0) gives 4 bytes: "-1.1" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff19999 9999999a = -1.1000000000000001 +fI[1] = #bff19999 99999999 = -1.0999999999999999 +fI[0] == strtod + + +Input: 1.2 +strtod consumes 3 bytes and returns 17 with f = 1.2 = #3ff33333 33333333 +g_dfmt(0) gives 3 bytes: "1.2" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ff33333 33333333 = 1.2 +fI[1] = #3ff33333 33333334 = 1.2000000000000002 +fI[0] == strtod + + +Input: -1.2 +strtod consumes 4 bytes and returns 41 with f = -1.2000000000000002 = #bff33333 33333334 +g_dfmt(0) gives 19 bytes: "-1.2000000000000002" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bff33333 33333334 = -1.2000000000000002 +fI[1] = #bff33333 33333333 = -1.2 +fI[0] == strtod + + +Input: 1.3 +strtod consumes 3 bytes and returns 17 with f = 1.2999999999999998 = #3ff4cccc cccccccc +g_dfmt(0) gives 18 bytes: "1.2999999999999998" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff4cccc cccccccc = 1.2999999999999998 +fI[1] = #3ff4cccc cccccccd = 1.3 +fI[0] == strtod + + +Input: -1.3 +strtod consumes 4 bytes and returns 41 with f = -1.3 = #bff4cccc cccccccd +g_dfmt(0) gives 4 bytes: "-1.3" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff4cccc cccccccd = -1.3 +fI[1] = #bff4cccc cccccccc = -1.2999999999999998 +fI[0] == strtod + + +Input: 1.4 +strtod consumes 3 bytes and returns 17 with f = 1.3999999999999999 = #3ff66666 66666666 +g_dfmt(0) gives 3 bytes: "1.4" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ff66666 66666666 = 1.3999999999999999 +fI[1] = #3ff66666 66666667 = 1.4000000000000001 +fI[0] == strtod + + +Input: -1.4 +strtod consumes 4 bytes and returns 41 with f = -1.4000000000000001 = #bff66666 66666667 +g_dfmt(0) gives 19 bytes: "-1.4000000000000001" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bff66666 66666667 = -1.4000000000000001 +fI[1] = #bff66666 66666666 = -1.3999999999999999 +fI[0] == strtod + + +Input: 1.5 +strtod consumes 3 bytes and returns 1 with f = 1.5 = #3ff80000 0 +g_dfmt(0) gives 3 bytes: "1.5" + +strtoId returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtod + + +Input: -1.5 +strtod consumes 4 bytes and returns 9 with f = -1.5 = #bff80000 0 +g_dfmt(0) gives 4 bytes: "-1.5" + +strtoId returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtod + + +Input: 1.6 +strtod consumes 3 bytes and returns 17 with f = 1.5999999999999999 = #3ff99999 99999999 +g_dfmt(0) gives 18 bytes: "1.5999999999999999" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ff99999 99999999 = 1.5999999999999999 +fI[1] = #3ff99999 9999999a = 1.6000000000000001 +fI[0] == strtod + + +Input: -1.6 +strtod consumes 4 bytes and returns 41 with f = -1.6000000000000001 = #bff99999 9999999a +g_dfmt(0) gives 4 bytes: "-1.6" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bff99999 9999999a = -1.6000000000000001 +fI[1] = #bff99999 99999999 = -1.5999999999999999 +fI[0] == strtod + + +Input: 1.7 +strtod consumes 3 bytes and returns 17 with f = 1.7 = #3ffb3333 33333333 +g_dfmt(0) gives 3 bytes: "1.7" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ffb3333 33333333 = 1.7 +fI[1] = #3ffb3333 33333334 = 1.7000000000000002 +fI[0] == strtod + + +Input: -1.7 +strtod consumes 4 bytes and returns 41 with f = -1.7000000000000002 = #bffb3333 33333334 +g_dfmt(0) gives 19 bytes: "-1.7000000000000002" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bffb3333 33333334 = -1.7000000000000002 +fI[1] = #bffb3333 33333333 = -1.7 +fI[0] == strtod + + +Input: 1.8 +strtod consumes 3 bytes and returns 17 with f = 1.7999999999999998 = #3ffccccc cccccccc +g_dfmt(0) gives 18 bytes: "1.7999999999999998" + +strtoId returns 33, consuming 3 bytes. +fI[0] = #3ffccccc cccccccc = 1.7999999999999998 +fI[1] = #3ffccccc cccccccd = 1.8 +fI[0] == strtod + + +Input: -1.8 +strtod consumes 4 bytes and returns 41 with f = -1.8 = #bffccccc cccccccd +g_dfmt(0) gives 4 bytes: "-1.8" + +strtoId returns 41, consuming 4 bytes. +fI[0] = #bffccccc cccccccd = -1.8 +fI[1] = #bffccccc cccccccc = -1.7999999999999998 +fI[0] == strtod + + +Input: 1.9 +strtod consumes 3 bytes and returns 17 with f = 1.8999999999999999 = #3ffe6666 66666666 +g_dfmt(0) gives 3 bytes: "1.9" + +strtoId returns 17, consuming 3 bytes. +fI[0] = #3ffe6666 66666666 = 1.8999999999999999 +fI[1] = #3ffe6666 66666667 = 1.9000000000000001 +fI[0] == strtod + + +Input: -1.9 +strtod consumes 4 bytes and returns 41 with f = -1.9000000000000001 = #bffe6666 66666667 +g_dfmt(0) gives 19 bytes: "-1.9000000000000001" + +strtoId returns 25, consuming 4 bytes. +fI[0] = #bffe6666 66666667 = -1.9000000000000001 +fI[1] = #bffe6666 66666666 = -1.8999999999999999 +fI[0] == strtod + diff --git a/contrib/gdtoa/test/dI.out b/contrib/gdtoa/test/dI.out new file mode 100644 index 0000000..b4070de --- /dev/null +++ b/contrib/gdtoa/test/dI.out @@ -0,0 +1,168 @@ + +Input: 1.23 +strtodI consumes 4 bytes and returns 17 +dd[0] = #3ff3ae14 7ae147ae = 1.23 +dd[1] = #3ff3ae14 7ae147af = 1.2300000000000002 + + +Input: 1.23e+20 +strtodI consumes 8 bytes and returns 1 +dd[0] = #441aabdf 2145b430 = 1.23e+20 +dd[1] = #441aabdf 2145b430 = 1.23e+20 + + +Input: 1.23e-20 +strtodI consumes 8 bytes and returns 33 +dd[0] = #3bcd0ae4 cf767530 = 1.2299999999999999e-20 +dd[1] = #3bcd0ae4 cf767531 = 1.23e-20 + + +Input: 1.23456789 +strtodI consumes 10 bytes and returns 17 +dd[0] = #3ff3c0ca 4283de1b = 1.23456789 +dd[1] = #3ff3c0ca 4283de1c = 1.2345678900000001 + + +Input: 1.23456589e+20 +strtodI consumes 14 bytes and returns 17 +dd[0] = #441ac537 a660b997 = 1.23456589e+20 +dd[1] = #441ac537 a660b998 = 123456589000000010000 + + +Input: 1.23e+30 +strtodI consumes 8 bytes and returns 17 +dd[0] = #462f0cb0 4e8fb790 = 1.23e+30 +dd[1] = #462f0cb0 4e8fb791 = 1.2300000000000001e+30 + + +Input: 1.23e-30 +strtodI consumes 8 bytes and returns 33 +dd[0] = #39b8f286 6f5010aa = 1.2299999999999999e-30 +dd[1] = #39b8f286 6f5010ab = 1.23e-30 + + +Input: 1.23456789e-20 +strtodI consumes 14 bytes and returns 17 +dd[0] = #3bcd2681 471e7ada = 1.23456789e-20 +dd[1] = #3bcd2681 471e7adb = 1.2345678900000001e-20 + + +Input: 1.23456789e-30 +strtodI consumes 14 bytes and returns 17 +dd[0] = #39b90a3e 33bbd995 = 1.23456789e-30 +dd[1] = #39b90a3e 33bbd996 = 1.2345678900000002e-30 + + +Input: 1.234567890123456789 +strtodI consumes 20 bytes and returns 17 +dd[0] = #3ff3c0ca 428c59fb = 1.2345678901234567 +dd[1] = #3ff3c0ca 428c59fc = 1.234567890123457 + + +Input: 1.23456789012345678901234567890123456789 +strtodI consumes 40 bytes and returns 17 +dd[0] = #3ff3c0ca 428c59fb = 1.2345678901234567 +dd[1] = #3ff3c0ca 428c59fc = 1.234567890123457 + + +Input: 1.23e306 +strtodI consumes 8 bytes and returns 33 +dd[0] = #7f7c0676 cd1c61f4 = 1.2299999999999999e+306 +dd[1] = #7f7c0676 cd1c61f5 = 1.23e+306 + + +Input: 1.23e-306 +strtodI consumes 9 bytes and returns 33 +dd[0] = #6ba3b8 5da396e7 = 1.2299999999999999e-306 +dd[1] = #6ba3b8 5da396e8 = 1.23e-306 + + +Input: 1.23e-320 +strtodI consumes 9 bytes and returns 98 +dd[0] = #0 9b9 = 1.2297e-320 +dd[1] = #0 9ba = 1.23e-320 + + +Input: 1.23e-20 +strtodI consumes 8 bytes and returns 33 +dd[0] = #3bcd0ae4 cf767530 = 1.2299999999999999e-20 +dd[1] = #3bcd0ae4 cf767531 = 1.23e-20 + + +Input: 1.23456789e307 +strtodI consumes 14 bytes and returns 33 +dd[0] = #7fb194b1 4bdaecdb = 1.2345678899999998e+307 +dd[1] = #7fb194b1 4bdaecdc = 1.23456789e+307 + + +Input: 1.23456589e-307 +strtodI consumes 15 bytes and returns 17 +dd[0] = #363196 bb9845fa = 1.23456589e-307 +dd[1] = #363196 bb9845fb = 1.2345658900000001e-307 + + +Input: 1.234567890123456789 +strtodI consumes 20 bytes and returns 17 +dd[0] = #3ff3c0ca 428c59fb = 1.2345678901234567 +dd[1] = #3ff3c0ca 428c59fc = 1.234567890123457 + + +Input: 1.234567890123456789e301 +strtodI consumes 24 bytes and returns 17 +dd[0] = #7e726f51 75f56413 = 1.2345678901234568e+301 +dd[1] = #7e726f51 75f56414 = 1.234567890123457e+301 + + +Input: 1.234567890123456789e-301 +strtodI consumes 25 bytes and returns 17 +dd[0] = #1752a64 e34ba0d3 = 1.2345678901234567e-301 +dd[1] = #1752a64 e34ba0d4 = 1.234567890123457e-301 + + +Input: 1.234567890123456789e-321 +strtodI consumes 25 bytes and returns 98 +dd[0] = #0 f9 = 1.23e-321 +dd[1] = #0 fa = 1.235e-321 + + +Input: 1e23 +strtodI consumes 4 bytes and returns 17 +dd[0] = #44b52d02 c7e14af6 = 1e+23 +dd[1] = #44b52d02 c7e14af7 = 1.0000000000000001e+23 + + +Input: 1e310 +strtodI consumes 5 bytes and returns 163 +dd[0] = #7fefffff ffffffff = 1.7976931348623157e+308 +dd[1] = #7ff00000 0 = Infinity + + +Input: 9.0259718793241475e-277 +strtodI consumes 23 bytes and returns 33 +dd[0] = #69fffff ffffffff = 9.025971879324147e-277 +dd[1] = #6a00000 0 = 9.025971879324148e-277 + + +Input: 9.025971879324147880346310405869e-277 +strtodI consumes 37 bytes and returns 17 +dd[0] = #6a00000 0 = 9.025971879324148e-277 +dd[1] = #6a00000 1 = 9.02597187932415e-277 + + +Input: 9.025971879324147880346310405868e-277 +strtodI consumes 37 bytes and returns 33 +dd[0] = #69fffff ffffffff = 9.025971879324147e-277 +dd[1] = #6a00000 0 = 9.025971879324148e-277 + + +Input: 2.2250738585072014e-308 +strtodI consumes 23 bytes and returns 17 +dd[0] = #100000 0 = 2.2250738585072014e-308 +dd[1] = #100000 1 = 2.225073858507202e-308 + + +Input: 2.2250738585072013e-308 +strtodI consumes 23 bytes and returns 33 +dd[0] = #fffff ffffffff = 2.225073858507201e-308 +dd[1] = #100000 0 = 2.2250738585072014e-308 + diff --git a/contrib/gdtoa/test/dIsi.out b/contrib/gdtoa/test/dIsi.out new file mode 100644 index 0000000..3388a1a --- /dev/null +++ b/contrib/gdtoa/test/dIsi.out @@ -0,0 +1,168 @@ + +Input: 1.23 +strtodI consumes 4 bytes and returns 17 +dd[0] = #3ff3ae14 7ae147ae = 1.23 +dd[1] = #3ff3ae14 7ae147af = 1.2300000000000002 + + +Input: 1.23e+20 +strtodI consumes 8 bytes and returns 1 +dd[0] = #441aabdf 2145b430 = 1.23e+20 +dd[1] = #441aabdf 2145b430 = 1.23e+20 + + +Input: 1.23e-20 +strtodI consumes 8 bytes and returns 33 +dd[0] = #3bcd0ae4 cf767530 = 1.2299999999999999e-20 +dd[1] = #3bcd0ae4 cf767531 = 1.23e-20 + + +Input: 1.23456789 +strtodI consumes 10 bytes and returns 17 +dd[0] = #3ff3c0ca 4283de1b = 1.23456789 +dd[1] = #3ff3c0ca 4283de1c = 1.2345678900000001 + + +Input: 1.23456589e+20 +strtodI consumes 14 bytes and returns 17 +dd[0] = #441ac537 a660b997 = 1.23456589e+20 +dd[1] = #441ac537 a660b998 = 123456589000000010000 + + +Input: 1.23e+30 +strtodI consumes 8 bytes and returns 17 +dd[0] = #462f0cb0 4e8fb790 = 1.23e+30 +dd[1] = #462f0cb0 4e8fb791 = 1.2300000000000001e+30 + + +Input: 1.23e-30 +strtodI consumes 8 bytes and returns 33 +dd[0] = #39b8f286 6f5010aa = 1.2299999999999999e-30 +dd[1] = #39b8f286 6f5010ab = 1.23e-30 + + +Input: 1.23456789e-20 +strtodI consumes 14 bytes and returns 17 +dd[0] = #3bcd2681 471e7ada = 1.23456789e-20 +dd[1] = #3bcd2681 471e7adb = 1.2345678900000001e-20 + + +Input: 1.23456789e-30 +strtodI consumes 14 bytes and returns 17 +dd[0] = #39b90a3e 33bbd995 = 1.23456789e-30 +dd[1] = #39b90a3e 33bbd996 = 1.2345678900000002e-30 + + +Input: 1.234567890123456789 +strtodI consumes 20 bytes and returns 17 +dd[0] = #3ff3c0ca 428c59fb = 1.2345678901234567 +dd[1] = #3ff3c0ca 428c59fc = 1.234567890123457 + + +Input: 1.23456789012345678901234567890123456789 +strtodI consumes 40 bytes and returns 17 +dd[0] = #3ff3c0ca 428c59fb = 1.2345678901234567 +dd[1] = #3ff3c0ca 428c59fc = 1.234567890123457 + + +Input: 1.23e306 +strtodI consumes 8 bytes and returns 33 +dd[0] = #7f7c0676 cd1c61f4 = 1.2299999999999999e+306 +dd[1] = #7f7c0676 cd1c61f5 = 1.23e+306 + + +Input: 1.23e-306 +strtodI consumes 9 bytes and returns 33 +dd[0] = #6ba3b8 5da396e7 = 1.2299999999999999e-306 +dd[1] = #6ba3b8 5da396e8 = 1.23e-306 + + +Input: 1.23e-320 +strtodI consumes 9 bytes and returns 80 +dd[0] = #0 0 = 0 +dd[1] = #100000 0 = 2.2250738585072014e-308 + + +Input: 1.23e-20 +strtodI consumes 8 bytes and returns 33 +dd[0] = #3bcd0ae4 cf767530 = 1.2299999999999999e-20 +dd[1] = #3bcd0ae4 cf767531 = 1.23e-20 + + +Input: 1.23456789e307 +strtodI consumes 14 bytes and returns 33 +dd[0] = #7fb194b1 4bdaecdb = 1.2345678899999998e+307 +dd[1] = #7fb194b1 4bdaecdc = 1.23456789e+307 + + +Input: 1.23456589e-307 +strtodI consumes 15 bytes and returns 17 +dd[0] = #363196 bb9845fa = 1.23456589e-307 +dd[1] = #363196 bb9845fb = 1.2345658900000001e-307 + + +Input: 1.234567890123456789 +strtodI consumes 20 bytes and returns 17 +dd[0] = #3ff3c0ca 428c59fb = 1.2345678901234567 +dd[1] = #3ff3c0ca 428c59fc = 1.234567890123457 + + +Input: 1.234567890123456789e301 +strtodI consumes 24 bytes and returns 17 +dd[0] = #7e726f51 75f56413 = 1.2345678901234568e+301 +dd[1] = #7e726f51 75f56414 = 1.234567890123457e+301 + + +Input: 1.234567890123456789e-301 +strtodI consumes 25 bytes and returns 17 +dd[0] = #1752a64 e34ba0d3 = 1.2345678901234567e-301 +dd[1] = #1752a64 e34ba0d4 = 1.234567890123457e-301 + + +Input: 1.234567890123456789e-321 +strtodI consumes 25 bytes and returns 80 +dd[0] = #0 0 = 0 +dd[1] = #100000 0 = 2.2250738585072014e-308 + + +Input: 1e23 +strtodI consumes 4 bytes and returns 17 +dd[0] = #44b52d02 c7e14af6 = 1e+23 +dd[1] = #44b52d02 c7e14af7 = 1.0000000000000001e+23 + + +Input: 1e310 +strtodI consumes 5 bytes and returns 163 +dd[0] = #7fefffff ffffffff = 1.7976931348623157e+308 +dd[1] = #7ff00000 0 = Infinity + + +Input: 9.0259718793241475e-277 +strtodI consumes 23 bytes and returns 33 +dd[0] = #69fffff ffffffff = 9.025971879324147e-277 +dd[1] = #6a00000 0 = 9.025971879324148e-277 + + +Input: 9.025971879324147880346310405869e-277 +strtodI consumes 37 bytes and returns 17 +dd[0] = #6a00000 0 = 9.025971879324148e-277 +dd[1] = #6a00000 1 = 9.02597187932415e-277 + + +Input: 9.025971879324147880346310405868e-277 +strtodI consumes 37 bytes and returns 33 +dd[0] = #69fffff ffffffff = 9.025971879324147e-277 +dd[1] = #6a00000 0 = 9.025971879324148e-277 + + +Input: 2.2250738585072014e-308 +strtodI consumes 23 bytes and returns 17 +dd[0] = #100000 0 = 2.2250738585072014e-308 +dd[1] = #100000 1 = 2.225073858507202e-308 + + +Input: 2.2250738585072013e-308 +strtodI consumes 23 bytes and returns 33 +dd[0] = #0 0 = 0 +dd[1] = #100000 0 = 2.2250738585072014e-308 + diff --git a/contrib/gdtoa/test/dItest.c b/contrib/gdtoa/test/dItest.c new file mode 100644 index 0000000..d9b56d5 --- /dev/null +++ b/contrib/gdtoa/test/dItest.c @@ -0,0 +1,88 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +#include "gdtoaimp.h" +#include <stdio.h> +#include <stdlib.h> + + static char ibuf[2048]; + +#define U (unsigned long) + + static void +#ifdef KR_headers +dshow(what, d) char *what; double d; +#else +dshow(char *what, double d) +#endif +{ + char buf[32]; + g_dfmt(buf, &d, 0, sizeof(buf)); + printf("%s = #%lx %lx = %s\n", what, + U ((ULong*)&d)[_0], U ((ULong*)&d)[_1], buf); + } + + int +main(Void) +{ + /* Input: one number per line */ + + char *s, *se, *se1; + int i, j; + double dd[2], dd1, dd2; + static char cfmt[] = "%s consumes %d bytes and returns %d\n"; + + while( (s = fgets(ibuf, sizeof(ibuf), stdin)) !=0) { + while(*s <= ' ') + if (!*s++) + continue; + printf("\nInput: %s", ibuf); + i = strtodI(ibuf, &se, dd); + printf(cfmt, "strtodI", (int)(se-ibuf), i); + dshow("dd[0]", dd[0]); + dshow("dd[1]", dd[1]); + printf("\n"); + j = strtoId(ibuf, &se1, &dd1, &dd2); + if (j != i || se != se1 + || dd[0] != dd1 || dd[1] != dd2) { + printf(cfmt, "**** strtoId", (int)(se-ibuf), j); + dshow("dd1", dd1); + dshow("dd2", dd2); + } + } + return 0; + } diff --git a/contrib/gdtoa/test/dd.out b/contrib/gdtoa/test/dd.out new file mode 100644 index 0000000..b1d2744 --- /dev/null +++ b/contrib/gdtoa/test/dd.out @@ -0,0 +1,1356 @@ + +Input: 1.23 +strtopdd consumes 4 bytes and returns 17 +dd[0] = 1.23 = #3ff3ae14 7ae147ae +dd[1] = 1.7763568394002496e-17 = #3c747ae1 47ae1478 +g_ddfmt(0) gives 4 bytes: "1.23" + +strtoIdd returns 17, consuming 4 bytes. +ddI[0] = #3ff3ae14 7ae147ae + 3c747ae1 47ae1478 += 1.23 + 1.7763568394002496e-17 +ddI[1] = #3ff3ae14 7ae147ae + 3c747ae1 47ae1480 += 1.23 + 1.776356839400252e-17 +ddI[0] == strtod + + +Input: 1.23e+20 +strtopdd consumes 8 bytes and returns 1 +dd[0] = 1.23e+20 = #441aabdf 2145b430 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 8 bytes: "1.23e+20" + +strtoIdd returns 1, consuming 8 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.23e-20 +strtopdd consumes 8 bytes and returns 33 +dd[0] = 1.2299999999999999e-20 = #3bcd0ae4 cf767530 +dd[1] = 9.304023318521521e-37 = #3873c997 955b2691 +g_ddfmt(0) gives 8 bytes: "1.23e-20" + +strtoIdd returns 33, consuming 8 bytes. +ddI[0] = #3bcd0ae4 cf767530 + 3873c997 955b2690 += 1.2299999999999999e-20 + 9.3040233185215194e-37 +ddI[1] = #3bcd0ae4 cf767530 + 3873c997 955b2691 += 1.2299999999999999e-20 + 9.3040233185215211e-37 +ddI[1] == strtod + + +Input: 1.23456789 +strtopdd consumes 10 bytes and returns 17 +dd[0] = 1.23456789 = #3ff3c0ca 4283de1b +dd[1] = 1.0990618193318369e-16 = #3c9fada5 144c1252 +g_ddfmt(0) gives 10 bytes: "1.23456789" + +strtoIdd returns 17, consuming 10 bytes. +ddI[0] = #3ff3c0ca 4283de1b + 3c9fada5 144c1252 += 1.2345678899999999 + 1.0990618193318369e-16 +ddI[1] = #3ff3c0ca 4283de1b + 3c9fada5 144c1254 += 1.2345678899999999 + 1.0990618193318371e-16 +ddI[0] == strtod + + +Input: 1.23456589e+20 +strtopdd consumes 14 bytes and returns 1 +dd[0] = 1.23456589e+20 = #441ac537 a660b997 +dd[1] = 4096 = #40b00000 0 +g_ddfmt(0) gives 14 bytes: "1.23456589e+20" + +strtoIdd returns 1, consuming 14 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.23e+30 +strtopdd consumes 8 bytes and returns 1 +dd[0] = 1.23e+30 = #462f0cb0 4e8fb790 +dd[1] = 40281156091904 = #42c25158 0 +g_ddfmt(0) gives 8 bytes: "1.23e+30" + +strtoIdd returns 1, consuming 8 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.23e-30 +strtopdd consumes 8 bytes and returns 17 +dd[0] = 1.2299999999999999e-30 = #39b8f286 6f5010aa +dd[1] = 1.076909723013918e-46 = #3663ac7f 3dafd174 +g_ddfmt(0) gives 8 bytes: "1.23e-30" + +strtoIdd returns 17, consuming 8 bytes. +ddI[0] = #39b8f286 6f5010aa + 3663ac7f 3dafd174 += 1.2299999999999999e-30 + 1.076909723013918e-46 +ddI[1] = #39b8f286 6f5010aa + 3663ac7f 3dafd175 += 1.2299999999999999e-30 + 1.0769097230139181e-46 +ddI[0] == strtod + + +Input: 1.23456789e-20 +strtopdd consumes 14 bytes and returns 17 +dd[0] = 1.23456789e-20 = #3bcd2681 471e7ada +dd[1] = 6.247111971663133e-37 = #386a9280 a761b07e +g_ddfmt(0) gives 14 bytes: "1.23456789e-20" + +strtoIdd returns 17, consuming 14 bytes. +ddI[0] = #3bcd2681 471e7ada + 386a9280 a761b07e += 1.2345678899999999e-20 + 6.2471119716631328e-37 +ddI[1] = #3bcd2681 471e7ada + 386a9280 a761b080 += 1.2345678899999999e-20 + 6.2471119716631345e-37 +ddI[0] == strtod + + +Input: 1.23456789e-30 +strtopdd consumes 14 bytes and returns 33 +dd[0] = 1.23456789e-30 = #39b90a3e 33bbd995 +dd[1] = 2.1567930523648577e-47 = #363f8585 55a6b1a0 +g_ddfmt(0) gives 14 bytes: "1.23456789e-30" + +strtoIdd returns 33, consuming 14 bytes. +ddI[0] = #39b90a3e 33bbd995 + 363f8585 55a6b198 += 1.23456789e-30 + 2.1567930523648558e-47 +ddI[1] = #39b90a3e 33bbd995 + 363f8585 55a6b1a0 += 1.23456789e-30 + 2.1567930523648577e-47 +ddI[1] == strtod + + +Input: 1.234567890123456789 +strtopdd consumes 20 bytes and returns 33 +dd[0] = 1.2345678901234567 = #3ff3c0ca 428c59fb +dd[1] = 9.856786452588859e-17 = #3c9c6906 51a3745e +g_ddfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIdd returns 33, consuming 20 bytes. +ddI[0] = #3ff3c0ca 428c59fb + 3c9c6906 51a3745c += 1.2345678901234567 + 9.8567864525888563e-17 +ddI[1] = #3ff3c0ca 428c59fb + 3c9c6906 51a3745e += 1.2345678901234567 + 9.8567864525888588e-17 +ddI[1] == strtod + + +Input: 1.23456789012345678901234567890123456789 +strtopdd consumes 40 bytes and returns 33 +dd[0] = 1.2345678901234567 = #3ff3c0ca 428c59fb +dd[1] = 9.858021020478982e-17 = #3c9c69ef 85adadb6 +g_ddfmt(0) gives 34 bytes: "1.23456789012345678901234567890124" + +strtoIdd returns 33, consuming 40 bytes. +ddI[0] = #3ff3c0ca 428c59fb + 3c9c69ef 85adadb4 += 1.2345678901234567 + 9.8580210204789798e-17 +ddI[1] = #3ff3c0ca 428c59fb + 3c9c69ef 85adadb6 += 1.2345678901234567 + 9.8580210204789823e-17 +ddI[1] == strtod + + +Input: 1.23e306 +strtopdd consumes 8 bytes and returns 33 +dd[0] = 1.2299999999999999e+306 = #7f7c0676 cd1c61f4 +dd[1] = 1.3319001448659015e+290 = #7c2b558b e3d3f477 +g_ddfmt(0) gives 9 bytes: "1.23e+306" + +strtoIdd returns 33, consuming 8 bytes. +ddI[0] = #7f7c0676 cd1c61f4 + 7c2b558b e3d3f476 += 1.2299999999999999e+306 + 1.3319001448659013e+290 +ddI[1] = #7f7c0676 cd1c61f4 + 7c2b558b e3d3f477 += 1.2299999999999999e+306 + 1.3319001448659015e+290 +ddI[1] == strtod + + +Input: 1.23e-306 +strtopdd consumes 9 bytes and returns 98 +dd[0] = 1.2299999999999999e-306 = #6ba3b8 5da396e7 +dd[1] = 1.43e-322 = #0 1d +g_ddfmt(0) gives 9 bytes: "1.23e-306" + +strtoIdd returns 98, consuming 9 bytes. +ddI[0] = #6ba3b8 5da396e7 + 0 1c += 1.2299999999999999e-306 + 1.3833838083554903e-322 +ddI[1] = #6ba3b8 5da396e7 + 0 1d += 1.2299999999999999e-306 + 1.432790372939615e-322 +ddI[1] == strtod + + +Input: 1.23e-320 +strtopdd consumes 9 bytes and returns 98 +dd[0] = 1.23e-320 = #0 9ba +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 9 bytes: "1.23e-320" + +strtoIdd returns 98, consuming 9 bytes. +ddI[0] = #0 9b9 + 0 0 += 1.2297293924988626e-320 + 0 +ddI[1] = #0 9ba + 0 0 += 1.2302234581447039e-320 + 0 +ddI[1] == strtod + + +Input: 1.23e-20 +strtopdd consumes 8 bytes and returns 33 +dd[0] = 1.2299999999999999e-20 = #3bcd0ae4 cf767530 +dd[1] = 9.304023318521521e-37 = #3873c997 955b2691 +g_ddfmt(0) gives 8 bytes: "1.23e-20" + +strtoIdd returns 33, consuming 8 bytes. +ddI[0] = #3bcd0ae4 cf767530 + 3873c997 955b2690 += 1.2299999999999999e-20 + 9.3040233185215194e-37 +ddI[1] = #3bcd0ae4 cf767530 + 3873c997 955b2691 += 1.2299999999999999e-20 + 9.3040233185215211e-37 +ddI[1] == strtod + + +Input: 1.23456789e307 +strtopdd consumes 14 bytes and returns 33 +dd[0] = 1.2345678899999998e+307 = #7fb194b1 4bdaecdb +dd[1] = 2.0137933598720243e+291 = #7c69d48d 192048ca +g_ddfmt(0) gives 15 bytes: "1.23456789e+307" + +strtoIdd returns 33, consuming 14 bytes. +ddI[0] = #7fb194b1 4bdaecdb + 7c69d48d 192048c9 += 1.2345678899999998e+307 + 2.013793359872024e+291 +ddI[1] = #7fb194b1 4bdaecdb + 7c69d48d 192048ca += 1.2345678899999998e+307 + 2.0137933598720243e+291 +ddI[1] == strtod + + +Input: 1.23456589e-307 +strtopdd consumes 15 bytes and returns 98 +dd[0] = 1.23456589e-307 = #363196 bb9845fa +dd[1] = 1e-323 = #0 2 +g_ddfmt(0) gives 15 bytes: "1.23456589e-307" + +strtoIdd returns 98, consuming 15 bytes. +ddI[0] = #363196 bb9845fa + 0 1 += 1.2345658899999999e-307 + 4.9406564584124654e-324 +ddI[1] = #363196 bb9845fa + 0 2 += 1.2345658899999999e-307 + 9.8813129168249309e-324 +ddI[1] == strtod + + +Input: 1.234567890123456789 +strtopdd consumes 20 bytes and returns 33 +dd[0] = 1.2345678901234567 = #3ff3c0ca 428c59fb +dd[1] = 9.856786452588859e-17 = #3c9c6906 51a3745e +g_ddfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIdd returns 33, consuming 20 bytes. +ddI[0] = #3ff3c0ca 428c59fb + 3c9c6906 51a3745c += 1.2345678901234567 + 9.8567864525888563e-17 +ddI[1] = #3ff3c0ca 428c59fb + 3c9c6906 51a3745e += 1.2345678901234567 + 9.8567864525888588e-17 +ddI[1] == strtod + + +Input: 1.234567890123456789e301 +strtopdd consumes 24 bytes and returns 33 +dd[0] = 1.2345678901234568e+301 = #7e726f51 75f56413 +dd[1] = 1.3892003943918827e+283 = #7ab7ea80 76399100 +g_ddfmt(0) gives 25 bytes: "1.234567890123456789e+301" + +strtoIdd returns 33, consuming 24 bytes. +ddI[0] = #7e726f51 75f56413 + 7ab7ea80 76399080 += 1.2345678901234568e+301 + 1.3892003943918563e+283 +ddI[1] = #7e726f51 75f56413 + 7ab7ea80 76399100 += 1.2345678901234568e+301 + 1.3892003943918827e+283 +ddI[1] == strtod + + +Input: 1.234567890123456789e-301 +strtopdd consumes 25 bytes and returns 82 +dd[0] = 1.2345678901234567e-301 = #1752a64 e34ba0d3 +dd[1] = 7.374365e-318 = #0 16c66c +g_ddfmt(0) gives 25 bytes: "1.234567890123456789e-301" + +strtoIdd returns 82, consuming 25 bytes. +ddI[0] = #1752a64 e34ba0d3 + 0 16c66c += 1.2345678901234567e-301 + 7.374364541948945e-318 +ddI[1] = #1752a64 e34ba0d3 + 0 16c66d += 1.2345678901234567e-301 + 7.3743694826054034e-318 +ddI[0] == strtod + + +Input: 1.234567890123456789e-321 +strtopdd consumes 25 bytes and returns 98 +dd[0] = 1.235e-321 = #0 fa +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 10 bytes: "1.235e-321" + +strtoIdd returns 98, consuming 25 bytes. +ddI[0] = #0 f9 + 0 0 += 1.2302234581447039e-321 + 0 +ddI[1] = #0 fa + 0 0 += 1.2351641146031164e-321 + 0 +ddI[1] == strtod + + +Input: 1e23 +strtopdd consumes 4 bytes and returns 1 +dd[0] = 1e+23 = #44b52d02 c7e14af6 +dd[1] = 8388608 = #41600000 0 +g_ddfmt(0) gives 5 bytes: "1e+23" + +strtoIdd returns 1, consuming 4 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1e310 +strtopdd consumes 5 bytes and returns 163 +dd[0] = Infinity = #7ff00000 0 +dd[1] = Infinity = #7ff00000 0 +g_ddfmt(0) gives 8 bytes: "Infinity" + +strtoIdd returns 163, consuming 5 bytes. +ddI[0] = #7fefffff ffffffff + 7c9fffff ffffffff += 1.7976931348623157e+308 + 1.9958403095347196e+292 +ddI[1] = #7ff00000 0 + 7ff00000 0 += Infinity + Infinity +ddI[1] == strtod + + +Input: 9.0259718793241475e-277 +strtopdd consumes 23 bytes and returns 33 +dd[0] = 9.025971879324147e-277 = #69fffff ffffffff +dd[1] = 6.217378695986177e-293 = #343daae f3582320 +g_ddfmt(0) gives 23 bytes: "9.0259718793241475e-277" + +strtoIdd returns 33, consuming 23 bytes. +ddI[0] = #69fffff ffffffff + 343daae f358231f += 9.0259718793241469e-277 + 6.2173786959861757e-293 +ddI[1] = #69fffff ffffffff + 343daae f3582320 += 9.0259718793241469e-277 + 6.2173786959861768e-293 +ddI[1] == strtod + + +Input: 9.025971879324147880346310405869e-277 +strtopdd consumes 37 bytes and returns 17 +dd[0] = 9.025971879324148e-277 = #6a00000 0 +dd[1] = 2.2250738585072014e-308 = #100000 0 +g_ddfmt(0) gives 37 bytes: "9.025971879324147880346310405869e-277" + +strtoIdd returns 17, consuming 37 bytes. +ddI[0] = #6a00000 0 + 100000 0 += 9.0259718793241479e-277 + 2.2250738585072014e-308 +ddI[1] = #6a00000 0 + 200000 0 += 9.0259718793241479e-277 + 4.4501477170144028e-308 +ddI[0] == strtod + + +Input: 9.025971879324147880346310405868e-277 +strtopdd consumes 37 bytes and returns 17 +dd[0] = 9.025971879324147e-277 = #69fffff ffffffff +dd[1] = 1.0020841800044856e-292 = #34fffff fffffff9 +g_ddfmt(0) gives 37 bytes: "9.025971879324147880346310405868e-277" + +strtoIdd returns 17, consuming 37 bytes. +ddI[0] = #69fffff ffffffff + 34fffff fffffff9 += 9.0259718793241469e-277 + 1.0020841800044856e-292 +ddI[1] = #69fffff ffffffff + 34fffff fffffffa += 9.0259718793241469e-277 + 1.0020841800044857e-292 +ddI[0] == strtod + + +Input: 2.2250738585072014e-308 +strtopdd consumes 23 bytes and returns 82 +dd[0] = 2.2250738585072014e-308 = #100000 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoIdd returns 82, consuming 23 bytes. +ddI[0] = #100000 0 + 0 0 += 2.2250738585072014e-308 + 0 +ddI[1] = #100000 1 + 0 0 += 2.2250738585072019e-308 + 0 +ddI[0] == strtod + + +Input: 2.2250738585072013e-308 +strtopdd consumes 23 bytes and returns 98 +dd[0] = 2.2250738585072014e-308 = #100000 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoIdd returns 98, consuming 23 bytes. +ddI[0] = #fffff ffffffff + 0 0 += 2.2250738585072009e-308 + 0 +ddI[1] = #100000 0 + 0 0 += 2.2250738585072014e-308 + 0 +ddI[1] == strtod + +Rounding mode for strtor... changed from 1 (nearest) to 0 (toward zero) + +Input: 1.1 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.0999999999999999 = #3ff19999 99999999 +dd[1] = 1.3322676295501878e-16 = #3ca33333 33333333 +g_ddfmt(0) gives 3 bytes: "1.1" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff19999 99999999 + 3ca33333 33333333 += 1.0999999999999999 + 1.3322676295501878e-16 +ddI[1] = #3ff19999 99999999 + 3ca33333 33333334 += 1.0999999999999999 + 1.332267629550188e-16 +ddI[0] == strtod + + +Input: -1.1 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.0999999999999999 = #bff19999 99999999 +dd[1] = -1.3322676295501878e-16 = #bca33333 33333333 +g_ddfmt(0) gives 4 bytes: "-1.1" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff19999 99999999 + bca33333 33333334 += -1.0999999999999999 + -1.332267629550188e-16 +ddI[1] = #bff19999 99999999 + bca33333 33333333 += -1.0999999999999999 + -1.3322676295501878e-16 +ddI[1] == strtod + + +Input: 1.2 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.2 = #3ff33333 33333333 +dd[1] = 4.440892098500625e-17 = #3c899999 99999998 +g_ddfmt(0) gives 3 bytes: "1.2" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff33333 33333333 + 3c899999 99999998 += 1.2 + 4.4408920985006252e-17 +ddI[1] = #3ff33333 33333333 + 3c899999 9999999c += 1.2 + 4.4408920985006276e-17 +ddI[0] == strtod + + +Input: -1.2 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.2 = #bff33333 33333333 +dd[1] = -4.440892098500625e-17 = #bc899999 99999998 +g_ddfmt(0) gives 4 bytes: "-1.2" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff33333 33333333 + bc899999 9999999c += -1.2 + -4.4408920985006276e-17 +ddI[1] = #bff33333 33333333 + bc899999 99999998 += -1.2 + -4.4408920985006252e-17 +ddI[1] == strtod + + +Input: 1.3 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.2999999999999998 = #3ff4cccc cccccccc +dd[1] = 1.7763568394002503e-16 = #3ca99999 99999999 +g_ddfmt(0) gives 34 bytes: "1.29999999999999999999999999999999" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ff4cccc cccccccc + 3ca99999 99999999 += 1.2999999999999998 + 1.7763568394002503e-16 +ddI[1] = #3ff4cccc cccccccc + 3ca99999 9999999a += 1.2999999999999998 + 1.7763568394002506e-16 +ddI[0] == strtod + + +Input: -1.3 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.2999999999999998 = #bff4cccc cccccccc +dd[1] = -1.7763568394002503e-16 = #bca99999 99999999 +g_ddfmt(0) gives 35 bytes: "-1.29999999999999999999999999999999" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bff4cccc cccccccc + bca99999 9999999a += -1.2999999999999998 + -1.7763568394002506e-16 +ddI[1] = #bff4cccc cccccccc + bca99999 99999999 += -1.2999999999999998 + -1.7763568394002503e-16 +ddI[1] == strtod + + +Input: 1.4 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.4 = #3ff66666 66666666 +dd[1] = 8.88178419700125e-17 = #3c999999 99999998 +g_ddfmt(0) gives 34 bytes: "1.39999999999999999999999999999998" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ff66666 66666666 + 3c999999 99999998 += 1.3999999999999999 + 8.8817841970012504e-17 +ddI[1] = #3ff66666 66666666 + 3c999999 9999999a += 1.3999999999999999 + 8.8817841970012528e-17 +ddI[0] == strtod + + +Input: -1.4 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.4 = #bff66666 66666666 +dd[1] = -8.88178419700125e-17 = #bc999999 99999998 +g_ddfmt(0) gives 35 bytes: "-1.39999999999999999999999999999998" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bff66666 66666666 + bc999999 9999999a += -1.3999999999999999 + -8.8817841970012528e-17 +ddI[1] = #bff66666 66666666 + bc999999 99999998 += -1.3999999999999999 + -8.8817841970012504e-17 +ddI[1] == strtod + + +Input: 1.5 +strtopdd consumes 3 bytes and returns 1 +dd[0] = 1.5 = #3ff80000 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 3 bytes: "1.5" + +strtoIdd returns 1, consuming 3 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: -1.5 +strtopdd consumes 4 bytes and returns 9 +dd[0] = -1.5 = #bff80000 0 +dd[1] = -0 = #80000000 0 +g_ddfmt(0) gives 3 bytes: "1.5" + +strtoIdd returns 9, consuming 4 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.6 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.5999999999999999 = #3ff99999 99999999 +dd[1] = 1.3322676295501878e-16 = #3ca33333 33333333 +g_ddfmt(0) gives 3 bytes: "1.6" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff99999 99999999 + 3ca33333 33333333 += 1.5999999999999999 + 1.3322676295501878e-16 +ddI[1] = #3ff99999 99999999 + 3ca33333 33333334 += 1.5999999999999999 + 1.332267629550188e-16 +ddI[0] == strtod + + +Input: -1.6 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.5999999999999999 = #bff99999 99999999 +dd[1] = -1.3322676295501878e-16 = #bca33333 33333333 +g_ddfmt(0) gives 4 bytes: "-1.6" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff99999 99999999 + bca33333 33333334 += -1.5999999999999999 + -1.332267629550188e-16 +ddI[1] = #bff99999 99999999 + bca33333 33333333 += -1.5999999999999999 + -1.3322676295501878e-16 +ddI[1] == strtod + + +Input: 1.7 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.7 = #3ffb3333 33333333 +dd[1] = 4.440892098500625e-17 = #3c899999 99999998 +g_ddfmt(0) gives 3 bytes: "1.7" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ffb3333 33333333 + 3c899999 99999998 += 1.7 + 4.4408920985006252e-17 +ddI[1] = #3ffb3333 33333333 + 3c899999 9999999c += 1.7 + 4.4408920985006276e-17 +ddI[0] == strtod + + +Input: -1.7 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.7 = #bffb3333 33333333 +dd[1] = -4.440892098500625e-17 = #bc899999 99999998 +g_ddfmt(0) gives 4 bytes: "-1.7" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bffb3333 33333333 + bc899999 9999999c += -1.7 + -4.4408920985006276e-17 +ddI[1] = #bffb3333 33333333 + bc899999 99999998 += -1.7 + -4.4408920985006252e-17 +ddI[1] == strtod + + +Input: 1.8 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.7999999999999998 = #3ffccccc cccccccc +dd[1] = 1.7763568394002503e-16 = #3ca99999 99999999 +g_ddfmt(0) gives 34 bytes: "1.79999999999999999999999999999999" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ffccccc cccccccc + 3ca99999 99999999 += 1.7999999999999998 + 1.7763568394002503e-16 +ddI[1] = #3ffccccc cccccccc + 3ca99999 9999999a += 1.7999999999999998 + 1.7763568394002506e-16 +ddI[0] == strtod + + +Input: -1.8 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.7999999999999998 = #bffccccc cccccccc +dd[1] = -1.7763568394002503e-16 = #bca99999 99999999 +g_ddfmt(0) gives 35 bytes: "-1.79999999999999999999999999999999" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bffccccc cccccccc + bca99999 9999999a += -1.7999999999999998 + -1.7763568394002506e-16 +ddI[1] = #bffccccc cccccccc + bca99999 99999999 += -1.7999999999999998 + -1.7763568394002503e-16 +ddI[1] == strtod + + +Input: 1.9 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.9 = #3ffe6666 66666666 +dd[1] = 8.88178419700125e-17 = #3c999999 99999998 +g_ddfmt(0) gives 34 bytes: "1.89999999999999999999999999999998" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ffe6666 66666666 + 3c999999 99999998 += 1.8999999999999999 + 8.8817841970012504e-17 +ddI[1] = #3ffe6666 66666666 + 3c999999 9999999a += 1.8999999999999999 + 8.8817841970012528e-17 +ddI[0] == strtod + + +Input: -1.9 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.9 = #bffe6666 66666666 +dd[1] = -8.88178419700125e-17 = #bc999999 99999998 +g_ddfmt(0) gives 35 bytes: "-1.89999999999999999999999999999998" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bffe6666 66666666 + bc999999 9999999a += -1.8999999999999999 + -8.8817841970012528e-17 +ddI[1] = #bffe6666 66666666 + bc999999 99999998 += -1.8999999999999999 + -8.8817841970012504e-17 +ddI[1] == strtod + +Rounding mode for strtor... changed from 0 (toward zero) to 1 (nearest) + +Input: 1.1 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.0999999999999999 = #3ff19999 99999999 +dd[1] = 1.3322676295501878e-16 = #3ca33333 33333333 +g_ddfmt(0) gives 3 bytes: "1.1" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff19999 99999999 + 3ca33333 33333333 += 1.0999999999999999 + 1.3322676295501878e-16 +ddI[1] = #3ff19999 99999999 + 3ca33333 33333334 += 1.0999999999999999 + 1.332267629550188e-16 +ddI[0] == strtod + + +Input: -1.1 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.0999999999999999 = #bff19999 99999999 +dd[1] = -1.3322676295501878e-16 = #bca33333 33333333 +g_ddfmt(0) gives 4 bytes: "-1.1" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff19999 99999999 + bca33333 33333334 += -1.0999999999999999 + -1.332267629550188e-16 +ddI[1] = #bff19999 99999999 + bca33333 33333333 += -1.0999999999999999 + -1.3322676295501878e-16 +ddI[1] == strtod + + +Input: 1.2 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.2 = #3ff33333 33333333 +dd[1] = 4.440892098500625e-17 = #3c899999 99999998 +g_ddfmt(0) gives 3 bytes: "1.2" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff33333 33333333 + 3c899999 99999998 += 1.2 + 4.4408920985006252e-17 +ddI[1] = #3ff33333 33333333 + 3c899999 9999999c += 1.2 + 4.4408920985006276e-17 +ddI[0] == strtod + + +Input: -1.2 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.2 = #bff33333 33333333 +dd[1] = -4.440892098500625e-17 = #bc899999 99999998 +g_ddfmt(0) gives 4 bytes: "-1.2" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff33333 33333333 + bc899999 9999999c += -1.2 + -4.4408920985006276e-17 +ddI[1] = #bff33333 33333333 + bc899999 99999998 += -1.2 + -4.4408920985006252e-17 +ddI[1] == strtod + + +Input: 1.3 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.2999999999999998 = #3ff4cccc cccccccc +dd[1] = 1.7763568394002506e-16 = #3ca99999 9999999a +g_ddfmt(0) gives 3 bytes: "1.3" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ff4cccc cccccccc + 3ca99999 99999999 += 1.2999999999999998 + 1.7763568394002503e-16 +ddI[1] = #3ff4cccc cccccccc + 3ca99999 9999999a += 1.2999999999999998 + 1.7763568394002506e-16 +ddI[1] == strtod + + +Input: -1.3 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.2999999999999998 = #bff4cccc cccccccc +dd[1] = -1.7763568394002506e-16 = #bca99999 9999999a +g_ddfmt(0) gives 4 bytes: "-1.3" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bff4cccc cccccccc + bca99999 9999999a += -1.2999999999999998 + -1.7763568394002506e-16 +ddI[1] = #bff4cccc cccccccc + bca99999 99999999 += -1.2999999999999998 + -1.7763568394002503e-16 +ddI[0] == strtod + + +Input: 1.4 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.4 = #3ff66666 66666666 +dd[1] = 8.881784197001253e-17 = #3c999999 9999999a +g_ddfmt(0) gives 3 bytes: "1.4" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ff66666 66666666 + 3c999999 99999998 += 1.3999999999999999 + 8.8817841970012504e-17 +ddI[1] = #3ff66666 66666666 + 3c999999 9999999a += 1.3999999999999999 + 8.8817841970012528e-17 +ddI[1] == strtod + + +Input: -1.4 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.4 = #bff66666 66666666 +dd[1] = -8.881784197001253e-17 = #bc999999 9999999a +g_ddfmt(0) gives 4 bytes: "-1.4" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bff66666 66666666 + bc999999 9999999a += -1.3999999999999999 + -8.8817841970012528e-17 +ddI[1] = #bff66666 66666666 + bc999999 99999998 += -1.3999999999999999 + -8.8817841970012504e-17 +ddI[0] == strtod + + +Input: 1.5 +strtopdd consumes 3 bytes and returns 1 +dd[0] = 1.5 = #3ff80000 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 3 bytes: "1.5" + +strtoIdd returns 1, consuming 3 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: -1.5 +strtopdd consumes 4 bytes and returns 9 +dd[0] = -1.5 = #bff80000 0 +dd[1] = -0 = #80000000 0 +g_ddfmt(0) gives 3 bytes: "1.5" + +strtoIdd returns 9, consuming 4 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.6 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.5999999999999999 = #3ff99999 99999999 +dd[1] = 1.3322676295501878e-16 = #3ca33333 33333333 +g_ddfmt(0) gives 3 bytes: "1.6" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff99999 99999999 + 3ca33333 33333333 += 1.5999999999999999 + 1.3322676295501878e-16 +ddI[1] = #3ff99999 99999999 + 3ca33333 33333334 += 1.5999999999999999 + 1.332267629550188e-16 +ddI[0] == strtod + + +Input: -1.6 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.5999999999999999 = #bff99999 99999999 +dd[1] = -1.3322676295501878e-16 = #bca33333 33333333 +g_ddfmt(0) gives 4 bytes: "-1.6" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff99999 99999999 + bca33333 33333334 += -1.5999999999999999 + -1.332267629550188e-16 +ddI[1] = #bff99999 99999999 + bca33333 33333333 += -1.5999999999999999 + -1.3322676295501878e-16 +ddI[1] == strtod + + +Input: 1.7 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.7 = #3ffb3333 33333333 +dd[1] = 4.440892098500625e-17 = #3c899999 99999998 +g_ddfmt(0) gives 3 bytes: "1.7" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ffb3333 33333333 + 3c899999 99999998 += 1.7 + 4.4408920985006252e-17 +ddI[1] = #3ffb3333 33333333 + 3c899999 9999999c += 1.7 + 4.4408920985006276e-17 +ddI[0] == strtod + + +Input: -1.7 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.7 = #bffb3333 33333333 +dd[1] = -4.440892098500625e-17 = #bc899999 99999998 +g_ddfmt(0) gives 4 bytes: "-1.7" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bffb3333 33333333 + bc899999 9999999c += -1.7 + -4.4408920985006276e-17 +ddI[1] = #bffb3333 33333333 + bc899999 99999998 += -1.7 + -4.4408920985006252e-17 +ddI[1] == strtod + + +Input: 1.8 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.7999999999999998 = #3ffccccc cccccccc +dd[1] = 1.7763568394002506e-16 = #3ca99999 9999999a +g_ddfmt(0) gives 3 bytes: "1.8" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ffccccc cccccccc + 3ca99999 99999999 += 1.7999999999999998 + 1.7763568394002503e-16 +ddI[1] = #3ffccccc cccccccc + 3ca99999 9999999a += 1.7999999999999998 + 1.7763568394002506e-16 +ddI[1] == strtod + + +Input: -1.8 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.7999999999999998 = #bffccccc cccccccc +dd[1] = -1.7763568394002506e-16 = #bca99999 9999999a +g_ddfmt(0) gives 4 bytes: "-1.8" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bffccccc cccccccc + bca99999 9999999a += -1.7999999999999998 + -1.7763568394002506e-16 +ddI[1] = #bffccccc cccccccc + bca99999 99999999 += -1.7999999999999998 + -1.7763568394002503e-16 +ddI[0] == strtod + + +Input: 1.9 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.9 = #3ffe6666 66666666 +dd[1] = 8.881784197001253e-17 = #3c999999 9999999a +g_ddfmt(0) gives 3 bytes: "1.9" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ffe6666 66666666 + 3c999999 99999998 += 1.8999999999999999 + 8.8817841970012504e-17 +ddI[1] = #3ffe6666 66666666 + 3c999999 9999999a += 1.8999999999999999 + 8.8817841970012528e-17 +ddI[1] == strtod + + +Input: -1.9 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.9 = #bffe6666 66666666 +dd[1] = -8.881784197001253e-17 = #bc999999 9999999a +g_ddfmt(0) gives 4 bytes: "-1.9" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bffe6666 66666666 + bc999999 9999999a += -1.8999999999999999 + -8.8817841970012528e-17 +ddI[1] = #bffe6666 66666666 + bc999999 99999998 += -1.8999999999999999 + -8.8817841970012504e-17 +ddI[0] == strtod + +Rounding mode for strtor... changed from 1 (nearest) to 2 (toward +Infinity) + +Input: 1.1 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.0999999999999999 = #3ff19999 99999999 +dd[1] = 1.332267629550188e-16 = #3ca33333 33333334 +g_ddfmt(0) gives 34 bytes: "1.10000000000000000000000000000002" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff19999 99999999 + 3ca33333 33333333 += 1.0999999999999999 + 1.3322676295501878e-16 +ddI[1] = #3ff19999 99999999 + 3ca33333 33333334 += 1.0999999999999999 + 1.332267629550188e-16 +ddI[1] == strtod + + +Input: -1.1 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.0999999999999999 = #bff19999 99999999 +dd[1] = -1.3322676295501878e-16 = #bca33333 33333333 +g_ddfmt(0) gives 4 bytes: "-1.1" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff19999 99999999 + bca33333 33333334 += -1.0999999999999999 + -1.332267629550188e-16 +ddI[1] = #bff19999 99999999 + bca33333 33333333 += -1.0999999999999999 + -1.3322676295501878e-16 +ddI[1] == strtod + + +Input: 1.2 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.2 = #3ff33333 33333333 +dd[1] = 4.4408920985006276e-17 = #3c899999 9999999c +g_ddfmt(0) gives 34 bytes: "1.20000000000000000000000000000001" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff33333 33333333 + 3c899999 99999998 += 1.2 + 4.4408920985006252e-17 +ddI[1] = #3ff33333 33333333 + 3c899999 9999999c += 1.2 + 4.4408920985006276e-17 +ddI[1] == strtod + + +Input: -1.2 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.2 = #bff33333 33333333 +dd[1] = -4.440892098500625e-17 = #bc899999 99999998 +g_ddfmt(0) gives 4 bytes: "-1.2" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff33333 33333333 + bc899999 9999999c += -1.2 + -4.4408920985006276e-17 +ddI[1] = #bff33333 33333333 + bc899999 99999998 += -1.2 + -4.4408920985006252e-17 +ddI[1] == strtod + + +Input: 1.3 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.2999999999999998 = #3ff4cccc cccccccc +dd[1] = 1.7763568394002506e-16 = #3ca99999 9999999a +g_ddfmt(0) gives 3 bytes: "1.3" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ff4cccc cccccccc + 3ca99999 99999999 += 1.2999999999999998 + 1.7763568394002503e-16 +ddI[1] = #3ff4cccc cccccccc + 3ca99999 9999999a += 1.2999999999999998 + 1.7763568394002506e-16 +ddI[1] == strtod + + +Input: -1.3 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.2999999999999998 = #bff4cccc cccccccc +dd[1] = -1.7763568394002503e-16 = #bca99999 99999999 +g_ddfmt(0) gives 35 bytes: "-1.29999999999999999999999999999999" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bff4cccc cccccccc + bca99999 9999999a += -1.2999999999999998 + -1.7763568394002506e-16 +ddI[1] = #bff4cccc cccccccc + bca99999 99999999 += -1.2999999999999998 + -1.7763568394002503e-16 +ddI[1] == strtod + + +Input: 1.4 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.4 = #3ff66666 66666666 +dd[1] = 8.881784197001253e-17 = #3c999999 9999999a +g_ddfmt(0) gives 3 bytes: "1.4" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ff66666 66666666 + 3c999999 99999998 += 1.3999999999999999 + 8.8817841970012504e-17 +ddI[1] = #3ff66666 66666666 + 3c999999 9999999a += 1.3999999999999999 + 8.8817841970012528e-17 +ddI[1] == strtod + + +Input: -1.4 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.4 = #bff66666 66666666 +dd[1] = -8.88178419700125e-17 = #bc999999 99999998 +g_ddfmt(0) gives 35 bytes: "-1.39999999999999999999999999999998" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bff66666 66666666 + bc999999 9999999a += -1.3999999999999999 + -8.8817841970012528e-17 +ddI[1] = #bff66666 66666666 + bc999999 99999998 += -1.3999999999999999 + -8.8817841970012504e-17 +ddI[1] == strtod + + +Input: 1.5 +strtopdd consumes 3 bytes and returns 1 +dd[0] = 1.5 = #3ff80000 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 3 bytes: "1.5" + +strtoIdd returns 1, consuming 3 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: -1.5 +strtopdd consumes 4 bytes and returns 9 +dd[0] = -1.5 = #bff80000 0 +dd[1] = -0 = #80000000 0 +g_ddfmt(0) gives 3 bytes: "1.5" + +strtoIdd returns 9, consuming 4 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.6 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.5999999999999999 = #3ff99999 99999999 +dd[1] = 1.332267629550188e-16 = #3ca33333 33333334 +g_ddfmt(0) gives 34 bytes: "1.60000000000000000000000000000002" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff99999 99999999 + 3ca33333 33333333 += 1.5999999999999999 + 1.3322676295501878e-16 +ddI[1] = #3ff99999 99999999 + 3ca33333 33333334 += 1.5999999999999999 + 1.332267629550188e-16 +ddI[1] == strtod + + +Input: -1.6 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.5999999999999999 = #bff99999 99999999 +dd[1] = -1.3322676295501878e-16 = #bca33333 33333333 +g_ddfmt(0) gives 4 bytes: "-1.6" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff99999 99999999 + bca33333 33333334 += -1.5999999999999999 + -1.332267629550188e-16 +ddI[1] = #bff99999 99999999 + bca33333 33333333 += -1.5999999999999999 + -1.3322676295501878e-16 +ddI[1] == strtod + + +Input: 1.7 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.7 = #3ffb3333 33333333 +dd[1] = 4.4408920985006276e-17 = #3c899999 9999999c +g_ddfmt(0) gives 34 bytes: "1.70000000000000000000000000000001" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ffb3333 33333333 + 3c899999 99999998 += 1.7 + 4.4408920985006252e-17 +ddI[1] = #3ffb3333 33333333 + 3c899999 9999999c += 1.7 + 4.4408920985006276e-17 +ddI[1] == strtod + + +Input: -1.7 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.7 = #bffb3333 33333333 +dd[1] = -4.440892098500625e-17 = #bc899999 99999998 +g_ddfmt(0) gives 4 bytes: "-1.7" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bffb3333 33333333 + bc899999 9999999c += -1.7 + -4.4408920985006276e-17 +ddI[1] = #bffb3333 33333333 + bc899999 99999998 += -1.7 + -4.4408920985006252e-17 +ddI[1] == strtod + + +Input: 1.8 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.7999999999999998 = #3ffccccc cccccccc +dd[1] = 1.7763568394002506e-16 = #3ca99999 9999999a +g_ddfmt(0) gives 3 bytes: "1.8" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ffccccc cccccccc + 3ca99999 99999999 += 1.7999999999999998 + 1.7763568394002503e-16 +ddI[1] = #3ffccccc cccccccc + 3ca99999 9999999a += 1.7999999999999998 + 1.7763568394002506e-16 +ddI[1] == strtod + + +Input: -1.8 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.7999999999999998 = #bffccccc cccccccc +dd[1] = -1.7763568394002503e-16 = #bca99999 99999999 +g_ddfmt(0) gives 35 bytes: "-1.79999999999999999999999999999999" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bffccccc cccccccc + bca99999 9999999a += -1.7999999999999998 + -1.7763568394002506e-16 +ddI[1] = #bffccccc cccccccc + bca99999 99999999 += -1.7999999999999998 + -1.7763568394002503e-16 +ddI[1] == strtod + + +Input: 1.9 +strtopdd consumes 3 bytes and returns 33 +dd[0] = 1.9 = #3ffe6666 66666666 +dd[1] = 8.881784197001253e-17 = #3c999999 9999999a +g_ddfmt(0) gives 3 bytes: "1.9" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ffe6666 66666666 + 3c999999 99999998 += 1.8999999999999999 + 8.8817841970012504e-17 +ddI[1] = #3ffe6666 66666666 + 3c999999 9999999a += 1.8999999999999999 + 8.8817841970012528e-17 +ddI[1] == strtod + + +Input: -1.9 +strtopdd consumes 4 bytes and returns 25 +dd[0] = -1.9 = #bffe6666 66666666 +dd[1] = -8.88178419700125e-17 = #bc999999 99999998 +g_ddfmt(0) gives 35 bytes: "-1.89999999999999999999999999999998" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bffe6666 66666666 + bc999999 9999999a += -1.8999999999999999 + -8.8817841970012528e-17 +ddI[1] = #bffe6666 66666666 + bc999999 99999998 += -1.8999999999999999 + -8.8817841970012504e-17 +ddI[1] == strtod + +Rounding mode for strtor... changed from 2 (toward +Infinity) to 3 (toward -Infinity) + +Input: 1.1 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.0999999999999999 = #3ff19999 99999999 +dd[1] = 1.3322676295501878e-16 = #3ca33333 33333333 +g_ddfmt(0) gives 3 bytes: "1.1" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff19999 99999999 + 3ca33333 33333333 += 1.0999999999999999 + 1.3322676295501878e-16 +ddI[1] = #3ff19999 99999999 + 3ca33333 33333334 += 1.0999999999999999 + 1.332267629550188e-16 +ddI[0] == strtod + + +Input: -1.1 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.0999999999999999 = #bff19999 99999999 +dd[1] = -1.332267629550188e-16 = #bca33333 33333334 +g_ddfmt(0) gives 35 bytes: "-1.10000000000000000000000000000002" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff19999 99999999 + bca33333 33333334 += -1.0999999999999999 + -1.332267629550188e-16 +ddI[1] = #bff19999 99999999 + bca33333 33333333 += -1.0999999999999999 + -1.3322676295501878e-16 +ddI[0] == strtod + + +Input: 1.2 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.2 = #3ff33333 33333333 +dd[1] = 4.440892098500625e-17 = #3c899999 99999998 +g_ddfmt(0) gives 3 bytes: "1.2" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff33333 33333333 + 3c899999 99999998 += 1.2 + 4.4408920985006252e-17 +ddI[1] = #3ff33333 33333333 + 3c899999 9999999c += 1.2 + 4.4408920985006276e-17 +ddI[0] == strtod + + +Input: -1.2 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.2 = #bff33333 33333333 +dd[1] = -4.4408920985006276e-17 = #bc899999 9999999c +g_ddfmt(0) gives 35 bytes: "-1.20000000000000000000000000000001" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff33333 33333333 + bc899999 9999999c += -1.2 + -4.4408920985006276e-17 +ddI[1] = #bff33333 33333333 + bc899999 99999998 += -1.2 + -4.4408920985006252e-17 +ddI[0] == strtod + + +Input: 1.3 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.2999999999999998 = #3ff4cccc cccccccc +dd[1] = 1.7763568394002503e-16 = #3ca99999 99999999 +g_ddfmt(0) gives 34 bytes: "1.29999999999999999999999999999999" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ff4cccc cccccccc + 3ca99999 99999999 += 1.2999999999999998 + 1.7763568394002503e-16 +ddI[1] = #3ff4cccc cccccccc + 3ca99999 9999999a += 1.2999999999999998 + 1.7763568394002506e-16 +ddI[0] == strtod + + +Input: -1.3 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.2999999999999998 = #bff4cccc cccccccc +dd[1] = -1.7763568394002506e-16 = #bca99999 9999999a +g_ddfmt(0) gives 4 bytes: "-1.3" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bff4cccc cccccccc + bca99999 9999999a += -1.2999999999999998 + -1.7763568394002506e-16 +ddI[1] = #bff4cccc cccccccc + bca99999 99999999 += -1.2999999999999998 + -1.7763568394002503e-16 +ddI[0] == strtod + + +Input: 1.4 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.4 = #3ff66666 66666666 +dd[1] = 8.88178419700125e-17 = #3c999999 99999998 +g_ddfmt(0) gives 34 bytes: "1.39999999999999999999999999999998" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ff66666 66666666 + 3c999999 99999998 += 1.3999999999999999 + 8.8817841970012504e-17 +ddI[1] = #3ff66666 66666666 + 3c999999 9999999a += 1.3999999999999999 + 8.8817841970012528e-17 +ddI[0] == strtod + + +Input: -1.4 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.4 = #bff66666 66666666 +dd[1] = -8.881784197001253e-17 = #bc999999 9999999a +g_ddfmt(0) gives 4 bytes: "-1.4" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bff66666 66666666 + bc999999 9999999a += -1.3999999999999999 + -8.8817841970012528e-17 +ddI[1] = #bff66666 66666666 + bc999999 99999998 += -1.3999999999999999 + -8.8817841970012504e-17 +ddI[0] == strtod + + +Input: 1.5 +strtopdd consumes 3 bytes and returns 1 +dd[0] = 1.5 = #3ff80000 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 3 bytes: "1.5" + +strtoIdd returns 1, consuming 3 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: -1.5 +strtopdd consumes 4 bytes and returns 9 +dd[0] = -1.5 = #bff80000 0 +dd[1] = -0 = #80000000 0 +g_ddfmt(0) gives 3 bytes: "1.5" + +strtoIdd returns 9, consuming 4 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.6 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.5999999999999999 = #3ff99999 99999999 +dd[1] = 1.3322676295501878e-16 = #3ca33333 33333333 +g_ddfmt(0) gives 3 bytes: "1.6" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ff99999 99999999 + 3ca33333 33333333 += 1.5999999999999999 + 1.3322676295501878e-16 +ddI[1] = #3ff99999 99999999 + 3ca33333 33333334 += 1.5999999999999999 + 1.332267629550188e-16 +ddI[0] == strtod + + +Input: -1.6 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.5999999999999999 = #bff99999 99999999 +dd[1] = -1.332267629550188e-16 = #bca33333 33333334 +g_ddfmt(0) gives 35 bytes: "-1.60000000000000000000000000000002" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bff99999 99999999 + bca33333 33333334 += -1.5999999999999999 + -1.332267629550188e-16 +ddI[1] = #bff99999 99999999 + bca33333 33333333 += -1.5999999999999999 + -1.3322676295501878e-16 +ddI[0] == strtod + + +Input: 1.7 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.7 = #3ffb3333 33333333 +dd[1] = 4.440892098500625e-17 = #3c899999 99999998 +g_ddfmt(0) gives 3 bytes: "1.7" + +strtoIdd returns 17, consuming 3 bytes. +ddI[0] = #3ffb3333 33333333 + 3c899999 99999998 += 1.7 + 4.4408920985006252e-17 +ddI[1] = #3ffb3333 33333333 + 3c899999 9999999c += 1.7 + 4.4408920985006276e-17 +ddI[0] == strtod + + +Input: -1.7 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.7 = #bffb3333 33333333 +dd[1] = -4.4408920985006276e-17 = #bc899999 9999999c +g_ddfmt(0) gives 35 bytes: "-1.70000000000000000000000000000001" + +strtoIdd returns 25, consuming 4 bytes. +ddI[0] = #bffb3333 33333333 + bc899999 9999999c += -1.7 + -4.4408920985006276e-17 +ddI[1] = #bffb3333 33333333 + bc899999 99999998 += -1.7 + -4.4408920985006252e-17 +ddI[0] == strtod + + +Input: 1.8 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.7999999999999998 = #3ffccccc cccccccc +dd[1] = 1.7763568394002503e-16 = #3ca99999 99999999 +g_ddfmt(0) gives 34 bytes: "1.79999999999999999999999999999999" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ffccccc cccccccc + 3ca99999 99999999 += 1.7999999999999998 + 1.7763568394002503e-16 +ddI[1] = #3ffccccc cccccccc + 3ca99999 9999999a += 1.7999999999999998 + 1.7763568394002506e-16 +ddI[0] == strtod + + +Input: -1.8 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.7999999999999998 = #bffccccc cccccccc +dd[1] = -1.7763568394002506e-16 = #bca99999 9999999a +g_ddfmt(0) gives 4 bytes: "-1.8" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bffccccc cccccccc + bca99999 9999999a += -1.7999999999999998 + -1.7763568394002506e-16 +ddI[1] = #bffccccc cccccccc + bca99999 99999999 += -1.7999999999999998 + -1.7763568394002503e-16 +ddI[0] == strtod + + +Input: 1.9 +strtopdd consumes 3 bytes and returns 17 +dd[0] = 1.9 = #3ffe6666 66666666 +dd[1] = 8.88178419700125e-17 = #3c999999 99999998 +g_ddfmt(0) gives 34 bytes: "1.89999999999999999999999999999998" + +strtoIdd returns 33, consuming 3 bytes. +ddI[0] = #3ffe6666 66666666 + 3c999999 99999998 += 1.8999999999999999 + 8.8817841970012504e-17 +ddI[1] = #3ffe6666 66666666 + 3c999999 9999999a += 1.8999999999999999 + 8.8817841970012528e-17 +ddI[0] == strtod + + +Input: -1.9 +strtopdd consumes 4 bytes and returns 41 +dd[0] = -1.9 = #bffe6666 66666666 +dd[1] = -8.881784197001253e-17 = #bc999999 9999999a +g_ddfmt(0) gives 4 bytes: "-1.9" + +strtoIdd returns 41, consuming 4 bytes. +ddI[0] = #bffe6666 66666666 + bc999999 9999999a += -1.8999999999999999 + -8.8817841970012528e-17 +ddI[1] = #bffe6666 66666666 + bc999999 99999998 += -1.8999999999999999 + -8.8817841970012504e-17 +ddI[0] == strtod + diff --git a/contrib/gdtoa/test/ddsi.out b/contrib/gdtoa/test/ddsi.out new file mode 100644 index 0000000..1677707 --- /dev/null +++ b/contrib/gdtoa/test/ddsi.out @@ -0,0 +1,376 @@ + +Input: 1.23 +strtopdd consumes 4 bytes and returns 17 +dd[0] = 1.23 = #3ff3ae14 7ae147ae +dd[1] = 1.7763568394002496e-17 = #3c747ae1 47ae1478 +g_ddfmt(0) gives 4 bytes: "1.23" + +strtoIdd returns 17, consuming 4 bytes. +ddI[0] = #3ff3ae14 7ae147ae + 3c747ae1 47ae1478 += 1.23 + 1.7763568394002496e-17 +ddI[1] = #3ff3ae14 7ae147ae + 3c747ae1 47ae1480 += 1.23 + 1.776356839400252e-17 +ddI[0] == strtod + + +Input: 1.23e+20 +strtopdd consumes 8 bytes and returns 1 +dd[0] = 1.23e+20 = #441aabdf 2145b430 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 8 bytes: "1.23e+20" + +strtoIdd returns 1, consuming 8 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.23e-20 +strtopdd consumes 8 bytes and returns 33 +dd[0] = 1.2299999999999999e-20 = #3bcd0ae4 cf767530 +dd[1] = 9.304023318521521e-37 = #3873c997 955b2691 +g_ddfmt(0) gives 8 bytes: "1.23e-20" + +strtoIdd returns 33, consuming 8 bytes. +ddI[0] = #3bcd0ae4 cf767530 + 3873c997 955b2690 += 1.2299999999999999e-20 + 9.3040233185215194e-37 +ddI[1] = #3bcd0ae4 cf767530 + 3873c997 955b2691 += 1.2299999999999999e-20 + 9.3040233185215211e-37 +ddI[1] == strtod + + +Input: 1.23456789 +strtopdd consumes 10 bytes and returns 17 +dd[0] = 1.23456789 = #3ff3c0ca 4283de1b +dd[1] = 1.0990618193318369e-16 = #3c9fada5 144c1252 +g_ddfmt(0) gives 10 bytes: "1.23456789" + +strtoIdd returns 17, consuming 10 bytes. +ddI[0] = #3ff3c0ca 4283de1b + 3c9fada5 144c1252 += 1.2345678899999999 + 1.0990618193318369e-16 +ddI[1] = #3ff3c0ca 4283de1b + 3c9fada5 144c1254 += 1.2345678899999999 + 1.0990618193318371e-16 +ddI[0] == strtod + + +Input: 1.23456589e+20 +strtopdd consumes 14 bytes and returns 1 +dd[0] = 1.23456589e+20 = #441ac537 a660b997 +dd[1] = 4096 = #40b00000 0 +g_ddfmt(0) gives 14 bytes: "1.23456589e+20" + +strtoIdd returns 1, consuming 14 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.23e+30 +strtopdd consumes 8 bytes and returns 1 +dd[0] = 1.23e+30 = #462f0cb0 4e8fb790 +dd[1] = 40281156091904 = #42c25158 0 +g_ddfmt(0) gives 8 bytes: "1.23e+30" + +strtoIdd returns 1, consuming 8 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1.23e-30 +strtopdd consumes 8 bytes and returns 17 +dd[0] = 1.2299999999999999e-30 = #39b8f286 6f5010aa +dd[1] = 1.076909723013918e-46 = #3663ac7f 3dafd174 +g_ddfmt(0) gives 8 bytes: "1.23e-30" + +strtoIdd returns 17, consuming 8 bytes. +ddI[0] = #39b8f286 6f5010aa + 3663ac7f 3dafd174 += 1.2299999999999999e-30 + 1.076909723013918e-46 +ddI[1] = #39b8f286 6f5010aa + 3663ac7f 3dafd175 += 1.2299999999999999e-30 + 1.0769097230139181e-46 +ddI[0] == strtod + + +Input: 1.23456789e-20 +strtopdd consumes 14 bytes and returns 17 +dd[0] = 1.23456789e-20 = #3bcd2681 471e7ada +dd[1] = 6.247111971663133e-37 = #386a9280 a761b07e +g_ddfmt(0) gives 14 bytes: "1.23456789e-20" + +strtoIdd returns 17, consuming 14 bytes. +ddI[0] = #3bcd2681 471e7ada + 386a9280 a761b07e += 1.2345678899999999e-20 + 6.2471119716631328e-37 +ddI[1] = #3bcd2681 471e7ada + 386a9280 a761b080 += 1.2345678899999999e-20 + 6.2471119716631345e-37 +ddI[0] == strtod + + +Input: 1.23456789e-30 +strtopdd consumes 14 bytes and returns 33 +dd[0] = 1.23456789e-30 = #39b90a3e 33bbd995 +dd[1] = 2.1567930523648577e-47 = #363f8585 55a6b1a0 +g_ddfmt(0) gives 14 bytes: "1.23456789e-30" + +strtoIdd returns 33, consuming 14 bytes. +ddI[0] = #39b90a3e 33bbd995 + 363f8585 55a6b198 += 1.23456789e-30 + 2.1567930523648558e-47 +ddI[1] = #39b90a3e 33bbd995 + 363f8585 55a6b1a0 += 1.23456789e-30 + 2.1567930523648577e-47 +ddI[1] == strtod + + +Input: 1.234567890123456789 +strtopdd consumes 20 bytes and returns 33 +dd[0] = 1.2345678901234567 = #3ff3c0ca 428c59fb +dd[1] = 9.856786452588859e-17 = #3c9c6906 51a3745e +g_ddfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIdd returns 33, consuming 20 bytes. +ddI[0] = #3ff3c0ca 428c59fb + 3c9c6906 51a3745c += 1.2345678901234567 + 9.8567864525888563e-17 +ddI[1] = #3ff3c0ca 428c59fb + 3c9c6906 51a3745e += 1.2345678901234567 + 9.8567864525888588e-17 +ddI[1] == strtod + + +Input: 1.23456789012345678901234567890123456789 +strtopdd consumes 40 bytes and returns 33 +dd[0] = 1.2345678901234567 = #3ff3c0ca 428c59fb +dd[1] = 9.858021020478982e-17 = #3c9c69ef 85adadb6 +g_ddfmt(0) gives 34 bytes: "1.23456789012345678901234567890124" + +strtoIdd returns 33, consuming 40 bytes. +ddI[0] = #3ff3c0ca 428c59fb + 3c9c69ef 85adadb4 += 1.2345678901234567 + 9.8580210204789798e-17 +ddI[1] = #3ff3c0ca 428c59fb + 3c9c69ef 85adadb6 += 1.2345678901234567 + 9.8580210204789823e-17 +ddI[1] == strtod + + +Input: 1.23e306 +strtopdd consumes 8 bytes and returns 33 +dd[0] = 1.2299999999999999e+306 = #7f7c0676 cd1c61f4 +dd[1] = 1.3319001448659015e+290 = #7c2b558b e3d3f477 +g_ddfmt(0) gives 9 bytes: "1.23e+306" + +strtoIdd returns 33, consuming 8 bytes. +ddI[0] = #7f7c0676 cd1c61f4 + 7c2b558b e3d3f476 += 1.2299999999999999e+306 + 1.3319001448659013e+290 +ddI[1] = #7f7c0676 cd1c61f4 + 7c2b558b e3d3f477 += 1.2299999999999999e+306 + 1.3319001448659015e+290 +ddI[1] == strtod + + +Input: 1.23e-306 +strtopdd consumes 9 bytes and returns 80 +dd[0] = 0 = #0 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 1 bytes: "0" + +strtoIdd returns 80, consuming 9 bytes. +ddI[0] = #0 0 + 0 0 += 0 + 0 +ddI[1] = #6a00000 0 + 0 0 += 9.0259718793241479e-277 + 0 +ddI[0] == strtod + + +Input: 1.23e-320 +strtopdd consumes 9 bytes and returns 80 +dd[0] = 0 = #0 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 1 bytes: "0" + +strtoIdd returns 80, consuming 9 bytes. +ddI[0] = #0 0 + 0 0 += 0 + 0 +ddI[1] = #6a00000 0 + 0 0 += 9.0259718793241479e-277 + 0 +ddI[0] == strtod + + +Input: 1.23e-20 +strtopdd consumes 8 bytes and returns 33 +dd[0] = 1.2299999999999999e-20 = #3bcd0ae4 cf767530 +dd[1] = 9.304023318521521e-37 = #3873c997 955b2691 +g_ddfmt(0) gives 8 bytes: "1.23e-20" + +strtoIdd returns 33, consuming 8 bytes. +ddI[0] = #3bcd0ae4 cf767530 + 3873c997 955b2690 += 1.2299999999999999e-20 + 9.3040233185215194e-37 +ddI[1] = #3bcd0ae4 cf767530 + 3873c997 955b2691 += 1.2299999999999999e-20 + 9.3040233185215211e-37 +ddI[1] == strtod + + +Input: 1.23456789e307 +strtopdd consumes 14 bytes and returns 33 +dd[0] = 1.2345678899999998e+307 = #7fb194b1 4bdaecdb +dd[1] = 2.0137933598720243e+291 = #7c69d48d 192048ca +g_ddfmt(0) gives 15 bytes: "1.23456789e+307" + +strtoIdd returns 33, consuming 14 bytes. +ddI[0] = #7fb194b1 4bdaecdb + 7c69d48d 192048c9 += 1.2345678899999998e+307 + 2.013793359872024e+291 +ddI[1] = #7fb194b1 4bdaecdb + 7c69d48d 192048ca += 1.2345678899999998e+307 + 2.0137933598720243e+291 +ddI[1] == strtod + + +Input: 1.23456589e-307 +strtopdd consumes 15 bytes and returns 80 +dd[0] = 0 = #0 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 1 bytes: "0" + +strtoIdd returns 80, consuming 15 bytes. +ddI[0] = #0 0 + 0 0 += 0 + 0 +ddI[1] = #6a00000 0 + 0 0 += 9.0259718793241479e-277 + 0 +ddI[0] == strtod + + +Input: 1.234567890123456789 +strtopdd consumes 20 bytes and returns 33 +dd[0] = 1.2345678901234567 = #3ff3c0ca 428c59fb +dd[1] = 9.856786452588859e-17 = #3c9c6906 51a3745e +g_ddfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIdd returns 33, consuming 20 bytes. +ddI[0] = #3ff3c0ca 428c59fb + 3c9c6906 51a3745c += 1.2345678901234567 + 9.8567864525888563e-17 +ddI[1] = #3ff3c0ca 428c59fb + 3c9c6906 51a3745e += 1.2345678901234567 + 9.8567864525888588e-17 +ddI[1] == strtod + + +Input: 1.234567890123456789e301 +strtopdd consumes 24 bytes and returns 33 +dd[0] = 1.2345678901234568e+301 = #7e726f51 75f56413 +dd[1] = 1.3892003943918827e+283 = #7ab7ea80 76399100 +g_ddfmt(0) gives 25 bytes: "1.234567890123456789e+301" + +strtoIdd returns 33, consuming 24 bytes. +ddI[0] = #7e726f51 75f56413 + 7ab7ea80 76399080 += 1.2345678901234568e+301 + 1.3892003943918563e+283 +ddI[1] = #7e726f51 75f56413 + 7ab7ea80 76399100 += 1.2345678901234568e+301 + 1.3892003943918827e+283 +ddI[1] == strtod + + +Input: 1.234567890123456789e-301 +strtopdd consumes 25 bytes and returns 80 +dd[0] = 0 = #0 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 1 bytes: "0" + +strtoIdd returns 80, consuming 25 bytes. +ddI[0] = #0 0 + 0 0 += 0 + 0 +ddI[1] = #6a00000 0 + 0 0 += 9.0259718793241479e-277 + 0 +ddI[0] == strtod + + +Input: 1.234567890123456789e-321 +strtopdd consumes 25 bytes and returns 80 +dd[0] = 0 = #0 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 1 bytes: "0" + +strtoIdd returns 80, consuming 25 bytes. +ddI[0] = #0 0 + 0 0 += 0 + 0 +ddI[1] = #6a00000 0 + 0 0 += 9.0259718793241479e-277 + 0 +ddI[0] == strtod + + +Input: 1e23 +strtopdd consumes 4 bytes and returns 1 +dd[0] = 1e+23 = #44b52d02 c7e14af6 +dd[1] = 8388608 = #41600000 0 +g_ddfmt(0) gives 5 bytes: "1e+23" + +strtoIdd returns 1, consuming 4 bytes. +ddI[0] == ddI[1] == strtopdd + + +Input: 1e310 +strtopdd consumes 5 bytes and returns 163 +dd[0] = Infinity = #7ff00000 0 +dd[1] = Infinity = #7ff00000 0 +g_ddfmt(0) gives 8 bytes: "Infinity" + +strtoIdd returns 163, consuming 5 bytes. +ddI[0] = #7fefffff ffffffff + 7c9fffff ffffffff += 1.7976931348623157e+308 + 1.9958403095347196e+292 +ddI[1] = #7ff00000 0 + 7ff00000 0 += Infinity + Infinity +ddI[1] == strtod + + +Input: 9.0259718793241475e-277 +strtopdd consumes 23 bytes and returns 80 +dd[0] = 0 = #0 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 1 bytes: "0" + +strtoIdd returns 80, consuming 23 bytes. +ddI[0] = #0 0 + 0 0 += 0 + 0 +ddI[1] = #6a00000 0 + 0 0 += 9.0259718793241479e-277 + 0 +ddI[0] == strtod + + +Input: 9.025971879324147880346310405869e-277 +strtopdd consumes 37 bytes and returns 17 +dd[0] = 9.025971879324148e-277 = #6a00000 0 +dd[1] = 2.2250738585072014e-308 = #100000 0 +g_ddfmt(0) gives 37 bytes: "9.025971879324147880346310405869e-277" + +strtoIdd returns 17, consuming 37 bytes. +ddI[0] = #6a00000 0 + 100000 0 += 9.0259718793241479e-277 + 2.2250738585072014e-308 +ddI[1] = #6a00000 0 + 200000 0 += 9.0259718793241479e-277 + 4.4501477170144028e-308 +ddI[0] == strtod + + +Input: 9.025971879324147880346310405868e-277 +strtopdd consumes 37 bytes and returns 80 +dd[0] = 0 = #0 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 1 bytes: "0" + +strtoIdd returns 80, consuming 37 bytes. +ddI[0] = #0 0 + 0 0 += 0 + 0 +ddI[1] = #6a00000 0 + 0 0 += 9.0259718793241479e-277 + 0 +ddI[0] == strtod + + +Input: 2.2250738585072014e-308 +strtopdd consumes 23 bytes and returns 80 +dd[0] = 0 = #0 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 1 bytes: "0" + +strtoIdd returns 80, consuming 23 bytes. +ddI[0] = #0 0 + 0 0 += 0 + 0 +ddI[1] = #6a00000 0 + 0 0 += 9.0259718793241479e-277 + 0 +ddI[0] == strtod + + +Input: 2.2250738585072013e-308 +strtopdd consumes 23 bytes and returns 80 +dd[0] = 0 = #0 0 +dd[1] = 0 = #0 0 +g_ddfmt(0) gives 1 bytes: "0" + +strtoIdd returns 80, consuming 23 bytes. +ddI[0] = #0 0 + 0 0 += 0 + 0 +ddI[1] = #6a00000 0 + 0 0 += 9.0259718793241479e-277 + 0 +ddI[0] == strtod + diff --git a/contrib/gdtoa/test/ddtest.c b/contrib/gdtoa/test/ddtest.c new file mode 100644 index 0000000..aa32e92 --- /dev/null +++ b/contrib/gdtoa/test/ddtest.c @@ -0,0 +1,183 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +/* Test program for g_ddfmt, strtoIdd, strtopdd, and strtordd. + * + * Inputs (on stdin): + * r rounding_mode + * n ndig + * number + * #hex0 hex1 hex2 hex3 + * + * rounding_mode values: + * 0 = toward zero + * 1 = nearest + * 2 = toward +Infinity + * 3 = toward -Infinity + * + * where number is a decimal floating-point number, + * hex0 is a string of <= 8 Hex digits for the most significant + * word of the number, hex1 is a similar string for the next + * word, etc., and ndig is a parameters to g_ddfmt. + */ + +#include "gdtoaimp.h" +#include <stdio.h> +#include <stdlib.h> + + extern int getround ANSI((int,char*)); + + static char ibuf[2048], obuf[1024]; + +#define U (unsigned long) + + static void +#ifdef KR_headers +dprint(what, d) char *what; double d; +#else +dprint(char *what, double d) +#endif +{ + char buf[32]; + ULong *L = (ULong*)&d; + + g_dfmt(buf,&d,0,sizeof(buf)); + printf("%s = %s = #%lx %lx\n", what, buf, U L[_0], U L[_1]); + } + + int +main(Void) +{ + ULong *L; + char *s, *s1, *se, *se1; + int dItry, i, j, r = 1, ndig = 0; + double dd[2], ddI[4]; + long LL[4]; + + L = (ULong*)&dd[0]; + while( (s = fgets(ibuf, sizeof(ibuf), stdin)) !=0) { + while(*s <= ' ') + if (!*s++) + continue; + dItry = 0; + switch(*s) { + case 'r': + r = getround(r, s); + continue; + case 'n': + i = s[1]; + if (i <= ' ' || i >= '0' && i <= '9') { + ndig = atoi(s+1); + continue; + } + break; /* nan? */ + case '#': + LL[0] = L[_0]; + LL[1] = L[_1]; + LL[2] = L[2+_0]; + LL[3] = L[2+_1]; + sscanf(s+1, "%lx %lx %lx %lx", &LL[0], &LL[1], + &LL[2], &LL[3]); + L[_0] = LL[0]; + L[_1] = LL[1]; + L[2+_0] = LL[2]; + L[2+_1] = LL[3]; + printf("\nInput: %s", ibuf); + printf(" --> f = #%lx %lx %lx %lx\n", + LL[0],LL[1],LL[2],LL[3]); + goto fmt_test; + } + printf("\nInput: %s", ibuf); + for(s1 = s; *s1 > ' '; s1++){}; + while(*s1 <= ' ' && *s1) s1++; + if (!*s1) { + dItry = 1; + i = strtordd(ibuf, &se, r, dd); + if (r == 1) { + j = strtopdd(ibuf, &se1, ddI); + if (i != j || dd[0] != ddI[0] + || dd[1] != ddI[1] || se != se1) + printf("***strtopdd and strtordd disagree!!\n:"); + } + printf("strtopdd consumes %d bytes and returns %d\n", + (int)(se-ibuf), i); + } + else { + dd[0] = strtod(s, &se); + dd[1] = strtod(se, &se); + } + fmt_test: + dprint("dd[0]", dd[0]); + dprint("dd[1]", dd[1]); + se = g_ddfmt(obuf, dd, ndig, sizeof(obuf)); + printf("g_ddfmt(%d) gives %d bytes: \"%s\"\n\n", + ndig, (int)(se-obuf), se ? obuf : "<null>"); + if (!dItry) + continue; + printf("strtoIdd returns %d,", strtoIdd(ibuf, &se, ddI,&ddI[2])); + printf(" consuming %d bytes.\n", (int)(se-ibuf)); + if (ddI[0] == ddI[2] && ddI[1] == ddI[3]) { + if (ddI[0] == dd[0] && ddI[1] == dd[1]) + printf("ddI[0] == ddI[1] == strtopdd\n"); + else + printf("ddI[0] == ddI[1] = #%lx %lx + %lx %lx\n= %.17g + %17.g\n", + U ((ULong*)ddI)[_0], + U ((ULong*)ddI)[_1], + U ((ULong*)ddI)[2+_0], + U ((ULong*)ddI)[2+_1], + ddI[0], ddI[1]); + } + else { + printf("ddI[0] = #%lx %lx + %lx %lx\n= %.17g + %.17g\n", + U ((ULong*)ddI)[_0], U ((ULong*)ddI)[_1], + U ((ULong*)ddI)[2+_0], U ((ULong*)ddI)[2+_1], + ddI[0], ddI[1]); + printf("ddI[1] = #%lx %lx + %lx %lx\n= %.17g + %.17g\n", + U ((ULong*)ddI)[4+_0], U ((ULong*)ddI)[4+_1], + U ((ULong*)ddI)[6+_0], U ((ULong*)ddI)[6+_1], + ddI[2], ddI[3]); + if (ddI[0] == dd[0] && ddI[1] == dd[1]) + printf("ddI[0] == strtod\n"); + else if (ddI[2] == dd[0] && ddI[3] == dd[1]) + printf("ddI[1] == strtod\n"); + else + printf("**** Both differ from strtopdd ****\n"); + } + printf("\n"); + } + return 0; + } diff --git a/contrib/gdtoa/test/dt.c b/contrib/gdtoa/test/dt.c new file mode 100644 index 0000000..1a86ba3 --- /dev/null +++ b/contrib/gdtoa/test/dt.c @@ -0,0 +1,275 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +/* Test program for strtod and dtoa. + * + * Inputs (on stdin): + * number[: mode [ndigits]] + * or + * #hex0 hex1[: mode [ndigits]] + * where number is a decimal floating-point number, + * hex0 is a string of Hex digits for the most significant + * word of the number, hex1 is a similar string for the other + * (least significant) word, and mode and ndigits are + * parameters to dtoa. + */ + +#include <stdio.h> +#include "gdtoa.h" +#ifdef KR_headers +#define Void /*void*/ +#else +#define Void void +#endif + +#ifdef __STDC__ +#include <stdlib.h> +#else +#ifdef __cplusplus +extern "C" double atof(const char*); +#else +extern double atof ANSI((char*)); +#endif +#endif +#ifdef IEEE_8087 +#define word0(x) ((ULong *)&x)[1] +#define word1(x) ((ULong *)&x)[0] +#else +#define word0(x) ((ULong *)&x)[0] +#define word1(x) ((ULong *)&x)[1] +#endif +#include "errno.h" + +#ifdef __cplusplus +extern "C" char *dtoa(double, int, int, int*, int*, char **); +#else +extern char *dtoa ANSI((double, int, int, int*, int*, char **)); +#endif + + static void +#ifdef KR_headers +g_fmt(b, x) char *b; double x; +#else +g_fmt(char *b, double x) +#endif +{ + char *s, *se; + int decpt, i, j, k, sign; + + if (!x) { + *b++ = '0'; + *b = 0; + return; + } + s = dtoa(x, 0, 0, &decpt, &sign, &se); + if (sign) + *b++ = '-'; + if (decpt == 9999) /* Infinity or Nan */ { + while(*b++ = *s++); + return; + } + if (decpt <= -4 || decpt > se - s + 5) { + *b++ = *s++; + if (*s) { + *b++ = '.'; + while(*b = *s++) + b++; + } + *b++ = 'e'; + /* sprintf(b, "%+.2d", decpt - 1); */ + if (--decpt < 0) { + *b++ = '-'; + decpt = -decpt; + } + else + *b++ = '+'; + for(j = 2, k = 10; 10*k <= decpt; j++, k *= 10){}; + for(;;) { + i = decpt / k; + *b++ = i + '0'; + if (--j <= 0) + break; + decpt -= i*k; + decpt *= 10; + } + *b = 0; + } + else if (decpt <= 0) { + *b++ = '.'; + for(; decpt < 0; decpt++) + *b++ = '0'; + while(*b++ = *s++); + } + else { + while(*b = *s++) { + b++; + if (--decpt == 0 && *s) + *b++ = '.'; + } + for(; decpt > 0; decpt--) + *b++ = '0'; + *b = 0; + } + } + + static void +baderrno(Void) +{ + fflush(stdout); + perror("\nerrno strtod"); + fflush(stderr); + } + +#define U (unsigned long) + + static void +#ifdef KR_headers +check(d) double d; +#else +check(double d) +#endif +{ + char buf[64]; + int decpt, sign; + char *s, *se; + double d1; + + s = dtoa(d, 0, 0, &decpt, &sign, &se); + sprintf(buf, "%s.%se%d", sign ? "-" : "", s, decpt); + errno = 0; + d1 = strtod(buf, (char **)0); + if (errno) + baderrno(); + if (d != d1) { + printf("sent d = %.17g = 0x%lx %lx, buf = %s\n", + d, U word0(d), U word1(d), buf); + printf("got d1 = %.17g = 0x%lx %lx\n", + d1, U word0(d1), U word1(d1)); + } + } + +main(Void){ + char buf[2048], buf1[32]; + char *fmt, *s, *se; + double d, d1; + int decpt, sign; + int mode = 0, ndigits = 17; + ULong x, y; +#ifdef VAX + ULong z; +#endif + + while(fgets(buf, sizeof(buf), stdin)) { + if (*buf == '*') { + printf("%s", buf); + continue; + } + printf("Input: %s", buf); + if (*buf == '#') { + x = word0(d); + y = word1(d); + sscanf(buf+1, "%lx %lx:%d %d", &x, &y, &mode, &ndigits); + word0(d) = x; + word1(d) = y; + fmt = "Output: d =\n%.17g = 0x%lx %lx\n"; + } + else { + errno = 0; + d = strtod(buf,&se); + if (*se == ':') + sscanf(se+1,"%d %d", &mode, &ndigits); + d1 = atof(buf); + fmt = "Output: d =\n%.17g = 0x%lx %lx, se = %s"; + if (errno) + baderrno(); + } + printf(fmt, d, U word0(d), U word1(d), se); + g_fmt(buf1, d); + printf("\tg_fmt gives \"%s\"\n", buf1); + if (*buf != '#' && d != d1) + printf("atof gives\n\ + d1 = %.17g = 0x%lx %lx\nversus\n\ + d = %.17g = 0x%lx %lx\n", d1, U word0(d1), U word1(d1), + d, U word0(d), U word1(d)); + check(d); + s = dtoa(d, mode, ndigits, &decpt, &sign, &se); + printf("\tdtoa(mode = %d, ndigits = %d):\n", mode, ndigits); + printf("\tdtoa returns sign = %d, decpt = %d, %d digits:\n%s\n", + sign, decpt, se-s, s); + x = word1(d); + if (x != 0xffffffff + && (word0(d) & 0x7ff00000) != 0x7ff00000) { +#ifdef VAX + z = x << 16 | x >> 16; + z++; + z = z << 16 | z >> 16; + word1(d) = z; +#else + word1(d) = x + 1; +#endif + printf("\tnextafter(d,+Inf) = %.17g = 0x%lx %lx:\n", + d, U word0(d), U word1(d)); + g_fmt(buf1, d); + printf("\tg_fmt gives \"%s\"\n", buf1); + s = dtoa(d, mode, ndigits, &decpt, &sign, &se); + printf( + "\tdtoa returns sign = %d, decpt = %d, %d digits:\n%s\n", + sign, decpt, se-s, s); + check(d); + } + if (x) { +#ifdef VAX + z = x << 16 | x >> 16; + z--; + z = z << 16 | z >> 16; + word1(d) = z; +#else + word1(d) = x - 1; +#endif + printf("\tnextafter(d,-Inf) = %.17g = 0x%lx %lx:\n", + d, U word0(d), U word1(d)); + g_fmt(buf1, d); + printf("\tg_fmt gives \"%s\"\n", buf1); + s = dtoa(d, mode, ndigits, &decpt, &sign, &se); + printf( + "\tdtoa returns sign = %d, decpt = %d, %d digits:\n%s\n", + sign, decpt, se-s, s); + check(d); + } + } + return 0; + } diff --git a/contrib/gdtoa/test/dtest.c b/contrib/gdtoa/test/dtest.c new file mode 100644 index 0000000..e07b1a8 --- /dev/null +++ b/contrib/gdtoa/test/dtest.c @@ -0,0 +1,146 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +/* Test program for g_dfmt, strtoId, strtod, strtopd, and strtord. + * + * Inputs (on stdin): + * r rounding_mode + * n ndig + * number + * #hex0 hex1 + * + * rounding_mode values: + * 0 = toward zero + * 1 = nearest + * 2 = toward +Infinity + * 3 = toward -Infinity + * + * where number is a decimal floating-point number, + * hex0 is a string of Hex <= 8 digits for the most significant + * word of the number, hex1 is a similar string for the other + * (least significant) word, and ndig is a parameters to g_dfmt. + */ + +#include "gdtoaimp.h" +#include <stdio.h> +#include <stdlib.h> + + extern int getround ANSI((int,char*)); + + static char ibuf[2048], obuf[1024]; + +#define U (unsigned long) + + int +main(Void) +{ + ULong *L; + char *s, *se, *se1; + double f, f1, fI[2]; + int i, i1, ndig = 0, r = 1; + long LL[2]; + + L = (ULong*)&f; + while( (s = fgets(ibuf, sizeof(ibuf), stdin)) !=0) { + while(*s <= ' ') + if (!*s++) + continue; + switch(*s) { + case 'r': + r = getround(r, s); + continue; + case 'n': + i = s[1]; + if (i <= ' ' || i >= '0' && i <= '9') { + ndig = atoi(s+1); + continue; + } + break; /* nan? */ + case '#': + LL[0] = L[_0]; + LL[1] = L[_1]; + sscanf(s+1, "%lx %lx", &LL[0], &LL[1]); + L[_0] = LL[0]; + L[_1] = LL[1]; + printf("\nInput: %s", ibuf); + printf("--> f = #%lx %lx\n", (long)L[_0], (long)L[_1]); + goto fmt_test; + } + printf("\nInput: %s", ibuf); + i = strtord(ibuf, &se, r, &f); + if (r == 1) { + if ((f != strtod(ibuf, &se1) || se1 != se)) + printf("***strtod and strtord disagree!!\n"); + i1 = strtopd(ibuf, &se, &f1); + if (i != i1 || f != f1 || se != se1) + printf("***strtord and strtopd disagree!!\n"); + } + printf("strtod consumes %d bytes and returns %d with f = %.17g = #%lx %lx\n", + (int)(se-ibuf), i, f, U L[_0], U L[_1]); + fmt_test: + se = g_dfmt(obuf, &f, ndig, sizeof(obuf)); + printf("g_dfmt(%d) gives %d bytes: \"%s\"\n\n", + ndig, (int)(se-obuf), se ? obuf : "<null>"); + if (*s == '#') + continue; + printf("strtoId returns %d,", strtoId(ibuf, &se, fI, &fI[1])); + printf(" consuming %d bytes.\n", (int)(se-ibuf)); + if (fI[0] == fI[1]) { + if (fI[0] == f) + printf("fI[0] == fI[1] == strtod\n"); + else + printf("fI[0] == fI[1] = #%lx %lx = %.17g\n", + U ((ULong*)fI)[_0], U ((ULong*)fI)[_1], + fI[0]); + } + else { + printf("fI[0] = #%lx %lx = %.17g\n", + U ((ULong*)fI)[_0], U ((ULong*)fI)[_1], fI[0]); + printf("fI[1] = #%lx %lx = %.17g\n", + U ((ULong*)&fI[1])[_0], U ((ULong*)&fI[1])[_1], + fI[1]); + if (fI[0] == f) + printf("fI[0] == strtod\n"); + else if (fI[1] == f) + printf("fI[1] == strtod\n"); + else + printf("**** Both differ from strtod ****\n"); + } + printf("\n"); + } + return 0; + } diff --git a/contrib/gdtoa/test/dtst.out b/contrib/gdtoa/test/dtst.out new file mode 100644 index 0000000..1ec70ab --- /dev/null +++ b/contrib/gdtoa/test/dtst.out @@ -0,0 +1,686 @@ +Input: 1.23 +Output: d = +1.23 = 0x3ff3ae14 7ae147ae, se = + g_fmt gives "1.23" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 1, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002 = 0x3ff3ae14 7ae147af: + g_fmt gives "1.2300000000000002" + dtoa returns sign = 0, decpt = 1, 17 digits: +12300000000000002 + nextafter(d,-Inf) = 1.2299999999999998 = 0x3ff3ae14 7ae147ad: + g_fmt gives "1.2299999999999998" + dtoa returns sign = 0, decpt = 1, 17 digits: +12299999999999998 +Input: 1.23e+20 +Output: d = +1.23e+20 = 0x441aabdf 2145b430, se = + g_fmt gives "1.23e+20" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 21, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e+20 = 0x441aabdf 2145b431: + g_fmt gives "123000000000000020000" + dtoa returns sign = 0, decpt = 21, 17 digits: +12300000000000002 + nextafter(d,-Inf) = 1.2299999999999998e+20 = 0x441aabdf 2145b42f: + g_fmt gives "122999999999999980000" + dtoa returns sign = 0, decpt = 21, 17 digits: +12299999999999998 +Input: 1.23e-20 +Output: d = +1.2300000000000001e-20 = 0x3bcd0ae4 cf767531, se = + g_fmt gives "1.23e-20" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -19, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e-20 = 0x3bcd0ae4 cf767532: + g_fmt gives "1.2300000000000002e-20" + dtoa returns sign = 0, decpt = -19, 17 digits: +12300000000000002 + nextafter(d,-Inf) = 1.2299999999999999e-20 = 0x3bcd0ae4 cf767530: + g_fmt gives "1.2299999999999999e-20" + dtoa returns sign = 0, decpt = -19, 17 digits: +12299999999999999 +Input: 1.23456789 +Output: d = +1.2345678899999999 = 0x3ff3c0ca 4283de1b, se = + g_fmt gives "1.23456789" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 1, 9 digits: +123456789 + nextafter(d,+Inf) = 1.2345678900000001 = 0x3ff3c0ca 4283de1c: + g_fmt gives "1.2345678900000001" + dtoa returns sign = 0, decpt = 1, 17 digits: +12345678900000001 + nextafter(d,-Inf) = 1.2345678899999997 = 0x3ff3c0ca 4283de1a: + g_fmt gives "1.2345678899999997" + dtoa returns sign = 0, decpt = 1, 17 digits: +12345678899999997 +Input: 1.23456589e+20 +Output: d = +1.23456589e+20 = 0x441ac537 a660b997, se = + g_fmt gives "1.23456589e+20" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 21, 9 digits: +123456589 + nextafter(d,+Inf) = 1.2345658900000001e+20 = 0x441ac537 a660b998: + g_fmt gives "123456589000000010000" + dtoa returns sign = 0, decpt = 21, 17 digits: +12345658900000001 + nextafter(d,-Inf) = 1.2345658899999998e+20 = 0x441ac537 a660b996: + g_fmt gives "123456588999999980000" + dtoa returns sign = 0, decpt = 21, 17 digits: +12345658899999998 +Input: 1.23e+30 +Output: d = +1.23e+30 = 0x462f0cb0 4e8fb790, se = + g_fmt gives "1.23e+30" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 31, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000001e+30 = 0x462f0cb0 4e8fb791: + g_fmt gives "1.2300000000000001e+30" + dtoa returns sign = 0, decpt = 31, 17 digits: +12300000000000001 + nextafter(d,-Inf) = 1.2299999999999998e+30 = 0x462f0cb0 4e8fb78f: + g_fmt gives "1.2299999999999998e+30" + dtoa returns sign = 0, decpt = 31, 17 digits: +12299999999999998 +Input: 1.23e-30 +Output: d = +1.2300000000000001e-30 = 0x39b8f286 6f5010ab, se = + g_fmt gives "1.23e-30" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -29, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e-30 = 0x39b8f286 6f5010ac: + g_fmt gives "1.2300000000000002e-30" + dtoa returns sign = 0, decpt = -29, 17 digits: +12300000000000002 + nextafter(d,-Inf) = 1.2299999999999999e-30 = 0x39b8f286 6f5010aa: + g_fmt gives "1.2299999999999999e-30" + dtoa returns sign = 0, decpt = -29, 17 digits: +12299999999999999 +Input: 1.23456789e-20 +Output: d = +1.2345678899999999e-20 = 0x3bcd2681 471e7ada, se = + g_fmt gives "1.23456789e-20" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -19, 9 digits: +123456789 + nextafter(d,+Inf) = 1.2345678900000001e-20 = 0x3bcd2681 471e7adb: + g_fmt gives "1.2345678900000001e-20" + dtoa returns sign = 0, decpt = -19, 17 digits: +12345678900000001 + nextafter(d,-Inf) = 1.2345678899999998e-20 = 0x3bcd2681 471e7ad9: + g_fmt gives "1.2345678899999998e-20" + dtoa returns sign = 0, decpt = -19, 17 digits: +12345678899999998 +Input: 1.23456789e-30 +Output: d = +1.23456789e-30 = 0x39b90a3e 33bbd995, se = + g_fmt gives "1.23456789e-30" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -29, 9 digits: +123456789 + nextafter(d,+Inf) = 1.2345678900000002e-30 = 0x39b90a3e 33bbd996: + g_fmt gives "1.2345678900000002e-30" + dtoa returns sign = 0, decpt = -29, 17 digits: +12345678900000002 + nextafter(d,-Inf) = 1.2345678899999998e-30 = 0x39b90a3e 33bbd994: + g_fmt gives "1.2345678899999998e-30" + dtoa returns sign = 0, decpt = -29, 17 digits: +12345678899999998 +Input: 1.234567890123456789 +Output: d = +1.2345678901234567 = 0x3ff3c0ca 428c59fb, se = + g_fmt gives "1.2345678901234567" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 1, 17 digits: +12345678901234567 + nextafter(d,+Inf) = 1.2345678901234569 = 0x3ff3c0ca 428c59fc: + g_fmt gives "1.234567890123457" + dtoa returns sign = 0, decpt = 1, 16 digits: +1234567890123457 + nextafter(d,-Inf) = 1.2345678901234565 = 0x3ff3c0ca 428c59fa: + g_fmt gives "1.2345678901234565" + dtoa returns sign = 0, decpt = 1, 17 digits: +12345678901234565 +Input: 1.23456789012345678901234567890123456789 +Output: d = +1.2345678901234567 = 0x3ff3c0ca 428c59fb, se = + g_fmt gives "1.2345678901234567" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 1, 17 digits: +12345678901234567 + nextafter(d,+Inf) = 1.2345678901234569 = 0x3ff3c0ca 428c59fc: + g_fmt gives "1.234567890123457" + dtoa returns sign = 0, decpt = 1, 16 digits: +1234567890123457 + nextafter(d,-Inf) = 1.2345678901234565 = 0x3ff3c0ca 428c59fa: + g_fmt gives "1.2345678901234565" + dtoa returns sign = 0, decpt = 1, 17 digits: +12345678901234565 +Input: 1.23e306 +Output: d = +1.23e+306 = 0x7f7c0676 cd1c61f5, se = + g_fmt gives "1.23e+306" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 307, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e+306 = 0x7f7c0676 cd1c61f6: + g_fmt gives "1.2300000000000002e+306" + dtoa returns sign = 0, decpt = 307, 17 digits: +12300000000000002 + nextafter(d,-Inf) = 1.2299999999999999e+306 = 0x7f7c0676 cd1c61f4: + g_fmt gives "1.2299999999999999e+306" + dtoa returns sign = 0, decpt = 307, 17 digits: +12299999999999999 +Input: 1.23e-306 +Output: d = +1.23e-306 = 0x6ba3b8 5da396e8, se = + g_fmt gives "1.23e-306" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -305, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e-306 = 0x6ba3b8 5da396e9: + g_fmt gives "1.2300000000000002e-306" + dtoa returns sign = 0, decpt = -305, 17 digits: +12300000000000002 + nextafter(d,-Inf) = 1.2299999999999999e-306 = 0x6ba3b8 5da396e7: + g_fmt gives "1.2299999999999999e-306" + dtoa returns sign = 0, decpt = -305, 17 digits: +12299999999999999 +Input: 1.23e-320 +Output: d = +1.2302234581447039e-320 = 0x0 9ba, se = + g_fmt gives "1.23e-320" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -319, 3 digits: +123 + nextafter(d,+Inf) = 1.2307175237905451e-320 = 0x0 9bb: + g_fmt gives "1.2307e-320" + dtoa returns sign = 0, decpt = -319, 5 digits: +12307 + nextafter(d,-Inf) = 1.2297293924988626e-320 = 0x0 9b9: + g_fmt gives "1.2297e-320" + dtoa returns sign = 0, decpt = -319, 5 digits: +12297 +Input: 1.23e-20 +Output: d = +1.2300000000000001e-20 = 0x3bcd0ae4 cf767531, se = + g_fmt gives "1.23e-20" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -19, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e-20 = 0x3bcd0ae4 cf767532: + g_fmt gives "1.2300000000000002e-20" + dtoa returns sign = 0, decpt = -19, 17 digits: +12300000000000002 + nextafter(d,-Inf) = 1.2299999999999999e-20 = 0x3bcd0ae4 cf767530: + g_fmt gives "1.2299999999999999e-20" + dtoa returns sign = 0, decpt = -19, 17 digits: +12299999999999999 +Input: 1.23456789e307 +Output: d = +1.23456789e+307 = 0x7fb194b1 4bdaecdc, se = + g_fmt gives "1.23456789e+307" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 308, 9 digits: +123456789 + nextafter(d,+Inf) = 1.2345678900000003e+307 = 0x7fb194b1 4bdaecdd: + g_fmt gives "1.2345678900000003e+307" + dtoa returns sign = 0, decpt = 308, 17 digits: +12345678900000003 + nextafter(d,-Inf) = 1.2345678899999998e+307 = 0x7fb194b1 4bdaecdb: + g_fmt gives "1.2345678899999998e+307" + dtoa returns sign = 0, decpt = 308, 17 digits: +12345678899999998 +Input: 1.23456589e-307 +Output: d = +1.2345658899999999e-307 = 0x363196 bb9845fa, se = + g_fmt gives "1.23456589e-307" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -306, 9 digits: +123456589 + nextafter(d,+Inf) = 1.2345658900000001e-307 = 0x363196 bb9845fb: + g_fmt gives "1.2345658900000001e-307" + dtoa returns sign = 0, decpt = -306, 17 digits: +12345658900000001 + nextafter(d,-Inf) = 1.2345658899999997e-307 = 0x363196 bb9845f9: + g_fmt gives "1.2345658899999997e-307" + dtoa returns sign = 0, decpt = -306, 17 digits: +12345658899999997 +Input: 1.234567890123456789 +Output: d = +1.2345678901234567 = 0x3ff3c0ca 428c59fb, se = + g_fmt gives "1.2345678901234567" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 1, 17 digits: +12345678901234567 + nextafter(d,+Inf) = 1.2345678901234569 = 0x3ff3c0ca 428c59fc: + g_fmt gives "1.234567890123457" + dtoa returns sign = 0, decpt = 1, 16 digits: +1234567890123457 + nextafter(d,-Inf) = 1.2345678901234565 = 0x3ff3c0ca 428c59fa: + g_fmt gives "1.2345678901234565" + dtoa returns sign = 0, decpt = 1, 17 digits: +12345678901234565 +Input: 1.234567890123456789e301 +Output: d = +1.2345678901234568e+301 = 0x7e726f51 75f56413, se = + g_fmt gives "1.2345678901234568e+301" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 302, 17 digits: +12345678901234568 + nextafter(d,+Inf) = 1.234567890123457e+301 = 0x7e726f51 75f56414: + g_fmt gives "1.234567890123457e+301" + dtoa returns sign = 0, decpt = 302, 16 digits: +1234567890123457 + nextafter(d,-Inf) = 1.2345678901234565e+301 = 0x7e726f51 75f56412: + g_fmt gives "1.2345678901234565e+301" + dtoa returns sign = 0, decpt = 302, 17 digits: +12345678901234565 +Input: 1.234567890123456789e-301 +Output: d = +1.2345678901234567e-301 = 0x1752a64 e34ba0d3, se = + g_fmt gives "1.2345678901234567e-301" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -300, 17 digits: +12345678901234567 + nextafter(d,+Inf) = 1.2345678901234569e-301 = 0x1752a64 e34ba0d4: + g_fmt gives "1.234567890123457e-301" + dtoa returns sign = 0, decpt = -300, 16 digits: +1234567890123457 + nextafter(d,-Inf) = 1.2345678901234565e-301 = 0x1752a64 e34ba0d2: + g_fmt gives "1.2345678901234565e-301" + dtoa returns sign = 0, decpt = -300, 17 digits: +12345678901234565 +Input: 1.234567890123456789e-321 +Output: d = +1.2351641146031164e-321 = 0x0 fa, se = + g_fmt gives "1.235e-321" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -320, 4 digits: +1235 + nextafter(d,+Inf) = 1.2401047710615288e-321 = 0x0 fb: + g_fmt gives "1.24e-321" + dtoa returns sign = 0, decpt = -320, 3 digits: +124 + nextafter(d,-Inf) = 1.2302234581447039e-321 = 0x0 f9: + g_fmt gives "1.23e-321" + dtoa returns sign = 0, decpt = -320, 3 digits: +123 +Input: 1e23 +Output: d = +9.9999999999999992e+22 = 0x44b52d02 c7e14af6, se = + g_fmt gives "1e+23" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 24, 1 digits: +1 + nextafter(d,+Inf) = 1.0000000000000001e+23 = 0x44b52d02 c7e14af7: + g_fmt gives "1.0000000000000001e+23" + dtoa returns sign = 0, decpt = 24, 17 digits: +10000000000000001 + nextafter(d,-Inf) = 9.9999999999999975e+22 = 0x44b52d02 c7e14af5: + g_fmt gives "9.999999999999997e+22" + dtoa returns sign = 0, decpt = 23, 16 digits: +9999999999999997 +Input: 1e310 + +errno strtod: Result too large +Output: d = +Infinity = 0x7ff00000 0, se = + g_fmt gives "Infinity" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = 9999, 8 digits: +Infinity +Input: 9.0259718793241475e-277 +Output: d = +9.0259718793241479e-277 = 0x6a00000 0, se = + g_fmt gives "9.025971879324148e-277" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -276, 16 digits: +9025971879324148 + nextafter(d,+Inf) = 9.0259718793241499e-277 = 0x6a00000 1: + g_fmt gives "9.02597187932415e-277" + dtoa returns sign = 0, decpt = -276, 15 digits: +902597187932415 +Input: 9.025971879324147880346310405869e-277 +Output: d = +9.0259718793241479e-277 = 0x6a00000 0, se = + g_fmt gives "9.025971879324148e-277" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -276, 16 digits: +9025971879324148 + nextafter(d,+Inf) = 9.0259718793241499e-277 = 0x6a00000 1: + g_fmt gives "9.02597187932415e-277" + dtoa returns sign = 0, decpt = -276, 15 digits: +902597187932415 +Input: 9.025971879324147880346310405868e-277 +Output: d = +9.0259718793241479e-277 = 0x6a00000 0, se = + g_fmt gives "9.025971879324148e-277" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -276, 16 digits: +9025971879324148 + nextafter(d,+Inf) = 9.0259718793241499e-277 = 0x6a00000 1: + g_fmt gives "9.02597187932415e-277" + dtoa returns sign = 0, decpt = -276, 15 digits: +902597187932415 +Input: 2.2250738585072014e-308 +Output: d = +2.2250738585072014e-308 = 0x100000 0, se = + g_fmt gives "2.2250738585072014e-308" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -307, 17 digits: +22250738585072014 + nextafter(d,+Inf) = 2.2250738585072019e-308 = 0x100000 1: + g_fmt gives "2.225073858507202e-308" + dtoa returns sign = 0, decpt = -307, 16 digits: +2225073858507202 +Input: 2.2250738585072013e-308 +Output: d = +2.2250738585072014e-308 = 0x100000 0, se = + g_fmt gives "2.2250738585072014e-308" + dtoa(mode = 0, ndigits = 17): + dtoa returns sign = 0, decpt = -307, 17 digits: +22250738585072014 + nextafter(d,+Inf) = 2.2250738585072019e-308 = 0x100000 1: + g_fmt gives "2.225073858507202e-308" + dtoa returns sign = 0, decpt = -307, 16 digits: +2225073858507202 +Input: 1.23:2 6 +Output: d = +1.23 = 0x3ff3ae14 7ae147ae, se = :2 6 + g_fmt gives "1.23" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = 1, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002 = 0x3ff3ae14 7ae147af: + g_fmt gives "1.2300000000000002" + dtoa returns sign = 0, decpt = 1, 3 digits: +123 + nextafter(d,-Inf) = 1.2299999999999998 = 0x3ff3ae14 7ae147ad: + g_fmt gives "1.2299999999999998" + dtoa returns sign = 0, decpt = 1, 3 digits: +123 +Input: 1.23:4 6 +Output: d = +1.23 = 0x3ff3ae14 7ae147ae, se = :4 6 + g_fmt gives "1.23" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = 1, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002 = 0x3ff3ae14 7ae147af: + g_fmt gives "1.2300000000000002" + dtoa returns sign = 0, decpt = 1, 3 digits: +123 + nextafter(d,-Inf) = 1.2299999999999998 = 0x3ff3ae14 7ae147ad: + g_fmt gives "1.2299999999999998" + dtoa returns sign = 0, decpt = 1, 3 digits: +123 +Input: 1.23e+20:2 6 +Output: d = +1.23e+20 = 0x441aabdf 2145b430, se = :2 6 + g_fmt gives "1.23e+20" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = 21, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e+20 = 0x441aabdf 2145b431: + g_fmt gives "123000000000000020000" + dtoa returns sign = 0, decpt = 21, 3 digits: +123 + nextafter(d,-Inf) = 1.2299999999999998e+20 = 0x441aabdf 2145b42f: + g_fmt gives "122999999999999980000" + dtoa returns sign = 0, decpt = 21, 3 digits: +123 +Input: 1.23e+20:4 6 +Output: d = +1.23e+20 = 0x441aabdf 2145b430, se = :4 6 + g_fmt gives "1.23e+20" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = 21, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e+20 = 0x441aabdf 2145b431: + g_fmt gives "123000000000000020000" + dtoa returns sign = 0, decpt = 21, 3 digits: +123 + nextafter(d,-Inf) = 1.2299999999999998e+20 = 0x441aabdf 2145b42f: + g_fmt gives "122999999999999980000" + dtoa returns sign = 0, decpt = 21, 3 digits: +123 +Input: 1.23e-20:2 6 +Output: d = +1.2300000000000001e-20 = 0x3bcd0ae4 cf767531, se = :2 6 + g_fmt gives "1.23e-20" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = -19, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e-20 = 0x3bcd0ae4 cf767532: + g_fmt gives "1.2300000000000002e-20" + dtoa returns sign = 0, decpt = -19, 3 digits: +123 + nextafter(d,-Inf) = 1.2299999999999999e-20 = 0x3bcd0ae4 cf767530: + g_fmt gives "1.2299999999999999e-20" + dtoa returns sign = 0, decpt = -19, 3 digits: +123 +Input: 1.23e-20:4 6 +Output: d = +1.2300000000000001e-20 = 0x3bcd0ae4 cf767531, se = :4 6 + g_fmt gives "1.23e-20" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = -19, 3 digits: +123 + nextafter(d,+Inf) = 1.2300000000000002e-20 = 0x3bcd0ae4 cf767532: + g_fmt gives "1.2300000000000002e-20" + dtoa returns sign = 0, decpt = -19, 3 digits: +123 + nextafter(d,-Inf) = 1.2299999999999999e-20 = 0x3bcd0ae4 cf767530: + g_fmt gives "1.2299999999999999e-20" + dtoa returns sign = 0, decpt = -19, 3 digits: +123 +Input: 1.23456789:2 6 +Output: d = +1.2345678899999999 = 0x3ff3c0ca 4283de1b, se = :2 6 + g_fmt gives "1.23456789" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = 1, 6 digits: +123457 + nextafter(d,+Inf) = 1.2345678900000001 = 0x3ff3c0ca 4283de1c: + g_fmt gives "1.2345678900000001" + dtoa returns sign = 0, decpt = 1, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345678899999997 = 0x3ff3c0ca 4283de1a: + g_fmt gives "1.2345678899999997" + dtoa returns sign = 0, decpt = 1, 6 digits: +123457 +Input: 1.23456789:4 6 +Output: d = +1.2345678899999999 = 0x3ff3c0ca 4283de1b, se = :4 6 + g_fmt gives "1.23456789" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = 1, 6 digits: +123457 + nextafter(d,+Inf) = 1.2345678900000001 = 0x3ff3c0ca 4283de1c: + g_fmt gives "1.2345678900000001" + dtoa returns sign = 0, decpt = 1, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345678899999997 = 0x3ff3c0ca 4283de1a: + g_fmt gives "1.2345678899999997" + dtoa returns sign = 0, decpt = 1, 6 digits: +123457 +Input: 1.23456589e+20:2 6 +Output: d = +1.23456589e+20 = 0x441ac537 a660b997, se = :2 6 + g_fmt gives "1.23456589e+20" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = 21, 6 digits: +123457 + nextafter(d,+Inf) = 1.2345658900000001e+20 = 0x441ac537 a660b998: + g_fmt gives "123456589000000010000" + dtoa returns sign = 0, decpt = 21, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345658899999998e+20 = 0x441ac537 a660b996: + g_fmt gives "123456588999999980000" + dtoa returns sign = 0, decpt = 21, 6 digits: +123457 +Input: 1.23456589e+20:4 6 +Output: d = +1.23456589e+20 = 0x441ac537 a660b997, se = :4 6 + g_fmt gives "1.23456589e+20" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = 21, 6 digits: +123457 + nextafter(d,+Inf) = 1.2345658900000001e+20 = 0x441ac537 a660b998: + g_fmt gives "123456589000000010000" + dtoa returns sign = 0, decpt = 21, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345658899999998e+20 = 0x441ac537 a660b996: + g_fmt gives "123456588999999980000" + dtoa returns sign = 0, decpt = 21, 6 digits: +123457 +Input: 1.23456789e-20:2 6 +Output: d = +1.2345678899999999e-20 = 0x3bcd2681 471e7ada, se = :2 6 + g_fmt gives "1.23456789e-20" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = -19, 6 digits: +123457 + nextafter(d,+Inf) = 1.2345678900000001e-20 = 0x3bcd2681 471e7adb: + g_fmt gives "1.2345678900000001e-20" + dtoa returns sign = 0, decpt = -19, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345678899999998e-20 = 0x3bcd2681 471e7ad9: + g_fmt gives "1.2345678899999998e-20" + dtoa returns sign = 0, decpt = -19, 6 digits: +123457 +Input: 1.23456789e-20:4 6 +Output: d = +1.2345678899999999e-20 = 0x3bcd2681 471e7ada, se = :4 6 + g_fmt gives "1.23456789e-20" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = -19, 6 digits: +123457 + nextafter(d,+Inf) = 1.2345678900000001e-20 = 0x3bcd2681 471e7adb: + g_fmt gives "1.2345678900000001e-20" + dtoa returns sign = 0, decpt = -19, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345678899999998e-20 = 0x3bcd2681 471e7ad9: + g_fmt gives "1.2345678899999998e-20" + dtoa returns sign = 0, decpt = -19, 6 digits: +123457 +Input: 1234565:2 6 +Output: d = +1234565 = 0x4132d685 0, se = :2 6 + g_fmt gives "1234565" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = 7, 6 digits: +123456 + nextafter(d,+Inf) = 1234565.0000000002 = 0x4132d685 1: + g_fmt gives "1234565.0000000002" + dtoa returns sign = 0, decpt = 7, 6 digits: +123457 +Input: 1234565:4 6 +Output: d = +1234565 = 0x4132d685 0, se = :4 6 + g_fmt gives "1234565" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = 7, 6 digits: +123456 + nextafter(d,+Inf) = 1234565.0000000002 = 0x4132d685 1: + g_fmt gives "1234565.0000000002" + dtoa returns sign = 0, decpt = 7, 6 digits: +123457 +Input: 1.234565:2 6 +Output: d = +1.2345649999999999 = 0x3ff3c0c7 3abc9470, se = :2 6 + g_fmt gives "1.234565" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = 1, 6 digits: +123456 + nextafter(d,+Inf) = 1.2345650000000001 = 0x3ff3c0c7 3abc9471: + g_fmt gives "1.2345650000000001" + dtoa returns sign = 0, decpt = 1, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345649999999997 = 0x3ff3c0c7 3abc946f: + g_fmt gives "1.2345649999999997" + dtoa returns sign = 0, decpt = 1, 6 digits: +123456 +Input: 1.234565:4 6 +Output: d = +1.2345649999999999 = 0x3ff3c0c7 3abc9470, se = :4 6 + g_fmt gives "1.234565" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = 1, 6 digits: +123456 + nextafter(d,+Inf) = 1.2345650000000001 = 0x3ff3c0c7 3abc9471: + g_fmt gives "1.2345650000000001" + dtoa returns sign = 0, decpt = 1, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345649999999997 = 0x3ff3c0c7 3abc946f: + g_fmt gives "1.2345649999999997" + dtoa returns sign = 0, decpt = 1, 6 digits: +123456 +Input: 1.234565e+20:2 6 +Output: d = +1.234565e+20 = 0x441ac536 6299040d, se = :2 6 + g_fmt gives "1.234565e+20" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = 21, 6 digits: +123456 + nextafter(d,+Inf) = 1.2345650000000002e+20 = 0x441ac536 6299040e: + g_fmt gives "123456500000000020000" + dtoa returns sign = 0, decpt = 21, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345649999999998e+20 = 0x441ac536 6299040c: + g_fmt gives "123456499999999980000" + dtoa returns sign = 0, decpt = 21, 6 digits: +123456 +Input: 1.234565e+20:4 6 +Output: d = +1.234565e+20 = 0x441ac536 6299040d, se = :4 6 + g_fmt gives "1.234565e+20" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = 21, 6 digits: +123456 + nextafter(d,+Inf) = 1.2345650000000002e+20 = 0x441ac536 6299040e: + g_fmt gives "123456500000000020000" + dtoa returns sign = 0, decpt = 21, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345649999999998e+20 = 0x441ac536 6299040c: + g_fmt gives "123456499999999980000" + dtoa returns sign = 0, decpt = 21, 6 digits: +123456 +Input: 1.234565e-20:2 6 +Output: d = +1.234565e-20 = 0x3bcd267c ce45a93f, se = :2 6 + g_fmt gives "1.234565e-20" + dtoa(mode = 2, ndigits = 6): + dtoa returns sign = 0, decpt = -19, 6 digits: +123456 + nextafter(d,+Inf) = 1.2345650000000001e-20 = 0x3bcd267c ce45a940: + g_fmt gives "1.2345650000000001e-20" + dtoa returns sign = 0, decpt = -19, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345649999999998e-20 = 0x3bcd267c ce45a93e: + g_fmt gives "1.2345649999999998e-20" + dtoa returns sign = 0, decpt = -19, 6 digits: +123456 +Input: 1.234565e-20:4 6 +Output: d = +1.234565e-20 = 0x3bcd267c ce45a93f, se = :4 6 + g_fmt gives "1.234565e-20" + dtoa(mode = 4, ndigits = 6): + dtoa returns sign = 0, decpt = -19, 6 digits: +123456 + nextafter(d,+Inf) = 1.2345650000000001e-20 = 0x3bcd267c ce45a940: + g_fmt gives "1.2345650000000001e-20" + dtoa returns sign = 0, decpt = -19, 6 digits: +123457 + nextafter(d,-Inf) = 1.2345649999999998e-20 = 0x3bcd267c ce45a93e: + g_fmt gives "1.2345649999999998e-20" + dtoa returns sign = 0, decpt = -19, 6 digits: +123456 diff --git a/contrib/gdtoa/test/f.out b/contrib/gdtoa/test/f.out new file mode 100644 index 0000000..ca8d6eb --- /dev/null +++ b/contrib/gdtoa/test/f.out @@ -0,0 +1,968 @@ + +Input: 1.23 +strtof consumes 4 bytes and returns 1.23 = #3f9d70a4 +g_ffmt(0) gives 4 bytes: "1.23" + +strtoIf returns 33, consuming 4 bytes. +fI[0] = #3f9d70a3 = 1.2299999 +fI[1] = #3f9d70a4 = 1.23 +fI[1] == strtof + + +Input: 1.23e+20 +strtof consumes 8 bytes and returns 1.23e+20 = #60d55ef9 +g_ffmt(0) gives 8 bytes: "1.23e+20" + +strtoIf returns 17, consuming 8 bytes. +fI[0] = #60d55ef9 = 1.23e+20 +fI[1] = #60d55efa = 1.2300001e+20 +fI[0] == strtof + + +Input: 1.23e-20 +strtof consumes 8 bytes and returns 1.23e-20 = #1e685726 +g_ffmt(0) gives 8 bytes: "1.23e-20" + +strtoIf returns 17, consuming 8 bytes. +fI[0] = #1e685726 = 1.23e-20 +fI[1] = #1e685727 = 1.23e-20 +fI[0] == strtof + + +Input: 1.23456789 +strtof consumes 10 bytes and returns 1.2345679 = #3f9e0652 +g_ffmt(0) gives 9 bytes: "1.2345679" + +strtoIf returns 17, consuming 10 bytes. +fI[0] = #3f9e0652 = 1.2345679 +fI[1] = #3f9e0653 = 1.234568 +fI[0] == strtof + + +Input: 1.23456589e+20 +strtof consumes 14 bytes and returns 1.2345659e+20 = #60d629bd +g_ffmt(0) gives 13 bytes: "1.2345659e+20" + +strtoIf returns 17, consuming 14 bytes. +fI[0] = #60d629bd = 1.2345659e+20 +fI[1] = #60d629be = 1.234566e+20 +fI[0] == strtof + + +Input: 1.23e+30 +strtof consumes 8 bytes and returns 1.23e+30 = #71786582 +g_ffmt(0) gives 8 bytes: "1.23e+30" + +strtoIf returns 17, consuming 8 bytes. +fI[0] = #71786582 = 1.23e+30 +fI[1] = #71786583 = 1.23e+30 +fI[0] == strtof + + +Input: 1.23e-30 +strtof consumes 8 bytes and returns 1.23e-30 = #dc79433 +g_ffmt(0) gives 8 bytes: "1.23e-30" + +strtoIf returns 17, consuming 8 bytes. +fI[0] = #dc79433 = 1.23e-30 +fI[1] = #dc79434 = 1.23e-30 +fI[0] == strtof + + +Input: 1.23456789e-20 +strtof consumes 14 bytes and returns 1.2345679e-20 = #1e69340a +g_ffmt(0) gives 13 bytes: "1.2345679e-20" + +strtoIf returns 17, consuming 14 bytes. +fI[0] = #1e69340a = 1.2345679e-20 +fI[1] = #1e69340b = 1.234568e-20 +fI[0] == strtof + + +Input: 1.23456789e-30 +strtof consumes 14 bytes and returns 1.2345679e-30 = #dc851f2 +g_ffmt(0) gives 13 bytes: "1.2345679e-30" + +strtoIf returns 33, consuming 14 bytes. +fI[0] = #dc851f1 = 1.2345678e-30 +fI[1] = #dc851f2 = 1.2345679e-30 +fI[1] == strtof + + +Input: 1.234567890123456789 +strtof consumes 20 bytes and returns 1.2345679 = #3f9e0652 +g_ffmt(0) gives 9 bytes: "1.2345679" + +strtoIf returns 17, consuming 20 bytes. +fI[0] = #3f9e0652 = 1.2345679 +fI[1] = #3f9e0653 = 1.234568 +fI[0] == strtof + + +Input: 1.23456789012345678901234567890123456789 +strtof consumes 40 bytes and returns 1.2345679 = #3f9e0652 +g_ffmt(0) gives 9 bytes: "1.2345679" + +strtoIf returns 17, consuming 40 bytes. +fI[0] = #3f9e0652 = 1.2345679 +fI[1] = #3f9e0653 = 1.234568 +fI[0] == strtof + + +Input: 1.23e306 +strtof consumes 8 bytes and returns Infinity = #7f800000 +g_ffmt(0) gives 8 bytes: "Infinity" + +strtoIf returns 163, consuming 8 bytes. +fI[0] = #7f7fffff = 3.4028235e+38 +fI[1] = #7f800000 = Infinity +fI[1] == strtof + + +Input: 1.23e-306 +strtof consumes 9 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 9 bytes. +fI[0] == fI[1] == strtof + + +Input: 1.23e-320 +strtof consumes 9 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 9 bytes. +fI[0] == fI[1] == strtof + + +Input: 1.23e-20 +strtof consumes 8 bytes and returns 1.23e-20 = #1e685726 +g_ffmt(0) gives 8 bytes: "1.23e-20" + +strtoIf returns 17, consuming 8 bytes. +fI[0] = #1e685726 = 1.23e-20 +fI[1] = #1e685727 = 1.23e-20 +fI[0] == strtof + + +Input: 1.23456789e307 +strtof consumes 14 bytes and returns Infinity = #7f800000 +g_ffmt(0) gives 8 bytes: "Infinity" + +strtoIf returns 163, consuming 14 bytes. +fI[0] = #7f7fffff = 3.4028235e+38 +fI[1] = #7f800000 = Infinity +fI[1] == strtof + + +Input: 1.23456589e-307 +strtof consumes 15 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 15 bytes. +fI[0] == fI[1] == strtof + + +Input: 1.234567890123456789 +strtof consumes 20 bytes and returns 1.2345679 = #3f9e0652 +g_ffmt(0) gives 9 bytes: "1.2345679" + +strtoIf returns 17, consuming 20 bytes. +fI[0] = #3f9e0652 = 1.2345679 +fI[1] = #3f9e0653 = 1.234568 +fI[0] == strtof + + +Input: 1.234567890123456789e301 +strtof consumes 24 bytes and returns Infinity = #7f800000 +g_ffmt(0) gives 8 bytes: "Infinity" + +strtoIf returns 163, consuming 24 bytes. +fI[0] = #7f7fffff = 3.4028235e+38 +fI[1] = #7f800000 = Infinity +fI[1] == strtof + + +Input: 1.234567890123456789e-301 +strtof consumes 25 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 25 bytes. +fI[0] == fI[1] == strtof + + +Input: 1.234567890123456789e-321 +strtof consumes 25 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 25 bytes. +fI[0] == fI[1] == strtof + + +Input: 1e23 +strtof consumes 4 bytes and returns 9.9999998e+22 = #65a96816 +g_ffmt(0) gives 5 bytes: "1e+23" + +strtoIf returns 17, consuming 4 bytes. +fI[0] = #65a96816 = 9.9999998e+22 +fI[1] = #65a96817 = 1.0000001e+23 +fI[0] == strtof + + +Input: 1e310 +strtof consumes 5 bytes and returns Infinity = #7f800000 +g_ffmt(0) gives 8 bytes: "Infinity" + +strtoIf returns 163, consuming 5 bytes. +fI[0] = #7f7fffff = 3.4028235e+38 +fI[1] = #7f800000 = Infinity +fI[1] == strtof + + +Input: 9.0259718793241475e-277 +strtof consumes 23 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 23 bytes. +fI[0] == fI[1] == strtof + + +Input: 9.025971879324147880346310405869e-277 +strtof consumes 37 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 37 bytes. +fI[0] == fI[1] == strtof + + +Input: 9.025971879324147880346310405868e-277 +strtof consumes 37 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 37 bytes. +fI[0] == fI[1] == strtof + + +Input: 2.2250738585072014e-308 +strtof consumes 23 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 23 bytes. +fI[0] == fI[1] == strtof + + +Input: 2.2250738585072013e-308 +strtof consumes 23 bytes and returns 0 = #0 +g_ffmt(0) gives 1 bytes: "0" + +strtoIf returns 80, consuming 23 bytes. +fI[0] == fI[1] == strtof + +Rounding mode for strtor... changed from 1 (nearest) to 0 (toward zero) + +Input: 1.1 +strtof consumes 3 bytes and returns 1.0999999 = #3f8ccccc +g_ffmt(0) gives 9 bytes: "1.0999999" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3f8ccccc = 1.0999999 +fI[1] = #3f8ccccd = 1.1 +fI[0] == strtof + + +Input: -1.1 +strtof consumes 4 bytes and returns -1.0999999 = #bf8ccccc +g_ffmt(0) gives 10 bytes: "-1.0999999" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bf8ccccd = -1.1 +fI[1] = #bf8ccccc = -1.0999999 +fI[1] == strtof + + +Input: 1.2 +strtof consumes 3 bytes and returns 1.1999999 = #3f999999 +g_ffmt(0) gives 9 bytes: "1.1999999" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3f999999 = 1.1999999 +fI[1] = #3f99999a = 1.2 +fI[0] == strtof + + +Input: -1.2 +strtof consumes 4 bytes and returns -1.1999999 = #bf999999 +g_ffmt(0) gives 10 bytes: "-1.1999999" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bf99999a = -1.2 +fI[1] = #bf999999 = -1.1999999 +fI[1] == strtof + + +Input: 1.3 +strtof consumes 3 bytes and returns 1.3 = #3fa66666 +g_ffmt(0) gives 3 bytes: "1.3" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fa66666 = 1.3 +fI[1] = #3fa66667 = 1.3000001 +fI[0] == strtof + + +Input: -1.3 +strtof consumes 4 bytes and returns -1.3 = #bfa66666 +g_ffmt(0) gives 4 bytes: "-1.3" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfa66667 = -1.3000001 +fI[1] = #bfa66666 = -1.3 +fI[1] == strtof + + +Input: 1.4 +strtof consumes 3 bytes and returns 1.4 = #3fb33333 +g_ffmt(0) gives 3 bytes: "1.4" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fb33333 = 1.4 +fI[1] = #3fb33334 = 1.4000001 +fI[0] == strtof + + +Input: -1.4 +strtof consumes 4 bytes and returns -1.4 = #bfb33333 +g_ffmt(0) gives 4 bytes: "-1.4" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfb33334 = -1.4000001 +fI[1] = #bfb33333 = -1.4 +fI[1] == strtof + + +Input: 1.5 +strtof consumes 3 bytes and returns 1.5 = #3fc00000 +g_ffmt(0) gives 3 bytes: "1.5" + +strtoIf returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtof + + +Input: -1.5 +strtof consumes 4 bytes and returns -1.5 = #bfc00000 +g_ffmt(0) gives 4 bytes: "-1.5" + +strtoIf returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtof + + +Input: 1.6 +strtof consumes 3 bytes and returns 1.5999999 = #3fcccccc +g_ffmt(0) gives 9 bytes: "1.5999999" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3fcccccc = 1.5999999 +fI[1] = #3fcccccd = 1.6 +fI[0] == strtof + + +Input: -1.6 +strtof consumes 4 bytes and returns -1.5999999 = #bfcccccc +g_ffmt(0) gives 10 bytes: "-1.5999999" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bfcccccd = -1.6 +fI[1] = #bfcccccc = -1.5999999 +fI[1] == strtof + + +Input: 1.7 +strtof consumes 3 bytes and returns 1.6999999 = #3fd99999 +g_ffmt(0) gives 9 bytes: "1.6999999" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3fd99999 = 1.6999999 +fI[1] = #3fd9999a = 1.7 +fI[0] == strtof + + +Input: -1.7 +strtof consumes 4 bytes and returns -1.6999999 = #bfd99999 +g_ffmt(0) gives 10 bytes: "-1.6999999" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bfd9999a = -1.7 +fI[1] = #bfd99999 = -1.6999999 +fI[1] == strtof + + +Input: 1.8 +strtof consumes 3 bytes and returns 1.8 = #3fe66666 +g_ffmt(0) gives 3 bytes: "1.8" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fe66666 = 1.8 +fI[1] = #3fe66667 = 1.8000001 +fI[0] == strtof + + +Input: -1.8 +strtof consumes 4 bytes and returns -1.8 = #bfe66666 +g_ffmt(0) gives 4 bytes: "-1.8" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfe66667 = -1.8000001 +fI[1] = #bfe66666 = -1.8 +fI[1] == strtof + + +Input: 1.9 +strtof consumes 3 bytes and returns 1.9 = #3ff33333 +g_ffmt(0) gives 3 bytes: "1.9" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3ff33333 = 1.9 +fI[1] = #3ff33334 = 1.9000001 +fI[0] == strtof + + +Input: -1.9 +strtof consumes 4 bytes and returns -1.9 = #bff33333 +g_ffmt(0) gives 4 bytes: "-1.9" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bff33334 = -1.9000001 +fI[1] = #bff33333 = -1.9 +fI[1] == strtof + +Rounding mode for strtor... changed from 0 (toward zero) to 1 (nearest) + +Input: 1.1 +strtof consumes 3 bytes and returns 1.1 = #3f8ccccd +g_ffmt(0) gives 3 bytes: "1.1" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3f8ccccc = 1.0999999 +fI[1] = #3f8ccccd = 1.1 +fI[1] == strtof + + +Input: -1.1 +strtof consumes 4 bytes and returns -1.1 = #bf8ccccd +g_ffmt(0) gives 4 bytes: "-1.1" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bf8ccccd = -1.1 +fI[1] = #bf8ccccc = -1.0999999 +fI[0] == strtof + + +Input: 1.2 +strtof consumes 3 bytes and returns 1.2 = #3f99999a +g_ffmt(0) gives 3 bytes: "1.2" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3f999999 = 1.1999999 +fI[1] = #3f99999a = 1.2 +fI[1] == strtof + + +Input: -1.2 +strtof consumes 4 bytes and returns -1.2 = #bf99999a +g_ffmt(0) gives 4 bytes: "-1.2" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bf99999a = -1.2 +fI[1] = #bf999999 = -1.1999999 +fI[0] == strtof + + +Input: 1.3 +strtof consumes 3 bytes and returns 1.3 = #3fa66666 +g_ffmt(0) gives 3 bytes: "1.3" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fa66666 = 1.3 +fI[1] = #3fa66667 = 1.3000001 +fI[0] == strtof + + +Input: -1.3 +strtof consumes 4 bytes and returns -1.3 = #bfa66666 +g_ffmt(0) gives 4 bytes: "-1.3" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfa66667 = -1.3000001 +fI[1] = #bfa66666 = -1.3 +fI[1] == strtof + + +Input: 1.4 +strtof consumes 3 bytes and returns 1.4 = #3fb33333 +g_ffmt(0) gives 3 bytes: "1.4" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fb33333 = 1.4 +fI[1] = #3fb33334 = 1.4000001 +fI[0] == strtof + + +Input: -1.4 +strtof consumes 4 bytes and returns -1.4 = #bfb33333 +g_ffmt(0) gives 4 bytes: "-1.4" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfb33334 = -1.4000001 +fI[1] = #bfb33333 = -1.4 +fI[1] == strtof + + +Input: 1.5 +strtof consumes 3 bytes and returns 1.5 = #3fc00000 +g_ffmt(0) gives 3 bytes: "1.5" + +strtoIf returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtof + + +Input: -1.5 +strtof consumes 4 bytes and returns -1.5 = #bfc00000 +g_ffmt(0) gives 4 bytes: "-1.5" + +strtoIf returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtof + + +Input: 1.6 +strtof consumes 3 bytes and returns 1.6 = #3fcccccd +g_ffmt(0) gives 3 bytes: "1.6" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3fcccccc = 1.5999999 +fI[1] = #3fcccccd = 1.6 +fI[1] == strtof + + +Input: -1.6 +strtof consumes 4 bytes and returns -1.6 = #bfcccccd +g_ffmt(0) gives 4 bytes: "-1.6" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bfcccccd = -1.6 +fI[1] = #bfcccccc = -1.5999999 +fI[0] == strtof + + +Input: 1.7 +strtof consumes 3 bytes and returns 1.7 = #3fd9999a +g_ffmt(0) gives 3 bytes: "1.7" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3fd99999 = 1.6999999 +fI[1] = #3fd9999a = 1.7 +fI[1] == strtof + + +Input: -1.7 +strtof consumes 4 bytes and returns -1.7 = #bfd9999a +g_ffmt(0) gives 4 bytes: "-1.7" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bfd9999a = -1.7 +fI[1] = #bfd99999 = -1.6999999 +fI[0] == strtof + + +Input: 1.8 +strtof consumes 3 bytes and returns 1.8 = #3fe66666 +g_ffmt(0) gives 3 bytes: "1.8" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fe66666 = 1.8 +fI[1] = #3fe66667 = 1.8000001 +fI[0] == strtof + + +Input: -1.8 +strtof consumes 4 bytes and returns -1.8 = #bfe66666 +g_ffmt(0) gives 4 bytes: "-1.8" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfe66667 = -1.8000001 +fI[1] = #bfe66666 = -1.8 +fI[1] == strtof + + +Input: 1.9 +strtof consumes 3 bytes and returns 1.9 = #3ff33333 +g_ffmt(0) gives 3 bytes: "1.9" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3ff33333 = 1.9 +fI[1] = #3ff33334 = 1.9000001 +fI[0] == strtof + + +Input: -1.9 +strtof consumes 4 bytes and returns -1.9 = #bff33333 +g_ffmt(0) gives 4 bytes: "-1.9" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bff33334 = -1.9000001 +fI[1] = #bff33333 = -1.9 +fI[1] == strtof + +Rounding mode for strtor... changed from 1 (nearest) to 2 (toward +Infinity) + +Input: 1.1 +strtof consumes 3 bytes and returns 1.1 = #3f8ccccd +g_ffmt(0) gives 3 bytes: "1.1" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3f8ccccc = 1.0999999 +fI[1] = #3f8ccccd = 1.1 +fI[1] == strtof + + +Input: -1.1 +strtof consumes 4 bytes and returns -1.0999999 = #bf8ccccc +g_ffmt(0) gives 10 bytes: "-1.0999999" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bf8ccccd = -1.1 +fI[1] = #bf8ccccc = -1.0999999 +fI[1] == strtof + + +Input: 1.2 +strtof consumes 3 bytes and returns 1.2 = #3f99999a +g_ffmt(0) gives 3 bytes: "1.2" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3f999999 = 1.1999999 +fI[1] = #3f99999a = 1.2 +fI[1] == strtof + + +Input: -1.2 +strtof consumes 4 bytes and returns -1.1999999 = #bf999999 +g_ffmt(0) gives 10 bytes: "-1.1999999" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bf99999a = -1.2 +fI[1] = #bf999999 = -1.1999999 +fI[1] == strtof + + +Input: 1.3 +strtof consumes 3 bytes and returns 1.3000001 = #3fa66667 +g_ffmt(0) gives 9 bytes: "1.3000001" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fa66666 = 1.3 +fI[1] = #3fa66667 = 1.3000001 +fI[1] == strtof + + +Input: -1.3 +strtof consumes 4 bytes and returns -1.3 = #bfa66666 +g_ffmt(0) gives 4 bytes: "-1.3" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfa66667 = -1.3000001 +fI[1] = #bfa66666 = -1.3 +fI[1] == strtof + + +Input: 1.4 +strtof consumes 3 bytes and returns 1.4000001 = #3fb33334 +g_ffmt(0) gives 9 bytes: "1.4000001" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fb33333 = 1.4 +fI[1] = #3fb33334 = 1.4000001 +fI[1] == strtof + + +Input: -1.4 +strtof consumes 4 bytes and returns -1.4 = #bfb33333 +g_ffmt(0) gives 4 bytes: "-1.4" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfb33334 = -1.4000001 +fI[1] = #bfb33333 = -1.4 +fI[1] == strtof + + +Input: 1.5 +strtof consumes 3 bytes and returns 1.5 = #3fc00000 +g_ffmt(0) gives 3 bytes: "1.5" + +strtoIf returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtof + + +Input: -1.5 +strtof consumes 4 bytes and returns -1.5 = #bfc00000 +g_ffmt(0) gives 4 bytes: "-1.5" + +strtoIf returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtof + + +Input: 1.6 +strtof consumes 3 bytes and returns 1.6 = #3fcccccd +g_ffmt(0) gives 3 bytes: "1.6" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3fcccccc = 1.5999999 +fI[1] = #3fcccccd = 1.6 +fI[1] == strtof + + +Input: -1.6 +strtof consumes 4 bytes and returns -1.5999999 = #bfcccccc +g_ffmt(0) gives 10 bytes: "-1.5999999" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bfcccccd = -1.6 +fI[1] = #bfcccccc = -1.5999999 +fI[1] == strtof + + +Input: 1.7 +strtof consumes 3 bytes and returns 1.7 = #3fd9999a +g_ffmt(0) gives 3 bytes: "1.7" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3fd99999 = 1.6999999 +fI[1] = #3fd9999a = 1.7 +fI[1] == strtof + + +Input: -1.7 +strtof consumes 4 bytes and returns -1.6999999 = #bfd99999 +g_ffmt(0) gives 10 bytes: "-1.6999999" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bfd9999a = -1.7 +fI[1] = #bfd99999 = -1.6999999 +fI[1] == strtof + + +Input: 1.8 +strtof consumes 3 bytes and returns 1.8000001 = #3fe66667 +g_ffmt(0) gives 9 bytes: "1.8000001" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fe66666 = 1.8 +fI[1] = #3fe66667 = 1.8000001 +fI[1] == strtof + + +Input: -1.8 +strtof consumes 4 bytes and returns -1.8 = #bfe66666 +g_ffmt(0) gives 4 bytes: "-1.8" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfe66667 = -1.8000001 +fI[1] = #bfe66666 = -1.8 +fI[1] == strtof + + +Input: 1.9 +strtof consumes 3 bytes and returns 1.9000001 = #3ff33334 +g_ffmt(0) gives 9 bytes: "1.9000001" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3ff33333 = 1.9 +fI[1] = #3ff33334 = 1.9000001 +fI[1] == strtof + + +Input: -1.9 +strtof consumes 4 bytes and returns -1.9 = #bff33333 +g_ffmt(0) gives 4 bytes: "-1.9" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bff33334 = -1.9000001 +fI[1] = #bff33333 = -1.9 +fI[1] == strtof + +Rounding mode for strtor... changed from 2 (toward +Infinity) to 3 (toward -Infinity) + +Input: 1.1 +strtof consumes 3 bytes and returns 1.0999999 = #3f8ccccc +g_ffmt(0) gives 9 bytes: "1.0999999" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3f8ccccc = 1.0999999 +fI[1] = #3f8ccccd = 1.1 +fI[0] == strtof + + +Input: -1.1 +strtof consumes 4 bytes and returns -1.1 = #bf8ccccd +g_ffmt(0) gives 4 bytes: "-1.1" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bf8ccccd = -1.1 +fI[1] = #bf8ccccc = -1.0999999 +fI[0] == strtof + + +Input: 1.2 +strtof consumes 3 bytes and returns 1.1999999 = #3f999999 +g_ffmt(0) gives 9 bytes: "1.1999999" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3f999999 = 1.1999999 +fI[1] = #3f99999a = 1.2 +fI[0] == strtof + + +Input: -1.2 +strtof consumes 4 bytes and returns -1.2 = #bf99999a +g_ffmt(0) gives 4 bytes: "-1.2" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bf99999a = -1.2 +fI[1] = #bf999999 = -1.1999999 +fI[0] == strtof + + +Input: 1.3 +strtof consumes 3 bytes and returns 1.3 = #3fa66666 +g_ffmt(0) gives 3 bytes: "1.3" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fa66666 = 1.3 +fI[1] = #3fa66667 = 1.3000001 +fI[0] == strtof + + +Input: -1.3 +strtof consumes 4 bytes and returns -1.3000001 = #bfa66667 +g_ffmt(0) gives 10 bytes: "-1.3000001" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfa66667 = -1.3000001 +fI[1] = #bfa66666 = -1.3 +fI[0] == strtof + + +Input: 1.4 +strtof consumes 3 bytes and returns 1.4 = #3fb33333 +g_ffmt(0) gives 3 bytes: "1.4" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fb33333 = 1.4 +fI[1] = #3fb33334 = 1.4000001 +fI[0] == strtof + + +Input: -1.4 +strtof consumes 4 bytes and returns -1.4000001 = #bfb33334 +g_ffmt(0) gives 10 bytes: "-1.4000001" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfb33334 = -1.4000001 +fI[1] = #bfb33333 = -1.4 +fI[0] == strtof + + +Input: 1.5 +strtof consumes 3 bytes and returns 1.5 = #3fc00000 +g_ffmt(0) gives 3 bytes: "1.5" + +strtoIf returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtof + + +Input: -1.5 +strtof consumes 4 bytes and returns -1.5 = #bfc00000 +g_ffmt(0) gives 4 bytes: "-1.5" + +strtoIf returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtof + + +Input: 1.6 +strtof consumes 3 bytes and returns 1.5999999 = #3fcccccc +g_ffmt(0) gives 9 bytes: "1.5999999" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3fcccccc = 1.5999999 +fI[1] = #3fcccccd = 1.6 +fI[0] == strtof + + +Input: -1.6 +strtof consumes 4 bytes and returns -1.6 = #bfcccccd +g_ffmt(0) gives 4 bytes: "-1.6" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bfcccccd = -1.6 +fI[1] = #bfcccccc = -1.5999999 +fI[0] == strtof + + +Input: 1.7 +strtof consumes 3 bytes and returns 1.6999999 = #3fd99999 +g_ffmt(0) gives 9 bytes: "1.6999999" + +strtoIf returns 33, consuming 3 bytes. +fI[0] = #3fd99999 = 1.6999999 +fI[1] = #3fd9999a = 1.7 +fI[0] == strtof + + +Input: -1.7 +strtof consumes 4 bytes and returns -1.7 = #bfd9999a +g_ffmt(0) gives 4 bytes: "-1.7" + +strtoIf returns 41, consuming 4 bytes. +fI[0] = #bfd9999a = -1.7 +fI[1] = #bfd99999 = -1.6999999 +fI[0] == strtof + + +Input: 1.8 +strtof consumes 3 bytes and returns 1.8 = #3fe66666 +g_ffmt(0) gives 3 bytes: "1.8" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3fe66666 = 1.8 +fI[1] = #3fe66667 = 1.8000001 +fI[0] == strtof + + +Input: -1.8 +strtof consumes 4 bytes and returns -1.8000001 = #bfe66667 +g_ffmt(0) gives 10 bytes: "-1.8000001" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bfe66667 = -1.8000001 +fI[1] = #bfe66666 = -1.8 +fI[0] == strtof + + +Input: 1.9 +strtof consumes 3 bytes and returns 1.9 = #3ff33333 +g_ffmt(0) gives 3 bytes: "1.9" + +strtoIf returns 17, consuming 3 bytes. +fI[0] = #3ff33333 = 1.9 +fI[1] = #3ff33334 = 1.9000001 +fI[0] == strtof + + +Input: -1.9 +strtof consumes 4 bytes and returns -1.9000001 = #bff33334 +g_ffmt(0) gives 10 bytes: "-1.9000001" + +strtoIf returns 25, consuming 4 bytes. +fI[0] = #bff33334 = -1.9000001 +fI[1] = #bff33333 = -1.9 +fI[0] == strtof + diff --git a/contrib/gdtoa/test/ftest.c b/contrib/gdtoa/test/ftest.c new file mode 100644 index 0000000..afafe85 --- /dev/null +++ b/contrib/gdtoa/test/ftest.c @@ -0,0 +1,146 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +/* Test program for g_ffmt, strtof, strtoIf, strtopf, and strtorf. + * + * Inputs (on stdin): + * r rounding_mode + * n ndig + * number + * #hex + * + * rounding_mode values: + * 0 = toward zero + * 1 = nearest + * 2 = toward +Infinity + * 3 = toward -Infinity + * + * where number is a decimal floating-point number, + * hex is a string of <= 8 Hex digits for the internal representation + * of the number, and ndig is a parameters to g_ffmt. + */ + +#include "gdtoa.h" +#include <stdio.h> +#include <stdlib.h> + + extern int getround ANSI((int,char*)); + + static char ibuf[2048], obuf[1024]; + +#define U (unsigned long) + + int +main(Void) +{ + ULong *L; + char *s, *se, *se1; + int dItry, i, i1, ndig = 0, r = 1; + float f, f1, fI[2]; + + L = (ULong*)&f; + while( (s = fgets(ibuf, sizeof(ibuf), stdin)) !=0) { + while(*s <= ' ') + if (!*s++) + continue; + dItry = 0; + switch(*s) { + case 'r': + r = getround(r, s); + continue; + case 'n': + i = s[1]; + if (i <= ' ' || i >= '0' && i <= '9') { + ndig = atoi(s+1); + continue; + } + break; /* nan? */ + case '#': + sscanf(s+1, "%lx", &L[0]); + printf("\nInput: %s", ibuf); + printf(" --> f = #%lx\n", L[0]); + goto fmt_test; + } + dItry = 1; + printf("\nInput: %s", ibuf); + i = strtorf(ibuf, &se, r, &f); + if (r == 1) { + if (f != (i1 = strtopf(ibuf, &se1, &f1), f1) + || se != se1 || i != i1) { + printf("***strtopf and strtorf disagree!!\n"); + if (f != f1) + printf("\tf1 = %g\n", (double)f1); + if (i != i1) + printf("\ti = %d but i1 = %d\n", i, i1); + if (se != se1) + printf("se - se1 = %d\n", (int)(se-se1)); + } + if (f != strtof(ibuf, &se1) || se != se1) + printf("***strtof and strtorf disagree!\n"); + } + printf("strtof consumes %d bytes and returns %.8g = #%lx\n", + (int)(se-ibuf), f, U *(ULong*)&f); + fmt_test: + se = g_ffmt(obuf, &f, ndig, sizeof(obuf)); + printf("g_ffmt(%d) gives %d bytes: \"%s\"\n\n", + ndig, (int)(se-obuf), se ? obuf : "<null>"); + if (!dItry) + continue; + printf("strtoIf returns %d,", strtoIf(ibuf, &se, fI, &fI[1])); + printf(" consuming %d bytes.\n", (int)(se-ibuf)); + if (fI[0] == fI[1]) { + if (fI[0] == f) + printf("fI[0] == fI[1] == strtof\n"); + else + printf("fI[0] == fI[1] = #%lx = %.8g\n", + U *(ULong*)fI, fI[0]); + } + else { + printf("fI[0] = #%lx = %.8g\nfI[1] = #%lx = %.8g\n", + U *(ULong*)fI, fI[0], + U *(ULong*)&fI[1], fI[1]); + if (fI[0] == f) + printf("fI[0] == strtof\n"); + else if (fI[1] == f) + printf("fI[1] == strtof\n"); + else + printf("**** Both differ from strtof ****\n"); + } + printf("\n"); + } + return 0; + } diff --git a/contrib/gdtoa/test/getround.c b/contrib/gdtoa/test/getround.c new file mode 100644 index 0000000..ec1ca11 --- /dev/null +++ b/contrib/gdtoa/test/getround.c @@ -0,0 +1,68 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +#include <stdio.h> +#include <stdlib.h> + +static char *dir[4] = { "toward zero", "nearest", "toward +Infinity", + "toward -Infinity" }; + + int +#ifdef KR_headers +getround(r, s) int r; char *s; +#else +getround(int r, char *s) +#endif +{ + int i; + + i = atoi(s+1); + if (i >= 0 && i < 4) { + printf("Rounding mode for strtor... "); + if (i == r) + printf("was and is %d (%s)\n", i, dir[i]); + else + printf("changed from %d (%s) to %d (%s)\n", + r, dir[r], i, dir[i]); + return i; + } + printf("Bad rounding direction %d: choose among\n", i); + for(i = 0; i < 4; i++) + printf("\t%d (%s)\n", i, dir[i]); + printf("Leaving rounding mode for strtor... at %d (%s)\n", r, dir[r]); + return r; + } diff --git a/contrib/gdtoa/test/makefile b/contrib/gdtoa/test/makefile new file mode 100644 index 0000000..7e48915 --- /dev/null +++ b/contrib/gdtoa/test/makefile @@ -0,0 +1,135 @@ +# /**************************************************************** +# Copyright (C) 1998, 2000 by Lucent Technologies +# All Rights Reserved +# +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose and without fee is hereby +# granted, provided that the above copyright notice appear in all +# copies and that both that the copyright notice and this +# permission notice and warranty disclaimer appear in supporting +# documentation, and that the name of Lucent or any of its entities +# not be used in advertising or publicity pertaining to +# distribution of the software without specific, written prior +# permission. +# +# LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +# IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +# THIS SOFTWARE. +# +# ****************************************************************/ + +.SUFFIXES: .c .o +CC = cc +CFLAGS = -g -I.. +A = ../gdtoa.a + +.c.o: + $(CC) -c $(CFLAGS) $*.c + +all: dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi tests + +dt = dt.o $A +dt: $(dt) + $(CC) -o dt $(dt) + +dItest = dItest.o getround.o $A +dItest: $(dItest) + $(CC) -o dItest $(dItest) + +ddtest = ddtest.o getround.o $A +ddtest: $(ddtest) + $(CC) -o ddtest $(ddtest) + +dtest = dtest.o getround.o $A +dtest: $(dtest) + $(CC) -o dtest $(dtest) + +ftest = ftest.o getround.o $A +ftest: $(ftest) + $(CC) -o ftest $(ftest) + +Qtest = Qtest.o getround.o $A +Qtest: $(Qtest) + $(CC) -o Qtest $(Qtest) + +xtest = xtest.o getround.o $A +xtest: $(xtest) + $(CC) -o xtest $(xtest) + +xLtest = xLtest.o getround.o $A +xLtest: $(xLtest) + $(CC) -o xLtest $(xLtest) + +strtopddSI.o: strtopddSI.c ../strtopdd.c + +strtorddSI.o: strtorddSI.c ../strtordd.c + +strtodISI.o: strtodISI.c ../strtodI.c + +strtoIddSI.o: strtoIddSI.c ../strtoIdd.c + +strtoIdSI.o: strtoIdSI.c ../strtoId.c + +ddtestsi = ddtest.o strtopddSI.o strtorddSI.o strtoIddSI.o getround.o $A +ddtestsi: $(ddtestsi) + $(CC) -o ddtestsi $(ddtestsi) + +dItestsi = dItest.o strtodISI.o strtoIdSI.o getround.o $A +dItestsi: $(dItestsi) + $(CC) -o dItestsi $(dItestsi) + +strtodt = strtodt.o $A +strtodt: $(strtodt) + $(CC) -o strtodt $(strtodt) + +# xQtest generates cp commands that depend on sizeof(long double). +# See the source for details. If you know better, create Q.out, +# x.out and xL.out by copying the relevant *.ou0 or *.ou1 files +# to the corresponding .out files. In short, the *.ou0 files are +# for long double == double; x.ou1 and xL.ou1 are for +# long double == extended (a la 80x87 and MC680x0), and Q.ou1 is +# for long double == quad. + +Q.out x.out xL.out: + $(CC) -o xQtest xQtest.c + ./xQtest | sh + rm -f xQtest xQtest.o + +## The rmdir below will fail if any test results differ. + +tests: Q.out x.out xL.out dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi strtodt + mkdir bad + cat testnos testnos1 | ./dt >zap 2>&1 + cmp dtst.out zap || mv zap bad/dtst.out + ./dItest <testnos >zap 2>&1 + cmp dI.out zap || mv zap bad/dI.out + ./dItestsi <testnos >zap 2>&1 + cmp dIsi.out zap || mv zap bad/dIsi.out + ./ddtestsi <testnos >zap 2>&1 + cmp ddsi.out zap || mv zap bad/ddsi.out + for i in dd d f x xL Q; do cat testnos rtestnos | \ + ./"$$i"test >zap 2>&1;\ + cmp $$i.out zap || mv zap bad/$$i.out; done + ./strtodt testnos3 >bad/strtodt.out && rm bad/strtodt.out || \ + cat bad/strtodt.out + rmdir bad + touch tests + +xs0 = README Qtest.c dItest.c ddtest.c dtest.c dt.c ftest.c getround.c \ + strtoIdSI.c strtoIddSI.c strtodISI.c strtodt.c strtopddSI.c \ + strtorddSI.c xLtest.c xQtest.c xtest.c rtestnos testnos testnos1 \ + testnos3 dI.out dIsi.out ddsi.out dd.out dtst.out d.out f.out \ + x.ou0 xL.ou0 x.ou1 xL.ou1 Q.ou0 Q.ou1 makefile + +xsum.out: xsum0.out $(xs0) + xsum $(xs0) >xsum1.out + cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out + +clean: + rm -f *.[ao] dt *test *testsi strtodt xsum.out xsum1.out tests zap x.out xL.out Q.out + rm -rf bad diff --git a/contrib/gdtoa/test/rtestnos b/contrib/gdtoa/test/rtestnos new file mode 100644 index 0000000..cde95b7 --- /dev/null +++ b/contrib/gdtoa/test/rtestnos @@ -0,0 +1,76 @@ +r0 +1.1 +-1.1 +1.2 +-1.2 +1.3 +-1.3 +1.4 +-1.4 +1.5 +-1.5 +1.6 +-1.6 +1.7 +-1.7 +1.8 +-1.8 +1.9 +-1.9 +r1 +1.1 +-1.1 +1.2 +-1.2 +1.3 +-1.3 +1.4 +-1.4 +1.5 +-1.5 +1.6 +-1.6 +1.7 +-1.7 +1.8 +-1.8 +1.9 +-1.9 +r2 +1.1 +-1.1 +1.2 +-1.2 +1.3 +-1.3 +1.4 +-1.4 +1.5 +-1.5 +1.6 +-1.6 +1.7 +-1.7 +1.8 +-1.8 +1.9 +-1.9 +r3 +1.1 +-1.1 +1.2 +-1.2 +1.3 +-1.3 +1.4 +-1.4 +1.5 +-1.5 +1.6 +-1.6 +1.7 +-1.7 +1.8 +-1.8 +1.9 +-1.9 diff --git a/contrib/gdtoa/test/strtoIdSI.c b/contrib/gdtoa/test/strtoIdSI.c new file mode 100644 index 0000000..c5342ed --- /dev/null +++ b/contrib/gdtoa/test/strtoIdSI.c @@ -0,0 +1,2 @@ +#define Sudden_Underflow +#include "../strtoId.c" diff --git a/contrib/gdtoa/test/strtoIddSI.c b/contrib/gdtoa/test/strtoIddSI.c new file mode 100644 index 0000000..2966259 --- /dev/null +++ b/contrib/gdtoa/test/strtoIddSI.c @@ -0,0 +1,2 @@ +#define Sudden_Underflow +#include "../strtoIdd.c" diff --git a/contrib/gdtoa/test/strtodISI.c b/contrib/gdtoa/test/strtodISI.c new file mode 100644 index 0000000..66d2add --- /dev/null +++ b/contrib/gdtoa/test/strtodISI.c @@ -0,0 +1,2 @@ +#define Sudden_Underflow +#include "../strtodI.c" diff --git a/contrib/gdtoa/test/strtodt.c b/contrib/gdtoa/test/strtodt.c new file mode 100644 index 0000000..da74660 --- /dev/null +++ b/contrib/gdtoa/test/strtodt.c @@ -0,0 +1,140 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +/* Test strtod. */ + +/* On stdin, read triples: d x y: + * d = decimal string + * x = high-order Hex value expected from strtod + * y = low-order Hex value + * Complain about errors. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + static int W0, W1; + typedef union { + double d; + long L[2]; + } U; + + static int +process(char *fname, FILE *f) +{ + U a, b; + char buf[2048]; + double d; + char *s; + int line, n; + + line = n = 0; + + top: + while(fgets(s = buf, sizeof(buf), f)) { + line++; + while(*s <= ' ') + if (!*s++) + goto top; /* break 2 */ + if (*s == '#') + continue; + while(*s > ' ') + s++; + if (sscanf(s,"\t%lx\t%lx", &a.L[0], &a.L[1]) != 2) { + printf("Badly formatted line %d of %s\n", + line, fname); + n++; + continue; + } + b.d = strtod(buf,0); + if (b.L[W0] != a.L[0] || b.L[W1] != a.L[1]) { + n++; + printf("Line %d of %s: got %lx %lx; expected %lx %lx\n", + line, fname, b.L[W0], b.L[W1], a.L[0], a.L[1]); + } + } + return n; + } + + int +main(int argc, char **argv) +{ + FILE *f; + char *prog, *s; + int n, rc; + U u; + + prog = argv[0]; + if (argc == 2 && !strcmp(argv[1],"-?")) { + fprintf(stderr, "Usage: %s [file [file...]]\n" + "\tto read data file(s) of tab-separated triples d x y with\n" + "\t\td decimal string\n" + "\t\tx = high-order Hex value expected from strtod\n" + "\t\ty = low-order Hex value\n" + "\tComplain about errors by strtod.\n" + "\tIf no files, read triples from stdin.\n", + prog); + return 0; + } + + /* determine endian-ness */ + + u.d = 1.; + W0 = u.L[0] == 0; + W1 = 1 - W0; + + /* test */ + + n = rc = 0; + if (argc <= 1) + n = process("<stdin>", stdin); + else + while(s = *++argv) + if (f = fopen(s,"r")) { + n += process(s, f); + fclose(f); + } + else { + rc = 2; + fprintf(stderr, "Cannot open %s\n", s); + } + printf("%d bad conversions\n", n); + if (n) + rc |= 1; + return rc; + } diff --git a/contrib/gdtoa/test/strtopddSI.c b/contrib/gdtoa/test/strtopddSI.c new file mode 100644 index 0000000..d2004e5 --- /dev/null +++ b/contrib/gdtoa/test/strtopddSI.c @@ -0,0 +1,2 @@ +#define Sudden_Underflow +#include "../strtopdd.c" diff --git a/contrib/gdtoa/test/strtorddSI.c b/contrib/gdtoa/test/strtorddSI.c new file mode 100644 index 0000000..dd6a381 --- /dev/null +++ b/contrib/gdtoa/test/strtorddSI.c @@ -0,0 +1,2 @@ +#define Sudden_Underflow +#include "../strtordd.c" diff --git a/contrib/gdtoa/test/testnos b/contrib/gdtoa/test/testnos new file mode 100644 index 0000000..a36a986 --- /dev/null +++ b/contrib/gdtoa/test/testnos @@ -0,0 +1,28 @@ +1.23 +1.23e+20 +1.23e-20 +1.23456789 +1.23456589e+20 +1.23e+30 +1.23e-30 +1.23456789e-20 +1.23456789e-30 +1.234567890123456789 +1.23456789012345678901234567890123456789 +1.23e306 +1.23e-306 +1.23e-320 +1.23e-20 +1.23456789e307 +1.23456589e-307 +1.234567890123456789 +1.234567890123456789e301 +1.234567890123456789e-301 +1.234567890123456789e-321 +1e23 +1e310 +9.0259718793241475e-277 +9.025971879324147880346310405869e-277 +9.025971879324147880346310405868e-277 +2.2250738585072014e-308 +2.2250738585072013e-308 diff --git a/contrib/gdtoa/test/testnos1 b/contrib/gdtoa/test/testnos1 new file mode 100644 index 0000000..d734b35 --- /dev/null +++ b/contrib/gdtoa/test/testnos1 @@ -0,0 +1,20 @@ +1.23:2 6 +1.23:4 6 +1.23e+20:2 6 +1.23e+20:4 6 +1.23e-20:2 6 +1.23e-20:4 6 +1.23456789:2 6 +1.23456789:4 6 +1.23456589e+20:2 6 +1.23456589e+20:4 6 +1.23456789e-20:2 6 +1.23456789e-20:4 6 +1234565:2 6 +1234565:4 6 +1.234565:2 6 +1.234565:4 6 +1.234565e+20:2 6 +1.234565e+20:4 6 +1.234565e-20:2 6 +1.234565e-20:4 6 diff --git a/contrib/gdtoa/test/testnos3 b/contrib/gdtoa/test/testnos3 new file mode 100644 index 0000000..be48902 --- /dev/null +++ b/contrib/gdtoa/test/testnos3 @@ -0,0 +1,328 @@ +# Test triples for strtodt, derived from Fred Tydeman's posting +# of 26 February 1996 to comp.arch.arithmetic. + +9e0306 7fa9a202 8368022e +4e-079 2fa7b6d7 1d20b96c +7e-261 9eb8d7e 32be6396 +6e-025 3ae7361c b863de62 +7e-161 1eaf7e0d b3799aa3 +7e0289 7c1cbb54 7777a285 +5e0079 507afcef 51f0fb5f +1e0080 508afcef 51f0fb5f +7e-303 1333391 31c46f8b +5e0152 5fa317e5 ef3ab327 +5e0125 5a07a2ec c414a03f +2e0126 5a27a2ec c414a03f +7e-141 22d5570f 59bd178c +4e-192 18323ff0 6eea847a +9e0043 49102498 ea6df0c4 +1e0303 7ed754e3 1cd072da +95e-089 2dde3cbc 9907fdc8 +85e0194 689d1c26 db7d0dae +69e0267 77c0b7cb 60c994da +97e-019 3c665dde 8e688ba6 +37e0046 49d033d7 eca0adef +74e0046 49e033d7 eca0adef +61e-099 2bc0ad83 6f269a17 +53e-208 151b39ae 1909c31b +93e-234 fc27b2e 4f210075 +79e-095 2c9a5db8 12948281 +87e-274 772d36c f48e7abd +83e0025 4585747a b143e353 +17e-036 38b698cc dc60015a +53e0033 47246a34 18629ef6 +51e-074 30ecd5be e57763e6 +63e-022 3bbdc03b 8fd7016a +839e0143 5e3ae03f 245703e2 +749e-182 1abf1472 7744c63e +999e-026 3b282782 afe1869e +345e0266 77b0b7cb 60c994da +914e-102 2b5ffc81 bc29f02b +829e0102 55b7221a 79cdd1d9 +307e0090 5322d6b1 83fe4b55 +859e0182 6654374d 8b87ac63 +283e0085 5216c309 24bab4b +589e0187 675526be 9c22eb17 +302e0176 64fdcf7d f8f573b7 +604e0176 650dcf7d f8f573b7 +761e-244 de03cea 3586452e +647e0230 7044d64d 4079150c +755e0174 64a7d931 93f78fc6 +255e-075 30dcd5be e57763e6 +3391e0055 4c159bd3 ad46e346 +4147e-015 3d923d1b 5eb1d778 +3996e-026 3b482782 afe1869e +1998e-026 3b382782 afe1869e +3338e-296 335519a c5142aab +1669e-296 325519a c5142aab +8699e-276 772d2df 246ecd2d +5311e0243 73284e91 f4aa0fdb +7903e-096 2cd07c2d 27a5b989 +7611e-226 11d19b87 44033457 +3257e0058 4cb444b3 4a6fb3eb +6514e0058 4cc444b3 4a6fb3eb +3571e0263 77462644 c61d41aa +7142e0263 77562644 c61d41aa +5311e0242 72f3720e 5d54d97c +1617e-063 3384c98f ce16152e +51881e0037 4897d295 dc76da4 +31441e-118 285ef890 f5de4c86 +30179e0079 5143e272 a77478e8 +60358e0079 5153e272 a77478e8 +63876e-020 3cc70385 6844bdbf +31938e-020 3cb70385 6844bdbf +46073e-032 3a42405b 773fbdf3 +32941e0051 4b757eb8 ad52a5c9 +82081e0041 49770105 df3d47cb +38701e-215 1440492a 4a8a37fd +62745e0047 4ab0c52f e6dc6a1b +12549e0048 4ac0c52f e6dc6a1b +64009e-183 1af099b3 93b84832 +89275e0261 77262644 c61d41aa +75859e0025 46232645 e1ba93f0 +57533e0287 7c8272ed 2307f56a +584169e0229 70ad6570 59dc79aa +940189e-112 29eb99d6 240c1a28 +416121e0197 6a00fd07 ed297f80 +832242e0197 6a10fd07 ed297f80 +584738e0076 50e8a85e b277e645 +933587e-140 241b2487 28b9c117 +252601e0121 5a2dda59 2e398dd7 +358423e0274 79f9463b 59b8f2bd +892771e-213 14f25818 c7294f27 +410405e0040 49670105 df3d47cb +928609e-261 afbe2dd 66200bef +302276e-254 c55a462 d91c6ab3 +920657e-023 3c653a99 85dbde6c +609019e-025 3bf1f99e 11ea0a24 +252601e0120 59f7e1e0 f1c7a4ac +654839e-060 34b00e7d b3b3f242 +8823691e0130 5c5e597c b94b7ae +2920845e0228 709d6570 59dc79aa +9210917e0080 51fda232 347e6032 +5800419e-303 26e58ff a48f4fce +6119898e-243 ee3ecf2 2ea07863 +3059949e-243 ed3ecf2 2ea07863 +2572231e0223 6f90f73b e1dff9ad +5444097e-021 3cf8849d d33c95af +5783893e-127 26f7e590 2ce0e151 +3865421e-225 1295d4fe 53afec65 +4590831e0156 61b4689b 4a5fa201 +9181662e0156 61c4689b 4a5fa201 +5906361e-027 3bbbe45a 312d08a0 +7315057e0235 7225f0d4 8362a72 +9088115e0106 5762e51a 84a3c6a0 +1817623e0107 5772e51a 84a3c6a0 +44118455e0129 5c4e597c b94b7ae +35282041e0293 7e5512d5 273e62e8 +31279898e-291 5129b01 b6885d36 +15639949e-291 5029b01 b6885d36 +27966061e0145 5f955bcf 72fd10f9 +55932122e0145 5fa55bcf 72fd10f9 +70176353e-053 36900683 a21de855 +40277543e-032 3adf29ca ff893b1 +50609263e0157 622193af f1f1c8e3 +66094077e0077 518b37c4 b7928317 +84863171e0114 59406e98 f5ec8f37 +89396333e0264 786526f0 61ca9053 +87575437e-309 16e0732 602056c +78693511e-044 3870bc7b 7603a2ca +90285923e-206 16d14700 83f89d48 +30155207e-030 3b423a4a d20748a2 +245540327e0121 5acc569e 968e0944 +263125459e0287 7d44997a 298b2f2e +566446538e-257 c64472b a9550e86 +283223269e-257 c54472b a9550e86 +245540327e0122 5b01b623 1e18c5cb +491080654e0122 5b11b623 1e18c5cb +971212611e-126 27a397d3 c9745d2f +229058583e0052 4c76ce94 febdc7a5 +325270231e0039 49cc7ccf 90c9f8ab +989648089e-035 3a8880a3 d515e849 +653777767e0273 7a720223 f2b3a881 +923091487e0209 6d30bc60 e6896717 +526250918e0288 7d89bfd8 b3edfafa +350301748e-309 18e0732 602056c +741111169e-203 17a14fe7 daf8f3ae +667284113e-240 ff09355 f8050c02 +1227701635e0120 5abc569e 968e0944 +9981396317e-182 1c38afe1 a2a66aa +5232604057e-298 41465b8 96c24520 +5572170023e-088 2fb08478 22f765b2 +1964322616e0122 5b31b623 1e18c5cb +3928645232e0122 5b41b623 1e18c5cb +8715380633e-058 35f4614c 3219891f +4856063055e-127 279397d3 c9745d2f +8336960483e-153 223a06a1 24b95e1 +1007046393e-155 21a01891 fc4717fd +5378822089e-176 1d695fd4 c88d4b1b +5981342308e-190 1a83db11 ac608107 +7214782613e-086 3020b552 d2edcdea +5458466829e0142 5f70acde 6a98eb4c +9078555839e-109 2b5fc575 867314ee +6418488827e0079 526021f1 4ed7b3fa +65325840981e0069 5081a151 ddbd3c4a +49573485983e0089 54a221bd 871d2cf4 +46275205733e0074 51830e6c 7d4e3480 +92550411466e0074 51930e6c 7d4e3480 +41129842097e-202 1832c3e7 2d179607 +93227267727e-049 380960fe 8d5847f +41297294357e0185 688c4943 7fccfadb +41534892987e-067 343a1266 6477886d +42333842451e0201 6be0189a 26df575f +78564021519e-227 13115551 5fd37265 +53587107423e-061 35800a19 a3ffd981 +53827010643e-200 18a32fa6 9a69bd6d +83356057653e0193 6a4544e6 daee2a18 +45256834646e-118 29a541ec dfd48694 +45392779195e-110 2b4fc575 867314ee +23934638219e0291 7e81deaf 40ead9a0 +995779191233e0113 59e2d44e dcc51304 +997422852243e-265 b676688 faee99bc +653532977297e-123 28d925a0 aabcdc68 +938885684947e0147 60f11894 b202e9f4 +619534293513e0124 5c210c20 303fe0f1 +539879452414e-042 39a5e66d c3d6bdb5 +742522891517e0259 782c1c35 2fc3c309 +254901016865e-022 3dbc06d3 66394441 +685763015669e0280 7c85fd7a a44d9477 +384865004907e-285 72aa65b 58639e69 +286556458711e0081 5321958b 36c5102b +573112917422e0081 5331958b 36c5102b +769525178383e-150 234253ec e161420 +416780288265e0192 6a3544e6 daee2a18 +226963895975e-111 2b3fc575 867314ee +665592809339e0063 4f778b65 16c2b478 +3891901811465e0217 6f99ab82 61990292 +4764593340755e0069 50e4177a 9915fbf8 +6336156586177e0269 7a7173f7 6c63b792 +8233559360849e0095 56566fee 5649a7a +3662265515198e-107 2c538e6e dd48f2a3 +1831132757599e-107 2c438e6e dd48f2a3 +7812878489261e-179 1d726dae 7bbeda75 +6363857920591e0145 60b28a61 cf9483b7 +8811915538555e0082 53a51f50 8b287ae7 +9997878507563e-195 1a253db2 fea1ea31 +9224786422069e-291 634ee5d 56b32957 +6284426329974e-294 58d3409 dfbca26f +9199302046091e-062 35c13597 2630774c +6070482281213e-122 29423fa9 e6fcf47e +2780161250963e-301 405acc2 53064c2 +8233559360849e0094 5621f324 d11d4862 +72027097041701e0206 6d946778 12d3a606 +97297545286625e0215 6f79ab82 61990292 +99021992302453e-025 3da5c671 4def374c +54104687080198e-022 3e373cdf 8db7a7bc +33519685743233e0089 5537f203 339c9629 +67039371486466e0089 5547f203 339c9629 +39064392446305e-180 1d626dae 7bbeda75 +17796979903653e0261 78e072f3 819c1321 +28921916763211e0038 4a9eebab e0957af3 +87605699161665e0155 6302920f 96e7f9ef +41921560615349e-067 34d9b2a5 c4041e4b +80527976643809e0061 4f7c7c5a ea080a49 +72335858886654e-159 21cce77c 2b3328fc +52656615219377e0102 57f561de f4a9ee32 +15400733123779e-072 33b8bf7e 7fa6f02a +77003665618895e-073 33a8bf7e 7fa6f02a +475603213226859e-042 3a42d730 88f4050a +972708181182949e0116 5b218a7f 36172332 +246411729980464e-071 342eef5e 1f90ac34 +123205864990232e-071 341eef5e 1f90ac34 +609610927149051e-255 e104273 b18918b1 +475603213226859e-041 3a778cfc ab31064d +672574798934795e0065 508226c6 84c87261 +134514959786959e0066 509226c6 84c87261 +294897574603217e-151 2395f2df 5e675a0f +723047919080275e0036 4a7eebab e0957af3 +660191429952702e-088 30bddc7e 975c5045 +330095714976351e-088 30addc7e 975c5045 +578686871093232e-159 21fce77c 2b3328fc +144671717773308e-159 21dce77c 2b3328fc +385018328094475e-074 3398bf7e 7fa6f02a +330095714976351e-089 3077e398 7916a69e +2215901545757777e-212 171a80a6 e566428c +1702061899637397e-276 9cacc46 749dccfe +1864950924021923e0213 6f53ae60 753af6ca +3729901848043846e0213 6f63ae60 753af6ca +7487252720986826e-165 20f8823a 57adbef9 +3743626360493413e-165 20e8823a 57adbef9 +4988915232824583e0119 5be5f6de 9d5d6b5b +3771476185376383e0277 7cae3c14 d6916ce9 +6182410494241627e-119 2a81b964 58445d07 +2572981889477453e0142 609dfc11 fbf46087 +7793560217139653e0051 4dd28046 1b856ec5 +9163942927285259e-202 194fe601 457dce4d +6353227084707473e0155 63650aff 653ffe8a +4431803091515554e-211 17609068 4f5fe998 +9324754620109615e0211 6f0f7d67 21f7f144 +8870461176410409e0263 79d90529 a37b7e22 +90372559027740405e0143 612491da ad0ba280 +18074511805548081e0146 61a011f2 d73116f4 +54897030182071313e0029 496ec556 66d8f9ec +76232626624829156e-032 3ccb7738 11e75fe +59898021767894608e-165 2128823a 57adbef9 +29949010883947304e-165 2118823a 57adbef9 +26153245263757307e0049 4d83de00 5bd620df +27176258005319167e-261 d27c074 7bd76fa1 +18074511805548081e0147 61d4166f 8cfd5cb1 +24691002732654881e-115 2b759a27 83ce70ab +58483921078398283e0057 4f408ce4 99519ce3 +64409240769861689e-159 22692238 f7987779 +94080055902682397e-242 11364981 e39e66ca +31766135423537365e0154 63550aff 653ffe8a +68985865317742005e0164 657a999d dec72aca +13797173063548401e0165 658a999d dec72aca +902042358290366539e-281 9522dc0 1ca1cb8c +238296178309629163e0272 7c038fd9 3f1f5342 +783308178698887621e0226 72925ae6 2cb346d8 +439176241456570504e0029 499ec556 66d8f9ec +899810892172646163e0283 7e6adf51 fa055e03 +926145344610700019e-225 14f307a6 7f1f69ff +653831131593932675e0047 4d63de00 5bd620df +130766226318786535e0048 4d73de00 5bd620df +557035730189854663e-294 693bfac 6bc4767b +902042358290366539e-280 986b930 23ca3e6f +272104041512242479e0200 6d13bbb4 bf05f087 +544208083024484958e0200 6d23bbb4 bf05f087 +680429695511221511e0192 6b808ebc 116f8a20 +308975121073410857e0236 7490db75 cc001072 +792644927852378159e0078 53d7bff3 36d8ff06 +783308178698887621e0223 71f2cbac 35f71140 +8396094300569779681e-252 f8ab223 efcee35a +3507665085003296281e-074 346b85c0 26a264e4 +7322325862592278999e0074 5336775b 6caa5ae0 +6014546754280072926e0209 6f396397 b06732a4 +7120190517612959703e0120 5cc3220d cd5899fd +3507665085003296281e-073 34a13398 18257f0f +4345544743100783551e-218 168a9c42 e5b6d89f +9778613303868468131e-090 313146fe 1075e1ef +7539204280836061195e-082 32d3d969 e3dbe723 +7862637540082247119e-202 19eaba32 62ee707b +2176832332097939832e0200 6d43bbb4 bf05f087 +8643988913946659879e0115 5bbe71ec 1ed0a4f9 +5529436763613147623e0138 6079c677 be6f236e +6764958008109694533e-173 1fed0669 2e6f5ef6 +6802601037806061975e0197 6cbf92ba cb3cb40c +1360520207561212395e0198 6ccf92ba cb3cb40c +62259110684423957791e0047 4dcd8f2c fc20d6e8 +88800290202542652011e-226 1526cec5 1a43f41a +41010852717673354694e-221 16201295 4b6aabba +20505426358836677347e-221 16101295 4b6aabba +66102447903809911604e0055 4f776206 8a24fd55 +35600952588064798515e0119 5cb3220d cd5899fd +14371240869903838702e0205 6e78d92d 2bcc7a81 +57500690832492901689e0043 4cf65d3e 2acd616b +23432630639573022093e-107 2dbdd54c 40a2f25f +62259110684423957791e0048 4e02797c 1d948651 +35620497849450218807e-306 475b220 82529425 +69658634627134074624e0200 6d93bbb4 bf05f087 +99440755792436956989e-062 37362d10 462a26f4 +55277197169490210673e0081 54d945bf a911e32a +36992084760177624177e-318 1f8c5f9 551c2f9a +30888265282878466443e-111 2cf01b8e f28251fc + +# examples of bugs introduced 20001113, fixed 20010207 +# first is 2^-1075 (half the smallest denormal) +2.4703282292062327208828439643411068618252990130716238221279284125033775363510437593264991818081799618989828234772285886546332835517796989819938739800539093906315035659515570226392290858392449105184435931802849936536152500319370457678249219365623669863658480757001585769269903706311928279558551332927834338409351978015531246597263579574622766465272827220056374006485499977096599470454020828166226237857393450736339007967761930577506740176324673600968951340535537458516661134223766678604162159680461914467291840300530057530849048765391711386591646239524912623653881879636239373280423891018672348497668235089863388587925628302755995657524455507255189313690836254779186948667994968324049705821028513185451396213837722826145437693412532098591327667236328125e-324 0 0 +2.47032822920623272e-324 0 0 diff --git a/contrib/gdtoa/test/x.ou0 b/contrib/gdtoa/test/x.ou0 new file mode 100644 index 0000000..83daa47 --- /dev/null +++ b/contrib/gdtoa/test/x.ou0 @@ -0,0 +1,1182 @@ + +Input: 1.23 + +strtox consumes 4 bytes and returns 33 +with bits = #3fff 9d70 a3d7 a3d 70a4 +g_xfmt(0) gives 4 bytes: "1.23" + +strtoIx returns 33, consuming 4 bytes. +fI[0] = #3fff 9d70 a3d7 a3d 70a3 +fI[1] = #3fff 9d70 a3d7 a3d 70a3 +fI[1] == strtox + + +Input: 1.23e+20 + +strtox consumes 8 bytes and returns 1 +with bits = #4041 d55e f90a 2da1 8000 +g_xfmt(0) gives 8 bytes: "1.23e+20" + +strtoIx returns 1, consuming 8 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.23e-20 + +strtox consumes 8 bytes and returns 17 +with bits = #3fbc e857 267b b3a9 84f2 +g_xfmt(0) gives 8 bytes: "1.23e-20" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #3fbc e857 267b b3a9 84f2 +fI[1] = #3fbc e857 267b b3a9 84f2 +fI[0] == strtox + + +Input: 1.23456789 + +strtox consumes 10 bytes and returns 33 +with bits = #3fff 9e06 5214 1ef0 dbf6 +g_xfmt(0) gives 10 bytes: "1.23456789" + +strtoIx returns 33, consuming 10 bytes. +fI[0] = #3fff 9e06 5214 1ef0 dbf5 +fI[1] = #3fff 9e06 5214 1ef0 dbf5 +fI[1] == strtox + + +Input: 1.23456589e+20 + +strtox consumes 14 bytes and returns 1 +with bits = #4041 d629 bd33 5cc ba00 +g_xfmt(0) gives 14 bytes: "1.23456589e+20" + +strtoIx returns 1, consuming 14 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.23e+30 + +strtox consumes 8 bytes and returns 17 +with bits = #4062 f865 8274 7dbc 824a +g_xfmt(0) gives 8 bytes: "1.23e+30" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #4062 f865 8274 7dbc 824a +fI[1] = #4062 f865 8274 7dbc 824a +fI[0] == strtox + + +Input: 1.23e-30 + +strtox consumes 8 bytes and returns 17 +with bits = #3f9b c794 337a 8085 54eb +g_xfmt(0) gives 8 bytes: "1.23e-30" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #3f9b c794 337a 8085 54eb +fI[1] = #3f9b c794 337a 8085 54eb +fI[0] == strtox + + +Input: 1.23456789e-20 + +strtox consumes 14 bytes and returns 17 +with bits = #3fbc e934 a38 f3d6 d352 +g_xfmt(0) gives 14 bytes: "1.23456789e-20" + +strtoIx returns 17, consuming 14 bytes. +fI[0] = #3fbc e934 a38 f3d6 d352 +fI[1] = #3fbc e934 a38 f3d6 d352 +fI[0] == strtox + + +Input: 1.23456789e-30 + +strtox consumes 14 bytes and returns 17 +with bits = #3f9b c851 f19d decc a8fc +g_xfmt(0) gives 14 bytes: "1.23456789e-30" + +strtoIx returns 17, consuming 14 bytes. +fI[0] = #3f9b c851 f19d decc a8fc +fI[1] = #3f9b c851 f19d decc a8fc +fI[0] == strtox + + +Input: 1.234567890123456789 + +strtox consumes 20 bytes and returns 17 +with bits = #3fff 9e06 5214 62cf db8d +g_xfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIx returns 17, consuming 20 bytes. +fI[0] = #3fff 9e06 5214 62cf db8d +fI[1] = #3fff 9e06 5214 62cf db8d +fI[0] == strtox + + +Input: 1.23456789012345678901234567890123456789 + +strtox consumes 40 bytes and returns 17 +with bits = #3fff 9e06 5214 62cf db8d +g_xfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIx returns 17, consuming 40 bytes. +fI[0] = #3fff 9e06 5214 62cf db8d +fI[1] = #3fff 9e06 5214 62cf db8d +fI[0] == strtox + + +Input: 1.23e306 + +strtox consumes 8 bytes and returns 17 +with bits = #43f7 e033 b668 e30f a6d5 +g_xfmt(0) gives 9 bytes: "1.23e+306" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #43f7 e033 b668 e30f a6d5 +fI[1] = #43f7 e033 b668 e30f a6d5 +fI[0] == strtox + + +Input: 1.23e-306 + +strtox consumes 9 bytes and returns 33 +with bits = #3c06 dd1d c2ed 1cb7 3f25 +g_xfmt(0) gives 9 bytes: "1.23e-306" + +strtoIx returns 33, consuming 9 bytes. +fI[0] = #3c06 dd1d c2ed 1cb7 3f24 +fI[1] = #3c06 dd1d c2ed 1cb7 3f24 +fI[1] == strtox + + +Input: 1.23e-320 + +strtox consumes 9 bytes and returns 33 +with bits = #3bd8 9b98 c371 844c 3f1a +g_xfmt(0) gives 9 bytes: "1.23e-320" + +strtoIx returns 33, consuming 9 bytes. +fI[0] = #3bd8 9b98 c371 844c 3f19 +fI[1] = #3bd8 9b98 c371 844c 3f19 +fI[1] == strtox + + +Input: 1.23e-20 + +strtox consumes 8 bytes and returns 17 +with bits = #3fbc e857 267b b3a9 84f2 +g_xfmt(0) gives 8 bytes: "1.23e-20" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #3fbc e857 267b b3a9 84f2 +fI[1] = #3fbc e857 267b b3a9 84f2 +fI[0] == strtox + + +Input: 1.23456789e307 + +strtox consumes 14 bytes and returns 17 +with bits = #43fb 8ca5 8a5e d766 de75 +g_xfmt(0) gives 15 bytes: "1.23456789e+307" + +strtoIx returns 17, consuming 14 bytes. +fI[0] = #43fb 8ca5 8a5e d766 de75 +fI[1] = #43fb 8ca5 8a5e d766 de75 +fI[0] == strtox + + +Input: 1.23456589e-307 + +strtox consumes 15 bytes and returns 17 +with bits = #3c03 b18c b5dc c22f d369 +g_xfmt(0) gives 15 bytes: "1.23456589e-307" + +strtoIx returns 17, consuming 15 bytes. +fI[0] = #3c03 b18c b5dc c22f d369 +fI[1] = #3c03 b18c b5dc c22f d369 +fI[0] == strtox + + +Input: 1.234567890123456789 + +strtox consumes 20 bytes and returns 17 +with bits = #3fff 9e06 5214 62cf db8d +g_xfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIx returns 17, consuming 20 bytes. +fI[0] = #3fff 9e06 5214 62cf db8d +fI[1] = #3fff 9e06 5214 62cf db8d +fI[0] == strtox + + +Input: 1.234567890123456789e301 + +strtox consumes 24 bytes and returns 33 +with bits = #43e7 937a 8baf ab20 980c +g_xfmt(0) gives 25 bytes: "1.234567890123456789e+301" + +strtoIx returns 33, consuming 24 bytes. +fI[0] = #43e7 937a 8baf ab20 980b +fI[1] = #43e7 937a 8baf ab20 980b +fI[1] == strtox + + +Input: 1.234567890123456789e-301 + +strtox consumes 25 bytes and returns 33 +with bits = #3c17 a953 271a 5d06 9ad9 +g_xfmt(0) gives 25 bytes: "1.234567890123456789e-301" + +strtoIx returns 33, consuming 25 bytes. +fI[0] = #3c17 a953 271a 5d06 9ad8 +fI[1] = #3c17 a953 271a 5d06 9ad8 +fI[1] == strtox + + +Input: 1.234567890123456789e-321 + +strtox consumes 25 bytes and returns 33 +with bits = #3bd4 f9e1 1b4c ea6d cce9 +g_xfmt(0) gives 25 bytes: "1.234567890123456789e-321" + +strtoIx returns 33, consuming 25 bytes. +fI[0] = #3bd4 f9e1 1b4c ea6d cce8 +fI[1] = #3bd4 f9e1 1b4c ea6d cce8 +fI[1] == strtox + + +Input: 1e23 + +strtox consumes 4 bytes and returns 1 +with bits = #404b a968 163f a57 b400 +g_xfmt(0) gives 5 bytes: "1e+23" + +strtoIx returns 1, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1e310 + +strtox consumes 5 bytes and returns 33 +with bits = #4404 de81 e40a 34b cf50 +g_xfmt(0) gives 6 bytes: "1e+310" + +strtoIx returns 33, consuming 5 bytes. +fI[0] = #4404 de81 e40a 34b cf4f +fI[1] = #4404 de81 e40a 34b cf4f +fI[1] == strtox + + +Input: 9.0259718793241475e-277 + +strtox consumes 23 bytes and returns 33 +with bits = #3c69 ffff ffff ffff fcf7 +g_xfmt(0) gives 23 bytes: "9.0259718793241475e-277" + +strtoIx returns 33, consuming 23 bytes. +fI[0] = #3c69 ffff ffff ffff fcf6 +fI[1] = #3c69 ffff ffff ffff fcf6 +fI[1] == strtox + + +Input: 9.025971879324147880346310405869e-277 + +strtox consumes 37 bytes and returns 17 +with bits = #3c6a 8000 0 0 0 +g_xfmt(0) gives 26 bytes: "9.0259718793241478803e-277" + +strtoIx returns 17, consuming 37 bytes. +fI[0] = #3c6a 8000 0 0 0 +fI[1] = #3c6a 8000 0 0 0 +fI[0] == strtox + + +Input: 9.025971879324147880346310405868e-277 + +strtox consumes 37 bytes and returns 33 +with bits = #3c6a 8000 0 0 0 +g_xfmt(0) gives 26 bytes: "9.0259718793241478803e-277" + +strtoIx returns 33, consuming 37 bytes. +fI[0] = #3c69 ffff ffff ffff ffff +fI[1] = #3c6a 8000 0 ffff ffff +fI[1] == strtox + + +Input: 2.2250738585072014e-308 + +strtox consumes 23 bytes and returns 17 +with bits = #3c01 8000 0 0 46 +g_xfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoIx returns 17, consuming 23 bytes. +fI[0] = #3c01 8000 0 0 46 +fI[1] = #3c01 8000 0 0 46 +fI[0] == strtox + + +Input: 2.2250738585072013e-308 + +strtox consumes 23 bytes and returns 17 +with bits = #3c00 ffff ffff ffff fd4f +g_xfmt(0) gives 23 bytes: "2.2250738585072013e-308" + +strtoIx returns 17, consuming 23 bytes. +fI[0] = #3c00 ffff ffff ffff fd4f +fI[1] = #3c00 ffff ffff ffff fd4f +fI[0] == strtox + +Rounding mode for strtor... changed from 1 (nearest) to 0 (toward zero) + +Input: 1.1 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff 8ccc cccc cccc cccc +g_xfmt(0) gives 21 bytes: "1.0999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 8ccc cccc cccc cccc +fI[1] = #3fff 8ccc cccc cccc cccc +fI[0] == strtox + + +Input: -1.1 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff 8ccc cccc cccc cccc +g_xfmt(0) gives 22 bytes: "-1.0999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 8ccc cccc cccc cccd +fI[1] = #bfff 8ccc cccc cccc cccd +fI[1] == strtox + + +Input: 1.2 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff 9999 9999 9999 9999 +g_xfmt(0) gives 21 bytes: "1.1999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 9999 9999 9999 9999 +fI[1] = #3fff 9999 9999 9999 9999 +fI[0] == strtox + + +Input: -1.2 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff 9999 9999 9999 9999 +g_xfmt(0) gives 22 bytes: "-1.1999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 9999 9999 9999 999a +fI[1] = #bfff 9999 9999 9999 999a +fI[1] == strtox + + +Input: 1.3 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff a666 6666 6666 6666 +g_xfmt(0) gives 3 bytes: "1.3" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff a666 6666 6666 6666 +fI[1] = #3fff a666 6666 6666 6666 +fI[0] == strtox + + +Input: -1.3 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff a666 6666 6666 6666 +g_xfmt(0) gives 4 bytes: "-1.3" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff a666 6666 6666 6667 +fI[1] = #bfff a666 6666 6666 6667 +fI[1] == strtox + + +Input: 1.4 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff b333 3333 3333 3333 +g_xfmt(0) gives 3 bytes: "1.4" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff b333 3333 3333 3333 +fI[1] = #3fff b333 3333 3333 3333 +fI[0] == strtox + + +Input: -1.4 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff b333 3333 3333 3333 +g_xfmt(0) gives 4 bytes: "-1.4" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff b333 3333 3333 3334 +fI[1] = #bfff b333 3333 3333 3334 +fI[1] == strtox + + +Input: 1.5 + +strtox consumes 3 bytes and returns 1 +with bits = #3fff c000 0 0 0 +g_xfmt(0) gives 3 bytes: "1.5" + +strtoIx returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtox + + +Input: -1.5 + +strtox consumes 4 bytes and returns 9 +with bits = #bfff c000 0 0 0 +g_xfmt(0) gives 4 bytes: "-1.5" + +strtoIx returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.6 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff cccc cccc cccc cccc +g_xfmt(0) gives 21 bytes: "1.5999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff cccc cccc cccc cccc +fI[1] = #3fff cccc cccc cccc cccc +fI[0] == strtox + + +Input: -1.6 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff cccc cccc cccc cccc +g_xfmt(0) gives 22 bytes: "-1.5999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff cccc cccc cccc cccd +fI[1] = #bfff cccc cccc cccc cccd +fI[1] == strtox + + +Input: 1.7 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff d999 9999 9999 9999 +g_xfmt(0) gives 21 bytes: "1.6999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff d999 9999 9999 9999 +fI[1] = #3fff d999 9999 9999 9999 +fI[0] == strtox + + +Input: -1.7 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff d999 9999 9999 9999 +g_xfmt(0) gives 22 bytes: "-1.6999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff d999 9999 9999 999a +fI[1] = #bfff d999 9999 9999 999a +fI[1] == strtox + + +Input: 1.8 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff e666 6666 6666 6666 +g_xfmt(0) gives 3 bytes: "1.8" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff e666 6666 6666 6666 +fI[1] = #3fff e666 6666 6666 6666 +fI[0] == strtox + + +Input: -1.8 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff e666 6666 6666 6666 +g_xfmt(0) gives 4 bytes: "-1.8" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff e666 6666 6666 6667 +fI[1] = #bfff e666 6666 6666 6667 +fI[1] == strtox + + +Input: 1.9 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff f333 3333 3333 3333 +g_xfmt(0) gives 3 bytes: "1.9" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff f333 3333 3333 3333 +fI[1] = #3fff f333 3333 3333 3333 +fI[0] == strtox + + +Input: -1.9 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff f333 3333 3333 3333 +g_xfmt(0) gives 4 bytes: "-1.9" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff f333 3333 3333 3334 +fI[1] = #bfff f333 3333 3333 3334 +fI[1] == strtox + +Rounding mode for strtor... changed from 0 (toward zero) to 1 (nearest) + +Input: 1.1 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff 8ccc cccc cccc cccd +g_xfmt(0) gives 3 bytes: "1.1" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 8ccc cccc cccc cccc +fI[1] = #3fff 8ccc cccc cccc cccc +fI[1] == strtox + + +Input: -1.1 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff 8ccc cccc cccc cccd +g_xfmt(0) gives 4 bytes: "-1.1" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 8ccc cccc cccc cccd +fI[1] = #bfff 8ccc cccc cccc cccd +fI[0] == strtox + + +Input: 1.2 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff 9999 9999 9999 999a +g_xfmt(0) gives 3 bytes: "1.2" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 9999 9999 9999 9999 +fI[1] = #3fff 9999 9999 9999 9999 +fI[1] == strtox + + +Input: -1.2 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff 9999 9999 9999 999a +g_xfmt(0) gives 4 bytes: "-1.2" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 9999 9999 9999 999a +fI[1] = #bfff 9999 9999 9999 999a +fI[0] == strtox + + +Input: 1.3 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff a666 6666 6666 6666 +g_xfmt(0) gives 3 bytes: "1.3" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff a666 6666 6666 6666 +fI[1] = #3fff a666 6666 6666 6666 +fI[0] == strtox + + +Input: -1.3 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff a666 6666 6666 6666 +g_xfmt(0) gives 4 bytes: "-1.3" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff a666 6666 6666 6667 +fI[1] = #bfff a666 6666 6666 6667 +fI[1] == strtox + + +Input: 1.4 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff b333 3333 3333 3333 +g_xfmt(0) gives 3 bytes: "1.4" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff b333 3333 3333 3333 +fI[1] = #3fff b333 3333 3333 3333 +fI[0] == strtox + + +Input: -1.4 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff b333 3333 3333 3333 +g_xfmt(0) gives 4 bytes: "-1.4" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff b333 3333 3333 3334 +fI[1] = #bfff b333 3333 3333 3334 +fI[1] == strtox + + +Input: 1.5 + +strtox consumes 3 bytes and returns 1 +with bits = #3fff c000 0 0 0 +g_xfmt(0) gives 3 bytes: "1.5" + +strtoIx returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtox + + +Input: -1.5 + +strtox consumes 4 bytes and returns 9 +with bits = #bfff c000 0 0 0 +g_xfmt(0) gives 4 bytes: "-1.5" + +strtoIx returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.6 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff cccc cccc cccc cccd +g_xfmt(0) gives 3 bytes: "1.6" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff cccc cccc cccc cccc +fI[1] = #3fff cccc cccc cccc cccc +fI[1] == strtox + + +Input: -1.6 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff cccc cccc cccc cccd +g_xfmt(0) gives 4 bytes: "-1.6" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff cccc cccc cccc cccd +fI[1] = #bfff cccc cccc cccc cccd +fI[0] == strtox + + +Input: 1.7 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff d999 9999 9999 999a +g_xfmt(0) gives 3 bytes: "1.7" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff d999 9999 9999 9999 +fI[1] = #3fff d999 9999 9999 9999 +fI[1] == strtox + + +Input: -1.7 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff d999 9999 9999 999a +g_xfmt(0) gives 4 bytes: "-1.7" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff d999 9999 9999 999a +fI[1] = #bfff d999 9999 9999 999a +fI[0] == strtox + + +Input: 1.8 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff e666 6666 6666 6666 +g_xfmt(0) gives 3 bytes: "1.8" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff e666 6666 6666 6666 +fI[1] = #3fff e666 6666 6666 6666 +fI[0] == strtox + + +Input: -1.8 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff e666 6666 6666 6666 +g_xfmt(0) gives 4 bytes: "-1.8" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff e666 6666 6666 6667 +fI[1] = #bfff e666 6666 6666 6667 +fI[1] == strtox + + +Input: 1.9 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff f333 3333 3333 3333 +g_xfmt(0) gives 3 bytes: "1.9" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff f333 3333 3333 3333 +fI[1] = #3fff f333 3333 3333 3333 +fI[0] == strtox + + +Input: -1.9 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff f333 3333 3333 3333 +g_xfmt(0) gives 4 bytes: "-1.9" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff f333 3333 3333 3334 +fI[1] = #bfff f333 3333 3333 3334 +fI[1] == strtox + +Rounding mode for strtor... changed from 1 (nearest) to 2 (toward +Infinity) + +Input: 1.1 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff 8ccc cccc cccc cccd +g_xfmt(0) gives 3 bytes: "1.1" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 8ccc cccc cccc cccc +fI[1] = #3fff 8ccc cccc cccc cccc +fI[1] == strtox + + +Input: -1.1 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff 8ccc cccc cccc cccc +g_xfmt(0) gives 22 bytes: "-1.0999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 8ccc cccc cccc cccd +fI[1] = #bfff 8ccc cccc cccc cccd +fI[1] == strtox + + +Input: 1.2 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff 9999 9999 9999 999a +g_xfmt(0) gives 3 bytes: "1.2" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 9999 9999 9999 9999 +fI[1] = #3fff 9999 9999 9999 9999 +fI[1] == strtox + + +Input: -1.2 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff 9999 9999 9999 9999 +g_xfmt(0) gives 22 bytes: "-1.1999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 9999 9999 9999 999a +fI[1] = #bfff 9999 9999 9999 999a +fI[1] == strtox + + +Input: 1.3 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff a666 6666 6666 6667 +g_xfmt(0) gives 21 bytes: "1.3000000000000000001" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff a666 6666 6666 6666 +fI[1] = #3fff a666 6666 6666 6666 +fI[1] == strtox + + +Input: -1.3 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff a666 6666 6666 6666 +g_xfmt(0) gives 4 bytes: "-1.3" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff a666 6666 6666 6667 +fI[1] = #bfff a666 6666 6666 6667 +fI[1] == strtox + + +Input: 1.4 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff b333 3333 3333 3334 +g_xfmt(0) gives 21 bytes: "1.4000000000000000001" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff b333 3333 3333 3333 +fI[1] = #3fff b333 3333 3333 3333 +fI[1] == strtox + + +Input: -1.4 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff b333 3333 3333 3333 +g_xfmt(0) gives 4 bytes: "-1.4" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff b333 3333 3333 3334 +fI[1] = #bfff b333 3333 3333 3334 +fI[1] == strtox + + +Input: 1.5 + +strtox consumes 3 bytes and returns 1 +with bits = #3fff c000 0 0 0 +g_xfmt(0) gives 3 bytes: "1.5" + +strtoIx returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtox + + +Input: -1.5 + +strtox consumes 4 bytes and returns 9 +with bits = #bfff c000 0 0 0 +g_xfmt(0) gives 4 bytes: "-1.5" + +strtoIx returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.6 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff cccc cccc cccc cccd +g_xfmt(0) gives 3 bytes: "1.6" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff cccc cccc cccc cccc +fI[1] = #3fff cccc cccc cccc cccc +fI[1] == strtox + + +Input: -1.6 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff cccc cccc cccc cccc +g_xfmt(0) gives 22 bytes: "-1.5999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff cccc cccc cccc cccd +fI[1] = #bfff cccc cccc cccc cccd +fI[1] == strtox + + +Input: 1.7 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff d999 9999 9999 999a +g_xfmt(0) gives 3 bytes: "1.7" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff d999 9999 9999 9999 +fI[1] = #3fff d999 9999 9999 9999 +fI[1] == strtox + + +Input: -1.7 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff d999 9999 9999 9999 +g_xfmt(0) gives 22 bytes: "-1.6999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff d999 9999 9999 999a +fI[1] = #bfff d999 9999 9999 999a +fI[1] == strtox + + +Input: 1.8 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff e666 6666 6666 6667 +g_xfmt(0) gives 21 bytes: "1.8000000000000000001" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff e666 6666 6666 6666 +fI[1] = #3fff e666 6666 6666 6666 +fI[1] == strtox + + +Input: -1.8 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff e666 6666 6666 6666 +g_xfmt(0) gives 4 bytes: "-1.8" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff e666 6666 6666 6667 +fI[1] = #bfff e666 6666 6666 6667 +fI[1] == strtox + + +Input: 1.9 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff f333 3333 3333 3334 +g_xfmt(0) gives 21 bytes: "1.9000000000000000001" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff f333 3333 3333 3333 +fI[1] = #3fff f333 3333 3333 3333 +fI[1] == strtox + + +Input: -1.9 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff f333 3333 3333 3333 +g_xfmt(0) gives 4 bytes: "-1.9" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff f333 3333 3333 3334 +fI[1] = #bfff f333 3333 3333 3334 +fI[1] == strtox + +Rounding mode for strtor... changed from 2 (toward +Infinity) to 3 (toward -Infinity) + +Input: 1.1 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff 8ccc cccc cccc cccc +g_xfmt(0) gives 21 bytes: "1.0999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 8ccc cccc cccc cccc +fI[1] = #3fff 8ccc cccc cccc cccc +fI[0] == strtox + + +Input: -1.1 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff 8ccc cccc cccc cccd +g_xfmt(0) gives 4 bytes: "-1.1" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 8ccc cccc cccc cccd +fI[1] = #bfff 8ccc cccc cccc cccd +fI[0] == strtox + + +Input: 1.2 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff 9999 9999 9999 9999 +g_xfmt(0) gives 21 bytes: "1.1999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 9999 9999 9999 9999 +fI[1] = #3fff 9999 9999 9999 9999 +fI[0] == strtox + + +Input: -1.2 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff 9999 9999 9999 999a +g_xfmt(0) gives 4 bytes: "-1.2" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 9999 9999 9999 999a +fI[1] = #bfff 9999 9999 9999 999a +fI[0] == strtox + + +Input: 1.3 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff a666 6666 6666 6666 +g_xfmt(0) gives 3 bytes: "1.3" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff a666 6666 6666 6666 +fI[1] = #3fff a666 6666 6666 6666 +fI[0] == strtox + + +Input: -1.3 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff a666 6666 6666 6667 +g_xfmt(0) gives 22 bytes: "-1.3000000000000000001" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff a666 6666 6666 6667 +fI[1] = #bfff a666 6666 6666 6667 +fI[0] == strtox + + +Input: 1.4 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff b333 3333 3333 3333 +g_xfmt(0) gives 3 bytes: "1.4" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff b333 3333 3333 3333 +fI[1] = #3fff b333 3333 3333 3333 +fI[0] == strtox + + +Input: -1.4 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff b333 3333 3333 3334 +g_xfmt(0) gives 22 bytes: "-1.4000000000000000001" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff b333 3333 3333 3334 +fI[1] = #bfff b333 3333 3333 3334 +fI[0] == strtox + + +Input: 1.5 + +strtox consumes 3 bytes and returns 1 +with bits = #3fff c000 0 0 0 +g_xfmt(0) gives 3 bytes: "1.5" + +strtoIx returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtox + + +Input: -1.5 + +strtox consumes 4 bytes and returns 9 +with bits = #bfff c000 0 0 0 +g_xfmt(0) gives 4 bytes: "-1.5" + +strtoIx returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.6 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff cccc cccc cccc cccc +g_xfmt(0) gives 21 bytes: "1.5999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff cccc cccc cccc cccc +fI[1] = #3fff cccc cccc cccc cccc +fI[0] == strtox + + +Input: -1.6 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff cccc cccc cccc cccd +g_xfmt(0) gives 4 bytes: "-1.6" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff cccc cccc cccc cccd +fI[1] = #bfff cccc cccc cccc cccd +fI[0] == strtox + + +Input: 1.7 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff d999 9999 9999 9999 +g_xfmt(0) gives 21 bytes: "1.6999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff d999 9999 9999 9999 +fI[1] = #3fff d999 9999 9999 9999 +fI[0] == strtox + + +Input: -1.7 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff d999 9999 9999 999a +g_xfmt(0) gives 4 bytes: "-1.7" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff d999 9999 9999 999a +fI[1] = #bfff d999 9999 9999 999a +fI[0] == strtox + + +Input: 1.8 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff e666 6666 6666 6666 +g_xfmt(0) gives 3 bytes: "1.8" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff e666 6666 6666 6666 +fI[1] = #3fff e666 6666 6666 6666 +fI[0] == strtox + + +Input: -1.8 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff e666 6666 6666 6667 +g_xfmt(0) gives 22 bytes: "-1.8000000000000000001" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff e666 6666 6666 6667 +fI[1] = #bfff e666 6666 6666 6667 +fI[0] == strtox + + +Input: 1.9 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff f333 3333 3333 3333 +g_xfmt(0) gives 3 bytes: "1.9" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff f333 3333 3333 3333 +fI[1] = #3fff f333 3333 3333 3333 +fI[0] == strtox + + +Input: -1.9 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff f333 3333 3333 3334 +g_xfmt(0) gives 22 bytes: "-1.9000000000000000001" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff f333 3333 3333 3334 +fI[1] = #bfff f333 3333 3333 3334 +fI[0] == strtox + diff --git a/contrib/gdtoa/test/x.ou1 b/contrib/gdtoa/test/x.ou1 new file mode 100644 index 0000000..3ebe74a --- /dev/null +++ b/contrib/gdtoa/test/x.ou1 @@ -0,0 +1,1460 @@ + +Input: 1.23 + +strtox consumes 4 bytes and returns 33 +with bits = #3fff 9d70 a3d7 a3d 70a4 +printf("%.21Lg") gives 1.23000000000000000002 +g_xfmt(0) gives 4 bytes: "1.23" + +strtoIx returns 33, consuming 4 bytes. +fI[0] = #3fff 9d70 a3d7 a3d 70a3 += 1.22999999999999999991 +fI[1] = #3fff 9d70 a3d7 a3d 70a3 += 1.23000000000000000002 +fI[1] == strtox + + +Input: 1.23e+20 + +strtox consumes 8 bytes and returns 1 +with bits = #4041 d55e f90a 2da1 8000 +printf("%.21Lg") gives 123000000000000000000 +g_xfmt(0) gives 8 bytes: "1.23e+20" + +strtoIx returns 1, consuming 8 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.23e-20 + +strtox consumes 8 bytes and returns 17 +with bits = #3fbc e857 267b b3a9 84f2 +printf("%.21Lg") gives 1.22999999999999999997e-20 +g_xfmt(0) gives 8 bytes: "1.23e-20" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #3fbc e857 267b b3a9 84f2 += 1.22999999999999999997e-20 +fI[1] = #3fbc e857 267b b3a9 84f2 += 1.23000000000000000004e-20 +fI[0] == strtox + + +Input: 1.23456789 + +strtox consumes 10 bytes and returns 33 +with bits = #3fff 9e06 5214 1ef0 dbf6 +printf("%.21Lg") gives 1.23456789000000000003 +g_xfmt(0) gives 10 bytes: "1.23456789" + +strtoIx returns 33, consuming 10 bytes. +fI[0] = #3fff 9e06 5214 1ef0 dbf5 += 1.23456788999999999992 +fI[1] = #3fff 9e06 5214 1ef0 dbf5 += 1.23456789000000000003 +fI[1] == strtox + + +Input: 1.23456589e+20 + +strtox consumes 14 bytes and returns 1 +with bits = #4041 d629 bd33 5cc ba00 +printf("%.21Lg") gives 123456589000000000000 +g_xfmt(0) gives 14 bytes: "1.23456589e+20" + +strtoIx returns 1, consuming 14 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.23e+30 + +strtox consumes 8 bytes and returns 17 +with bits = #4062 f865 8274 7dbc 824a +printf("%.21Lg") gives 1.22999999999999999999e+30 +g_xfmt(0) gives 8 bytes: "1.23e+30" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #4062 f865 8274 7dbc 824a += 1.22999999999999999999e+30 +fI[1] = #4062 f865 8274 7dbc 824a += 1.23000000000000000006e+30 +fI[0] == strtox + + +Input: 1.23e-30 + +strtox consumes 8 bytes and returns 17 +with bits = #3f9b c794 337a 8085 54eb +printf("%.21Lg") gives 1.22999999999999999999e-30 +g_xfmt(0) gives 8 bytes: "1.23e-30" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #3f9b c794 337a 8085 54eb += 1.22999999999999999999e-30 +fI[1] = #3f9b c794 337a 8085 54eb += 1.23000000000000000007e-30 +fI[0] == strtox + + +Input: 1.23456789e-20 + +strtox consumes 14 bytes and returns 17 +with bits = #3fbc e934 a38 f3d6 d352 +printf("%.21Lg") gives 1.23456788999999999998e-20 +g_xfmt(0) gives 14 bytes: "1.23456789e-20" + +strtoIx returns 17, consuming 14 bytes. +fI[0] = #3fbc e934 a38 f3d6 d352 += 1.23456788999999999998e-20 +fI[1] = #3fbc e934 a38 f3d6 d352 += 1.23456789000000000005e-20 +fI[0] == strtox + + +Input: 1.23456789e-30 + +strtox consumes 14 bytes and returns 17 +with bits = #3f9b c851 f19d decc a8fc +printf("%.21Lg") gives 1.23456788999999999999e-30 +g_xfmt(0) gives 14 bytes: "1.23456789e-30" + +strtoIx returns 17, consuming 14 bytes. +fI[0] = #3f9b c851 f19d decc a8fc += 1.23456788999999999999e-30 +fI[1] = #3f9b c851 f19d decc a8fc += 1.23456789000000000007e-30 +fI[0] == strtox + + +Input: 1.234567890123456789 + +strtox consumes 20 bytes and returns 17 +with bits = #3fff 9e06 5214 62cf db8d +printf("%.21Lg") gives 1.23456789012345678899 +g_xfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIx returns 17, consuming 20 bytes. +fI[0] = #3fff 9e06 5214 62cf db8d += 1.23456789012345678899 +fI[1] = #3fff 9e06 5214 62cf db8d += 1.23456789012345678909 +fI[0] == strtox + + +Input: 1.23456789012345678901234567890123456789 + +strtox consumes 40 bytes and returns 17 +with bits = #3fff 9e06 5214 62cf db8d +printf("%.21Lg") gives 1.23456789012345678899 +g_xfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIx returns 17, consuming 40 bytes. +fI[0] = #3fff 9e06 5214 62cf db8d += 1.23456789012345678899 +fI[1] = #3fff 9e06 5214 62cf db8d += 1.23456789012345678909 +fI[0] == strtox + + +Input: 1.23e306 + +strtox consumes 8 bytes and returns 17 +with bits = #43f7 e033 b668 e30f a6d5 +printf("%.21Lg") gives 1.22999999999999999997e+306 +g_xfmt(0) gives 9 bytes: "1.23e+306" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #43f7 e033 b668 e30f a6d5 += 1.22999999999999999997e+306 +fI[1] = #43f7 e033 b668 e30f a6d5 += 1.23000000000000000005e+306 +fI[0] == strtox + + +Input: 1.23e-306 + +strtox consumes 9 bytes and returns 33 +with bits = #3c06 dd1d c2ed 1cb7 3f25 +printf("%.21Lg") gives 1.23000000000000000002e-306 +g_xfmt(0) gives 9 bytes: "1.23e-306" + +strtoIx returns 33, consuming 9 bytes. +fI[0] = #3c06 dd1d c2ed 1cb7 3f24 += 1.22999999999999999995e-306 +fI[1] = #3c06 dd1d c2ed 1cb7 3f24 += 1.23000000000000000002e-306 +fI[1] == strtox + + +Input: 1.23e-320 + +strtox consumes 9 bytes and returns 33 +with bits = #3bd8 9b98 c371 844c 3f1a +printf("%.21Lg") gives 1.23000000000000000002e-320 +g_xfmt(0) gives 9 bytes: "1.23e-320" + +strtoIx returns 33, consuming 9 bytes. +fI[0] = #3bd8 9b98 c371 844c 3f19 += 1.22999999999999999991e-320 +fI[1] = #3bd8 9b98 c371 844c 3f19 += 1.23000000000000000002e-320 +fI[1] == strtox + + +Input: 1.23e-20 + +strtox consumes 8 bytes and returns 17 +with bits = #3fbc e857 267b b3a9 84f2 +printf("%.21Lg") gives 1.22999999999999999997e-20 +g_xfmt(0) gives 8 bytes: "1.23e-20" + +strtoIx returns 17, consuming 8 bytes. +fI[0] = #3fbc e857 267b b3a9 84f2 += 1.22999999999999999997e-20 +fI[1] = #3fbc e857 267b b3a9 84f2 += 1.23000000000000000004e-20 +fI[0] == strtox + + +Input: 1.23456789e307 + +strtox consumes 14 bytes and returns 17 +with bits = #43fb 8ca5 8a5e d766 de75 +printf("%.21Lg") gives 1.23456788999999999998e+307 +g_xfmt(0) gives 15 bytes: "1.23456789e+307" + +strtoIx returns 17, consuming 14 bytes. +fI[0] = #43fb 8ca5 8a5e d766 de75 += 1.23456788999999999998e+307 +fI[1] = #43fb 8ca5 8a5e d766 de75 += 1.23456789000000000011e+307 +fI[0] == strtox + + +Input: 1.23456589e-307 + +strtox consumes 15 bytes and returns 17 +with bits = #3c03 b18c b5dc c22f d369 +printf("%.21Lg") gives 1.23456588999999999999e-307 +g_xfmt(0) gives 15 bytes: "1.23456589e-307" + +strtoIx returns 17, consuming 15 bytes. +fI[0] = #3c03 b18c b5dc c22f d369 += 1.23456588999999999999e-307 +fI[1] = #3c03 b18c b5dc c22f d369 += 1.23456589000000000009e-307 +fI[0] == strtox + + +Input: 1.234567890123456789 + +strtox consumes 20 bytes and returns 17 +with bits = #3fff 9e06 5214 62cf db8d +printf("%.21Lg") gives 1.23456789012345678899 +g_xfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIx returns 17, consuming 20 bytes. +fI[0] = #3fff 9e06 5214 62cf db8d += 1.23456789012345678899 +fI[1] = #3fff 9e06 5214 62cf db8d += 1.23456789012345678909 +fI[0] == strtox + + +Input: 1.234567890123456789e301 + +strtox consumes 24 bytes and returns 33 +with bits = #43e7 937a 8baf ab20 980c +printf("%.21Lg") gives 1.234567890123456789e+301 +g_xfmt(0) gives 25 bytes: "1.234567890123456789e+301" + +strtoIx returns 33, consuming 24 bytes. +fI[0] = #43e7 937a 8baf ab20 980b += 1.23456789012345678889e+301 +fI[1] = #43e7 937a 8baf ab20 980b += 1.234567890123456789e+301 +fI[1] == strtox + + +Input: 1.234567890123456789e-301 + +strtox consumes 25 bytes and returns 33 +with bits = #3c17 a953 271a 5d06 9ad9 +printf("%.21Lg") gives 1.23456789012345678902e-301 +g_xfmt(0) gives 25 bytes: "1.234567890123456789e-301" + +strtoIx returns 33, consuming 25 bytes. +fI[0] = #3c17 a953 271a 5d06 9ad8 += 1.23456789012345678892e-301 +fI[1] = #3c17 a953 271a 5d06 9ad8 += 1.23456789012345678902e-301 +fI[1] == strtox + + +Input: 1.234567890123456789e-321 + +strtox consumes 25 bytes and returns 33 +with bits = #3bd4 f9e1 1b4c ea6d cce9 +printf("%.21Lg") gives 1.234567890123456789e-321 +g_xfmt(0) gives 25 bytes: "1.234567890123456789e-321" + +strtoIx returns 33, consuming 25 bytes. +fI[0] = #3bd4 f9e1 1b4c ea6d cce8 += 1.23456789012345678893e-321 +fI[1] = #3bd4 f9e1 1b4c ea6d cce8 += 1.234567890123456789e-321 +fI[1] == strtox + + +Input: 1e23 + +strtox consumes 4 bytes and returns 1 +with bits = #404b a968 163f a57 b400 +printf("%.21Lg") gives 1e+23 +g_xfmt(0) gives 5 bytes: "1e+23" + +strtoIx returns 1, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1e310 + +strtox consumes 5 bytes and returns 33 +with bits = #4404 de81 e40a 34b cf50 +printf("%.21Lg") gives 1e+310 +g_xfmt(0) gives 6 bytes: "1e+310" + +strtoIx returns 33, consuming 5 bytes. +fI[0] = #4404 de81 e40a 34b cf4f += 9.9999999999999999994e+309 +fI[1] = #4404 de81 e40a 34b cf4f += 1e+310 +fI[1] == strtox + + +Input: 9.0259718793241475e-277 + +strtox consumes 23 bytes and returns 33 +with bits = #3c69 ffff ffff ffff fcf7 +printf("%.21Lg") gives 9.02597187932414750016e-277 +g_xfmt(0) gives 23 bytes: "9.0259718793241475e-277" + +strtoIx returns 33, consuming 23 bytes. +fI[0] = #3c69 ffff ffff ffff fcf6 += 9.02597187932414749967e-277 +fI[1] = #3c69 ffff ffff ffff fcf6 += 9.02597187932414750016e-277 +fI[1] == strtox + + +Input: 9.025971879324147880346310405869e-277 + +strtox consumes 37 bytes and returns 17 +with bits = #3c6a 8000 0 0 0 +printf("%.21Lg") gives 9.02597187932414788035e-277 +g_xfmt(0) gives 26 bytes: "9.0259718793241478803e-277" + +strtoIx returns 17, consuming 37 bytes. +fI[0] = #3c6a 8000 0 0 0 += 9.02597187932414788035e-277 +fI[1] = #3c6a 8000 0 0 0 += 9.02597187932414788132e-277 +fI[0] == strtox + + +Input: 9.025971879324147880346310405868e-277 + +strtox consumes 37 bytes and returns 33 +with bits = #3c6a 8000 0 0 0 +printf("%.21Lg") gives 9.02597187932414788035e-277 +g_xfmt(0) gives 26 bytes: "9.0259718793241478803e-277" + +strtoIx returns 33, consuming 37 bytes. +fI[0] = #3c69 ffff ffff ffff ffff += 9.02597187932414787986e-277 +fI[1] = #3c6a 8000 0 ffff ffff += 9.02597187932414788035e-277 +fI[1] == strtox + + +Input: 2.2250738585072014e-308 + +strtox consumes 23 bytes and returns 17 +with bits = #3c01 8000 0 0 46 +printf("%.21Lg") gives 2.22507385850720139998e-308 +g_xfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoIx returns 17, consuming 23 bytes. +fI[0] = #3c01 8000 0 0 46 += 2.22507385850720139998e-308 +fI[1] = #3c01 8000 0 0 46 += 2.22507385850720140022e-308 +fI[0] == strtox + + +Input: 2.2250738585072013e-308 + +strtox consumes 23 bytes and returns 17 +with bits = #3c00 ffff ffff ffff fd4f +printf("%.21Lg") gives 2.22507385850720129998e-308 +g_xfmt(0) gives 23 bytes: "2.2250738585072013e-308" + +strtoIx returns 17, consuming 23 bytes. +fI[0] = #3c00 ffff ffff ffff fd4f += 2.22507385850720129998e-308 +fI[1] = #3c00 ffff ffff ffff fd4f += 2.2250738585072013001e-308 +fI[0] == strtox + +Rounding mode for strtor... changed from 1 (nearest) to 0 (toward zero) + +Input: 1.1 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff 8ccc cccc cccc cccc +printf("%.21Lg") gives 1.09999999999999999991 +g_xfmt(0) gives 21 bytes: "1.0999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 8ccc cccc cccc cccc += 1.09999999999999999991 +fI[1] = #3fff 8ccc cccc cccc cccc += 1.10000000000000000002 +fI[0] == strtox + + +Input: -1.1 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff 8ccc cccc cccc cccc +printf("%.21Lg") gives -1.09999999999999999991 +g_xfmt(0) gives 22 bytes: "-1.0999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 8ccc cccc cccc cccd += -1.10000000000000000002 +fI[1] = #bfff 8ccc cccc cccc cccd += -1.09999999999999999991 +fI[1] == strtox + + +Input: 1.2 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff 9999 9999 9999 9999 +printf("%.21Lg") gives 1.19999999999999999993 +g_xfmt(0) gives 21 bytes: "1.1999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 9999 9999 9999 9999 += 1.19999999999999999993 +fI[1] = #3fff 9999 9999 9999 9999 += 1.20000000000000000004 +fI[0] == strtox + + +Input: -1.2 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff 9999 9999 9999 9999 +printf("%.21Lg") gives -1.19999999999999999993 +g_xfmt(0) gives 22 bytes: "-1.1999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 9999 9999 9999 999a += -1.20000000000000000004 +fI[1] = #bfff 9999 9999 9999 999a += -1.19999999999999999993 +fI[1] == strtox + + +Input: 1.3 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff a666 6666 6666 6666 +printf("%.21Lg") gives 1.29999999999999999996 +g_xfmt(0) gives 3 bytes: "1.3" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff a666 6666 6666 6666 += 1.29999999999999999996 +fI[1] = #3fff a666 6666 6666 6666 += 1.30000000000000000007 +fI[0] == strtox + + +Input: -1.3 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff a666 6666 6666 6666 +printf("%.21Lg") gives -1.29999999999999999996 +g_xfmt(0) gives 4 bytes: "-1.3" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff a666 6666 6666 6667 += -1.30000000000000000007 +fI[1] = #bfff a666 6666 6666 6667 += -1.29999999999999999996 +fI[1] == strtox + + +Input: 1.4 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff b333 3333 3333 3333 +printf("%.21Lg") gives 1.39999999999999999998 +g_xfmt(0) gives 3 bytes: "1.4" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff b333 3333 3333 3333 += 1.39999999999999999998 +fI[1] = #3fff b333 3333 3333 3333 += 1.40000000000000000009 +fI[0] == strtox + + +Input: -1.4 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff b333 3333 3333 3333 +printf("%.21Lg") gives -1.39999999999999999998 +g_xfmt(0) gives 4 bytes: "-1.4" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff b333 3333 3333 3334 += -1.40000000000000000009 +fI[1] = #bfff b333 3333 3333 3334 += -1.39999999999999999998 +fI[1] == strtox + + +Input: 1.5 + +strtox consumes 3 bytes and returns 1 +with bits = #3fff c000 0 0 0 +printf("%.21Lg") gives 1.5 +g_xfmt(0) gives 3 bytes: "1.5" + +strtoIx returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtox + + +Input: -1.5 + +strtox consumes 4 bytes and returns 9 +with bits = #bfff c000 0 0 0 +printf("%.21Lg") gives -1.5 +g_xfmt(0) gives 4 bytes: "-1.5" + +strtoIx returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.6 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff cccc cccc cccc cccc +printf("%.21Lg") gives 1.59999999999999999991 +g_xfmt(0) gives 21 bytes: "1.5999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff cccc cccc cccc cccc += 1.59999999999999999991 +fI[1] = #3fff cccc cccc cccc cccc += 1.60000000000000000002 +fI[0] == strtox + + +Input: -1.6 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff cccc cccc cccc cccc +printf("%.21Lg") gives -1.59999999999999999991 +g_xfmt(0) gives 22 bytes: "-1.5999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff cccc cccc cccc cccd += -1.60000000000000000002 +fI[1] = #bfff cccc cccc cccc cccd += -1.59999999999999999991 +fI[1] == strtox + + +Input: 1.7 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff d999 9999 9999 9999 +printf("%.21Lg") gives 1.69999999999999999993 +g_xfmt(0) gives 21 bytes: "1.6999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff d999 9999 9999 9999 += 1.69999999999999999993 +fI[1] = #3fff d999 9999 9999 9999 += 1.70000000000000000004 +fI[0] == strtox + + +Input: -1.7 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff d999 9999 9999 9999 +printf("%.21Lg") gives -1.69999999999999999993 +g_xfmt(0) gives 22 bytes: "-1.6999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff d999 9999 9999 999a += -1.70000000000000000004 +fI[1] = #bfff d999 9999 9999 999a += -1.69999999999999999993 +fI[1] == strtox + + +Input: 1.8 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff e666 6666 6666 6666 +printf("%.21Lg") gives 1.79999999999999999996 +g_xfmt(0) gives 3 bytes: "1.8" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff e666 6666 6666 6666 += 1.79999999999999999996 +fI[1] = #3fff e666 6666 6666 6666 += 1.80000000000000000007 +fI[0] == strtox + + +Input: -1.8 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff e666 6666 6666 6666 +printf("%.21Lg") gives -1.79999999999999999996 +g_xfmt(0) gives 4 bytes: "-1.8" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff e666 6666 6666 6667 += -1.80000000000000000007 +fI[1] = #bfff e666 6666 6666 6667 += -1.79999999999999999996 +fI[1] == strtox + + +Input: 1.9 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff f333 3333 3333 3333 +printf("%.21Lg") gives 1.89999999999999999998 +g_xfmt(0) gives 3 bytes: "1.9" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff f333 3333 3333 3333 += 1.89999999999999999998 +fI[1] = #3fff f333 3333 3333 3333 += 1.90000000000000000009 +fI[0] == strtox + + +Input: -1.9 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff f333 3333 3333 3333 +printf("%.21Lg") gives -1.89999999999999999998 +g_xfmt(0) gives 4 bytes: "-1.9" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff f333 3333 3333 3334 += -1.90000000000000000009 +fI[1] = #bfff f333 3333 3333 3334 += -1.89999999999999999998 +fI[1] == strtox + +Rounding mode for strtor... changed from 0 (toward zero) to 1 (nearest) + +Input: 1.1 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff 8ccc cccc cccc cccd +printf("%.21Lg") gives 1.10000000000000000002 +g_xfmt(0) gives 3 bytes: "1.1" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 8ccc cccc cccc cccc += 1.09999999999999999991 +fI[1] = #3fff 8ccc cccc cccc cccc += 1.10000000000000000002 +fI[1] == strtox + + +Input: -1.1 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff 8ccc cccc cccc cccd +printf("%.21Lg") gives -1.10000000000000000002 +g_xfmt(0) gives 4 bytes: "-1.1" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 8ccc cccc cccc cccd += -1.10000000000000000002 +fI[1] = #bfff 8ccc cccc cccc cccd += -1.09999999999999999991 +fI[0] == strtox + + +Input: 1.2 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff 9999 9999 9999 999a +printf("%.21Lg") gives 1.20000000000000000004 +g_xfmt(0) gives 3 bytes: "1.2" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 9999 9999 9999 9999 += 1.19999999999999999993 +fI[1] = #3fff 9999 9999 9999 9999 += 1.20000000000000000004 +fI[1] == strtox + + +Input: -1.2 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff 9999 9999 9999 999a +printf("%.21Lg") gives -1.20000000000000000004 +g_xfmt(0) gives 4 bytes: "-1.2" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 9999 9999 9999 999a += -1.20000000000000000004 +fI[1] = #bfff 9999 9999 9999 999a += -1.19999999999999999993 +fI[0] == strtox + + +Input: 1.3 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff a666 6666 6666 6666 +printf("%.21Lg") gives 1.29999999999999999996 +g_xfmt(0) gives 3 bytes: "1.3" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff a666 6666 6666 6666 += 1.29999999999999999996 +fI[1] = #3fff a666 6666 6666 6666 += 1.30000000000000000007 +fI[0] == strtox + + +Input: -1.3 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff a666 6666 6666 6666 +printf("%.21Lg") gives -1.29999999999999999996 +g_xfmt(0) gives 4 bytes: "-1.3" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff a666 6666 6666 6667 += -1.30000000000000000007 +fI[1] = #bfff a666 6666 6666 6667 += -1.29999999999999999996 +fI[1] == strtox + + +Input: 1.4 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff b333 3333 3333 3333 +printf("%.21Lg") gives 1.39999999999999999998 +g_xfmt(0) gives 3 bytes: "1.4" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff b333 3333 3333 3333 += 1.39999999999999999998 +fI[1] = #3fff b333 3333 3333 3333 += 1.40000000000000000009 +fI[0] == strtox + + +Input: -1.4 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff b333 3333 3333 3333 +printf("%.21Lg") gives -1.39999999999999999998 +g_xfmt(0) gives 4 bytes: "-1.4" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff b333 3333 3333 3334 += -1.40000000000000000009 +fI[1] = #bfff b333 3333 3333 3334 += -1.39999999999999999998 +fI[1] == strtox + + +Input: 1.5 + +strtox consumes 3 bytes and returns 1 +with bits = #3fff c000 0 0 0 +printf("%.21Lg") gives 1.5 +g_xfmt(0) gives 3 bytes: "1.5" + +strtoIx returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtox + + +Input: -1.5 + +strtox consumes 4 bytes and returns 9 +with bits = #bfff c000 0 0 0 +printf("%.21Lg") gives -1.5 +g_xfmt(0) gives 4 bytes: "-1.5" + +strtoIx returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.6 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff cccc cccc cccc cccd +printf("%.21Lg") gives 1.60000000000000000002 +g_xfmt(0) gives 3 bytes: "1.6" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff cccc cccc cccc cccc += 1.59999999999999999991 +fI[1] = #3fff cccc cccc cccc cccc += 1.60000000000000000002 +fI[1] == strtox + + +Input: -1.6 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff cccc cccc cccc cccd +printf("%.21Lg") gives -1.60000000000000000002 +g_xfmt(0) gives 4 bytes: "-1.6" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff cccc cccc cccc cccd += -1.60000000000000000002 +fI[1] = #bfff cccc cccc cccc cccd += -1.59999999999999999991 +fI[0] == strtox + + +Input: 1.7 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff d999 9999 9999 999a +printf("%.21Lg") gives 1.70000000000000000004 +g_xfmt(0) gives 3 bytes: "1.7" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff d999 9999 9999 9999 += 1.69999999999999999993 +fI[1] = #3fff d999 9999 9999 9999 += 1.70000000000000000004 +fI[1] == strtox + + +Input: -1.7 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff d999 9999 9999 999a +printf("%.21Lg") gives -1.70000000000000000004 +g_xfmt(0) gives 4 bytes: "-1.7" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff d999 9999 9999 999a += -1.70000000000000000004 +fI[1] = #bfff d999 9999 9999 999a += -1.69999999999999999993 +fI[0] == strtox + + +Input: 1.8 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff e666 6666 6666 6666 +printf("%.21Lg") gives 1.79999999999999999996 +g_xfmt(0) gives 3 bytes: "1.8" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff e666 6666 6666 6666 += 1.79999999999999999996 +fI[1] = #3fff e666 6666 6666 6666 += 1.80000000000000000007 +fI[0] == strtox + + +Input: -1.8 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff e666 6666 6666 6666 +printf("%.21Lg") gives -1.79999999999999999996 +g_xfmt(0) gives 4 bytes: "-1.8" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff e666 6666 6666 6667 += -1.80000000000000000007 +fI[1] = #bfff e666 6666 6666 6667 += -1.79999999999999999996 +fI[1] == strtox + + +Input: 1.9 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff f333 3333 3333 3333 +printf("%.21Lg") gives 1.89999999999999999998 +g_xfmt(0) gives 3 bytes: "1.9" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff f333 3333 3333 3333 += 1.89999999999999999998 +fI[1] = #3fff f333 3333 3333 3333 += 1.90000000000000000009 +fI[0] == strtox + + +Input: -1.9 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff f333 3333 3333 3333 +printf("%.21Lg") gives -1.89999999999999999998 +g_xfmt(0) gives 4 bytes: "-1.9" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff f333 3333 3333 3334 += -1.90000000000000000009 +fI[1] = #bfff f333 3333 3333 3334 += -1.89999999999999999998 +fI[1] == strtox + +Rounding mode for strtor... changed from 1 (nearest) to 2 (toward +Infinity) + +Input: 1.1 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff 8ccc cccc cccc cccd +printf("%.21Lg") gives 1.10000000000000000002 +g_xfmt(0) gives 3 bytes: "1.1" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 8ccc cccc cccc cccc += 1.09999999999999999991 +fI[1] = #3fff 8ccc cccc cccc cccc += 1.10000000000000000002 +fI[1] == strtox + + +Input: -1.1 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff 8ccc cccc cccc cccc +printf("%.21Lg") gives -1.09999999999999999991 +g_xfmt(0) gives 22 bytes: "-1.0999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 8ccc cccc cccc cccd += -1.10000000000000000002 +fI[1] = #bfff 8ccc cccc cccc cccd += -1.09999999999999999991 +fI[1] == strtox + + +Input: 1.2 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff 9999 9999 9999 999a +printf("%.21Lg") gives 1.20000000000000000004 +g_xfmt(0) gives 3 bytes: "1.2" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 9999 9999 9999 9999 += 1.19999999999999999993 +fI[1] = #3fff 9999 9999 9999 9999 += 1.20000000000000000004 +fI[1] == strtox + + +Input: -1.2 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff 9999 9999 9999 9999 +printf("%.21Lg") gives -1.19999999999999999993 +g_xfmt(0) gives 22 bytes: "-1.1999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 9999 9999 9999 999a += -1.20000000000000000004 +fI[1] = #bfff 9999 9999 9999 999a += -1.19999999999999999993 +fI[1] == strtox + + +Input: 1.3 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff a666 6666 6666 6667 +printf("%.21Lg") gives 1.30000000000000000007 +g_xfmt(0) gives 21 bytes: "1.3000000000000000001" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff a666 6666 6666 6666 += 1.29999999999999999996 +fI[1] = #3fff a666 6666 6666 6666 += 1.30000000000000000007 +fI[1] == strtox + + +Input: -1.3 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff a666 6666 6666 6666 +printf("%.21Lg") gives -1.29999999999999999996 +g_xfmt(0) gives 4 bytes: "-1.3" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff a666 6666 6666 6667 += -1.30000000000000000007 +fI[1] = #bfff a666 6666 6666 6667 += -1.29999999999999999996 +fI[1] == strtox + + +Input: 1.4 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff b333 3333 3333 3334 +printf("%.21Lg") gives 1.40000000000000000009 +g_xfmt(0) gives 21 bytes: "1.4000000000000000001" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff b333 3333 3333 3333 += 1.39999999999999999998 +fI[1] = #3fff b333 3333 3333 3333 += 1.40000000000000000009 +fI[1] == strtox + + +Input: -1.4 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff b333 3333 3333 3333 +printf("%.21Lg") gives -1.39999999999999999998 +g_xfmt(0) gives 4 bytes: "-1.4" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff b333 3333 3333 3334 += -1.40000000000000000009 +fI[1] = #bfff b333 3333 3333 3334 += -1.39999999999999999998 +fI[1] == strtox + + +Input: 1.5 + +strtox consumes 3 bytes and returns 1 +with bits = #3fff c000 0 0 0 +printf("%.21Lg") gives 1.5 +g_xfmt(0) gives 3 bytes: "1.5" + +strtoIx returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtox + + +Input: -1.5 + +strtox consumes 4 bytes and returns 9 +with bits = #bfff c000 0 0 0 +printf("%.21Lg") gives -1.5 +g_xfmt(0) gives 4 bytes: "-1.5" + +strtoIx returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.6 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff cccc cccc cccc cccd +printf("%.21Lg") gives 1.60000000000000000002 +g_xfmt(0) gives 3 bytes: "1.6" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff cccc cccc cccc cccc += 1.59999999999999999991 +fI[1] = #3fff cccc cccc cccc cccc += 1.60000000000000000002 +fI[1] == strtox + + +Input: -1.6 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff cccc cccc cccc cccc +printf("%.21Lg") gives -1.59999999999999999991 +g_xfmt(0) gives 22 bytes: "-1.5999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff cccc cccc cccc cccd += -1.60000000000000000002 +fI[1] = #bfff cccc cccc cccc cccd += -1.59999999999999999991 +fI[1] == strtox + + +Input: 1.7 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff d999 9999 9999 999a +printf("%.21Lg") gives 1.70000000000000000004 +g_xfmt(0) gives 3 bytes: "1.7" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff d999 9999 9999 9999 += 1.69999999999999999993 +fI[1] = #3fff d999 9999 9999 9999 += 1.70000000000000000004 +fI[1] == strtox + + +Input: -1.7 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff d999 9999 9999 9999 +printf("%.21Lg") gives -1.69999999999999999993 +g_xfmt(0) gives 22 bytes: "-1.6999999999999999999" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff d999 9999 9999 999a += -1.70000000000000000004 +fI[1] = #bfff d999 9999 9999 999a += -1.69999999999999999993 +fI[1] == strtox + + +Input: 1.8 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff e666 6666 6666 6667 +printf("%.21Lg") gives 1.80000000000000000007 +g_xfmt(0) gives 21 bytes: "1.8000000000000000001" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff e666 6666 6666 6666 += 1.79999999999999999996 +fI[1] = #3fff e666 6666 6666 6666 += 1.80000000000000000007 +fI[1] == strtox + + +Input: -1.8 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff e666 6666 6666 6666 +printf("%.21Lg") gives -1.79999999999999999996 +g_xfmt(0) gives 4 bytes: "-1.8" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff e666 6666 6666 6667 += -1.80000000000000000007 +fI[1] = #bfff e666 6666 6666 6667 += -1.79999999999999999996 +fI[1] == strtox + + +Input: 1.9 + +strtox consumes 3 bytes and returns 33 +with bits = #3fff f333 3333 3333 3334 +printf("%.21Lg") gives 1.90000000000000000009 +g_xfmt(0) gives 21 bytes: "1.9000000000000000001" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff f333 3333 3333 3333 += 1.89999999999999999998 +fI[1] = #3fff f333 3333 3333 3333 += 1.90000000000000000009 +fI[1] == strtox + + +Input: -1.9 + +strtox consumes 4 bytes and returns 25 +with bits = #bfff f333 3333 3333 3333 +printf("%.21Lg") gives -1.89999999999999999998 +g_xfmt(0) gives 4 bytes: "-1.9" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff f333 3333 3333 3334 += -1.90000000000000000009 +fI[1] = #bfff f333 3333 3333 3334 += -1.89999999999999999998 +fI[1] == strtox + +Rounding mode for strtor... changed from 2 (toward +Infinity) to 3 (toward -Infinity) + +Input: 1.1 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff 8ccc cccc cccc cccc +printf("%.21Lg") gives 1.09999999999999999991 +g_xfmt(0) gives 21 bytes: "1.0999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 8ccc cccc cccc cccc += 1.09999999999999999991 +fI[1] = #3fff 8ccc cccc cccc cccc += 1.10000000000000000002 +fI[0] == strtox + + +Input: -1.1 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff 8ccc cccc cccc cccd +printf("%.21Lg") gives -1.10000000000000000002 +g_xfmt(0) gives 4 bytes: "-1.1" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 8ccc cccc cccc cccd += -1.10000000000000000002 +fI[1] = #bfff 8ccc cccc cccc cccd += -1.09999999999999999991 +fI[0] == strtox + + +Input: 1.2 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff 9999 9999 9999 9999 +printf("%.21Lg") gives 1.19999999999999999993 +g_xfmt(0) gives 21 bytes: "1.1999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff 9999 9999 9999 9999 += 1.19999999999999999993 +fI[1] = #3fff 9999 9999 9999 9999 += 1.20000000000000000004 +fI[0] == strtox + + +Input: -1.2 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff 9999 9999 9999 999a +printf("%.21Lg") gives -1.20000000000000000004 +g_xfmt(0) gives 4 bytes: "-1.2" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff 9999 9999 9999 999a += -1.20000000000000000004 +fI[1] = #bfff 9999 9999 9999 999a += -1.19999999999999999993 +fI[0] == strtox + + +Input: 1.3 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff a666 6666 6666 6666 +printf("%.21Lg") gives 1.29999999999999999996 +g_xfmt(0) gives 3 bytes: "1.3" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff a666 6666 6666 6666 += 1.29999999999999999996 +fI[1] = #3fff a666 6666 6666 6666 += 1.30000000000000000007 +fI[0] == strtox + + +Input: -1.3 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff a666 6666 6666 6667 +printf("%.21Lg") gives -1.30000000000000000007 +g_xfmt(0) gives 22 bytes: "-1.3000000000000000001" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff a666 6666 6666 6667 += -1.30000000000000000007 +fI[1] = #bfff a666 6666 6666 6667 += -1.29999999999999999996 +fI[0] == strtox + + +Input: 1.4 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff b333 3333 3333 3333 +printf("%.21Lg") gives 1.39999999999999999998 +g_xfmt(0) gives 3 bytes: "1.4" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff b333 3333 3333 3333 += 1.39999999999999999998 +fI[1] = #3fff b333 3333 3333 3333 += 1.40000000000000000009 +fI[0] == strtox + + +Input: -1.4 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff b333 3333 3333 3334 +printf("%.21Lg") gives -1.40000000000000000009 +g_xfmt(0) gives 22 bytes: "-1.4000000000000000001" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff b333 3333 3333 3334 += -1.40000000000000000009 +fI[1] = #bfff b333 3333 3333 3334 += -1.39999999999999999998 +fI[0] == strtox + + +Input: 1.5 + +strtox consumes 3 bytes and returns 1 +with bits = #3fff c000 0 0 0 +printf("%.21Lg") gives 1.5 +g_xfmt(0) gives 3 bytes: "1.5" + +strtoIx returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtox + + +Input: -1.5 + +strtox consumes 4 bytes and returns 9 +with bits = #bfff c000 0 0 0 +printf("%.21Lg") gives -1.5 +g_xfmt(0) gives 4 bytes: "-1.5" + +strtoIx returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtox + + +Input: 1.6 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff cccc cccc cccc cccc +printf("%.21Lg") gives 1.59999999999999999991 +g_xfmt(0) gives 21 bytes: "1.5999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff cccc cccc cccc cccc += 1.59999999999999999991 +fI[1] = #3fff cccc cccc cccc cccc += 1.60000000000000000002 +fI[0] == strtox + + +Input: -1.6 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff cccc cccc cccc cccd +printf("%.21Lg") gives -1.60000000000000000002 +g_xfmt(0) gives 4 bytes: "-1.6" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff cccc cccc cccc cccd += -1.60000000000000000002 +fI[1] = #bfff cccc cccc cccc cccd += -1.59999999999999999991 +fI[0] == strtox + + +Input: 1.7 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff d999 9999 9999 9999 +printf("%.21Lg") gives 1.69999999999999999993 +g_xfmt(0) gives 21 bytes: "1.6999999999999999999" + +strtoIx returns 33, consuming 3 bytes. +fI[0] = #3fff d999 9999 9999 9999 += 1.69999999999999999993 +fI[1] = #3fff d999 9999 9999 9999 += 1.70000000000000000004 +fI[0] == strtox + + +Input: -1.7 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff d999 9999 9999 999a +printf("%.21Lg") gives -1.70000000000000000004 +g_xfmt(0) gives 4 bytes: "-1.7" + +strtoIx returns 41, consuming 4 bytes. +fI[0] = #bfff d999 9999 9999 999a += -1.70000000000000000004 +fI[1] = #bfff d999 9999 9999 999a += -1.69999999999999999993 +fI[0] == strtox + + +Input: 1.8 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff e666 6666 6666 6666 +printf("%.21Lg") gives 1.79999999999999999996 +g_xfmt(0) gives 3 bytes: "1.8" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff e666 6666 6666 6666 += 1.79999999999999999996 +fI[1] = #3fff e666 6666 6666 6666 += 1.80000000000000000007 +fI[0] == strtox + + +Input: -1.8 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff e666 6666 6666 6667 +printf("%.21Lg") gives -1.80000000000000000007 +g_xfmt(0) gives 22 bytes: "-1.8000000000000000001" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff e666 6666 6666 6667 += -1.80000000000000000007 +fI[1] = #bfff e666 6666 6666 6667 += -1.79999999999999999996 +fI[0] == strtox + + +Input: 1.9 + +strtox consumes 3 bytes and returns 17 +with bits = #3fff f333 3333 3333 3333 +printf("%.21Lg") gives 1.89999999999999999998 +g_xfmt(0) gives 3 bytes: "1.9" + +strtoIx returns 17, consuming 3 bytes. +fI[0] = #3fff f333 3333 3333 3333 += 1.89999999999999999998 +fI[1] = #3fff f333 3333 3333 3333 += 1.90000000000000000009 +fI[0] == strtox + + +Input: -1.9 + +strtox consumes 4 bytes and returns 41 +with bits = #bfff f333 3333 3333 3334 +printf("%.21Lg") gives -1.90000000000000000009 +g_xfmt(0) gives 22 bytes: "-1.9000000000000000001" + +strtoIx returns 25, consuming 4 bytes. +fI[0] = #bfff f333 3333 3333 3334 += -1.90000000000000000009 +fI[1] = #bfff f333 3333 3333 3334 += -1.89999999999999999998 +fI[0] == strtox + diff --git a/contrib/gdtoa/test/xL.ou0 b/contrib/gdtoa/test/xL.ou0 new file mode 100644 index 0000000..dc75f91 --- /dev/null +++ b/contrib/gdtoa/test/xL.ou0 @@ -0,0 +1,1182 @@ + +Input: 1.23 + +strtoxL consumes 4 bytes and returns 33 +with bits = #3fff0000 9d70a3d7 a3d70a4 +g_xLfmt(0) gives 4 bytes: "1.23" + +strtoIxL returns 33, consuming 4 bytes. +fI[0] = #3fff0000 9d70a3d7 a3d70a3 +fI[1] = #3fff0000 9d70a3d7 a3d70a4 +fI[1] == strtoxL + + +Input: 1.23e+20 + +strtoxL consumes 8 bytes and returns 1 +with bits = #40410000 d55ef90a 2da18000 +g_xLfmt(0) gives 8 bytes: "1.23e+20" + +strtoIxL returns 1, consuming 8 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.23e-20 + +strtoxL consumes 8 bytes and returns 17 +with bits = #3fbc0000 e857267b b3a984f2 +g_xLfmt(0) gives 8 bytes: "1.23e-20" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #3fbc0000 e857267b b3a984f2 +fI[1] = #3fbc0000 e857267b b3a984f3 +fI[0] == strtoxL + + +Input: 1.23456789 + +strtoxL consumes 10 bytes and returns 33 +with bits = #3fff0000 9e065214 1ef0dbf6 +g_xLfmt(0) gives 10 bytes: "1.23456789" + +strtoIxL returns 33, consuming 10 bytes. +fI[0] = #3fff0000 9e065214 1ef0dbf5 +fI[1] = #3fff0000 9e065214 1ef0dbf6 +fI[1] == strtoxL + + +Input: 1.23456589e+20 + +strtoxL consumes 14 bytes and returns 1 +with bits = #40410000 d629bd33 5ccba00 +g_xLfmt(0) gives 14 bytes: "1.23456589e+20" + +strtoIxL returns 1, consuming 14 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.23e+30 + +strtoxL consumes 8 bytes and returns 17 +with bits = #40620000 f8658274 7dbc824a +g_xLfmt(0) gives 8 bytes: "1.23e+30" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #40620000 f8658274 7dbc824a +fI[1] = #40620000 f8658274 7dbc824b +fI[0] == strtoxL + + +Input: 1.23e-30 + +strtoxL consumes 8 bytes and returns 17 +with bits = #3f9b0000 c794337a 808554eb +g_xLfmt(0) gives 8 bytes: "1.23e-30" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #3f9b0000 c794337a 808554eb +fI[1] = #3f9b0000 c794337a 808554ec +fI[0] == strtoxL + + +Input: 1.23456789e-20 + +strtoxL consumes 14 bytes and returns 17 +with bits = #3fbc0000 e9340a38 f3d6d352 +g_xLfmt(0) gives 14 bytes: "1.23456789e-20" + +strtoIxL returns 17, consuming 14 bytes. +fI[0] = #3fbc0000 e9340a38 f3d6d352 +fI[1] = #3fbc0000 e9340a38 f3d6d353 +fI[0] == strtoxL + + +Input: 1.23456789e-30 + +strtoxL consumes 14 bytes and returns 17 +with bits = #3f9b0000 c851f19d decca8fc +g_xLfmt(0) gives 14 bytes: "1.23456789e-30" + +strtoIxL returns 17, consuming 14 bytes. +fI[0] = #3f9b0000 c851f19d decca8fc +fI[1] = #3f9b0000 c851f19d decca8fd +fI[0] == strtoxL + + +Input: 1.234567890123456789 + +strtoxL consumes 20 bytes and returns 17 +with bits = #3fff0000 9e065214 62cfdb8d +g_xLfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIxL returns 17, consuming 20 bytes. +fI[0] = #3fff0000 9e065214 62cfdb8d +fI[1] = #3fff0000 9e065214 62cfdb8e +fI[0] == strtoxL + + +Input: 1.23456789012345678901234567890123456789 + +strtoxL consumes 40 bytes and returns 17 +with bits = #3fff0000 9e065214 62cfdb8d +g_xLfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIxL returns 17, consuming 40 bytes. +fI[0] = #3fff0000 9e065214 62cfdb8d +fI[1] = #3fff0000 9e065214 62cfdb8e +fI[0] == strtoxL + + +Input: 1.23e306 + +strtoxL consumes 8 bytes and returns 17 +with bits = #43f70000 e033b668 e30fa6d5 +g_xLfmt(0) gives 9 bytes: "1.23e+306" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #43f70000 e033b668 e30fa6d5 +fI[1] = #43f70000 e033b668 e30fa6d6 +fI[0] == strtoxL + + +Input: 1.23e-306 + +strtoxL consumes 9 bytes and returns 33 +with bits = #3c060000 dd1dc2ed 1cb73f25 +g_xLfmt(0) gives 9 bytes: "1.23e-306" + +strtoIxL returns 33, consuming 9 bytes. +fI[0] = #3c060000 dd1dc2ed 1cb73f24 +fI[1] = #3c060000 dd1dc2ed 1cb73f25 +fI[1] == strtoxL + + +Input: 1.23e-320 + +strtoxL consumes 9 bytes and returns 33 +with bits = #3bd80000 9b98c371 844c3f1a +g_xLfmt(0) gives 9 bytes: "1.23e-320" + +strtoIxL returns 33, consuming 9 bytes. +fI[0] = #3bd80000 9b98c371 844c3f19 +fI[1] = #3bd80000 9b98c371 844c3f1a +fI[1] == strtoxL + + +Input: 1.23e-20 + +strtoxL consumes 8 bytes and returns 17 +with bits = #3fbc0000 e857267b b3a984f2 +g_xLfmt(0) gives 8 bytes: "1.23e-20" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #3fbc0000 e857267b b3a984f2 +fI[1] = #3fbc0000 e857267b b3a984f3 +fI[0] == strtoxL + + +Input: 1.23456789e307 + +strtoxL consumes 14 bytes and returns 17 +with bits = #43fb0000 8ca58a5e d766de75 +g_xLfmt(0) gives 15 bytes: "1.23456789e+307" + +strtoIxL returns 17, consuming 14 bytes. +fI[0] = #43fb0000 8ca58a5e d766de75 +fI[1] = #43fb0000 8ca58a5e d766de76 +fI[0] == strtoxL + + +Input: 1.23456589e-307 + +strtoxL consumes 15 bytes and returns 17 +with bits = #3c030000 b18cb5dc c22fd369 +g_xLfmt(0) gives 15 bytes: "1.23456589e-307" + +strtoIxL returns 17, consuming 15 bytes. +fI[0] = #3c030000 b18cb5dc c22fd369 +fI[1] = #3c030000 b18cb5dc c22fd36a +fI[0] == strtoxL + + +Input: 1.234567890123456789 + +strtoxL consumes 20 bytes and returns 17 +with bits = #3fff0000 9e065214 62cfdb8d +g_xLfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIxL returns 17, consuming 20 bytes. +fI[0] = #3fff0000 9e065214 62cfdb8d +fI[1] = #3fff0000 9e065214 62cfdb8e +fI[0] == strtoxL + + +Input: 1.234567890123456789e301 + +strtoxL consumes 24 bytes and returns 33 +with bits = #43e70000 937a8baf ab20980c +g_xLfmt(0) gives 25 bytes: "1.234567890123456789e+301" + +strtoIxL returns 33, consuming 24 bytes. +fI[0] = #43e70000 937a8baf ab20980b +fI[1] = #43e70000 937a8baf ab20980c +fI[1] == strtoxL + + +Input: 1.234567890123456789e-301 + +strtoxL consumes 25 bytes and returns 33 +with bits = #3c170000 a953271a 5d069ad9 +g_xLfmt(0) gives 25 bytes: "1.234567890123456789e-301" + +strtoIxL returns 33, consuming 25 bytes. +fI[0] = #3c170000 a953271a 5d069ad8 +fI[1] = #3c170000 a953271a 5d069ad9 +fI[1] == strtoxL + + +Input: 1.234567890123456789e-321 + +strtoxL consumes 25 bytes and returns 33 +with bits = #3bd40000 f9e11b4c ea6dcce9 +g_xLfmt(0) gives 25 bytes: "1.234567890123456789e-321" + +strtoIxL returns 33, consuming 25 bytes. +fI[0] = #3bd40000 f9e11b4c ea6dcce8 +fI[1] = #3bd40000 f9e11b4c ea6dcce9 +fI[1] == strtoxL + + +Input: 1e23 + +strtoxL consumes 4 bytes and returns 1 +with bits = #404b0000 a968163f a57b400 +g_xLfmt(0) gives 5 bytes: "1e+23" + +strtoIxL returns 1, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1e310 + +strtoxL consumes 5 bytes and returns 33 +with bits = #44040000 de81e40a 34bcf50 +g_xLfmt(0) gives 6 bytes: "1e+310" + +strtoIxL returns 33, consuming 5 bytes. +fI[0] = #44040000 de81e40a 34bcf4f +fI[1] = #44040000 de81e40a 34bcf50 +fI[1] == strtoxL + + +Input: 9.0259718793241475e-277 + +strtoxL consumes 23 bytes and returns 33 +with bits = #3c690000 ffffffff fffffcf7 +g_xLfmt(0) gives 23 bytes: "9.0259718793241475e-277" + +strtoIxL returns 33, consuming 23 bytes. +fI[0] = #3c690000 ffffffff fffffcf6 +fI[1] = #3c690000 ffffffff fffffcf7 +fI[1] == strtoxL + + +Input: 9.025971879324147880346310405869e-277 + +strtoxL consumes 37 bytes and returns 17 +with bits = #3c6a0000 80000000 0 +g_xLfmt(0) gives 26 bytes: "9.0259718793241478803e-277" + +strtoIxL returns 17, consuming 37 bytes. +fI[0] = #3c6a0000 80000000 0 +fI[1] = #3c6a0000 80000000 1 +fI[0] == strtoxL + + +Input: 9.025971879324147880346310405868e-277 + +strtoxL consumes 37 bytes and returns 33 +with bits = #3c6a0000 80000000 0 +g_xLfmt(0) gives 26 bytes: "9.0259718793241478803e-277" + +strtoIxL returns 33, consuming 37 bytes. +fI[0] = #3c690000 ffffffff ffffffff +fI[1] = #3c6a0000 80000000 0 +fI[1] == strtoxL + + +Input: 2.2250738585072014e-308 + +strtoxL consumes 23 bytes and returns 17 +with bits = #3c010000 80000000 46 +g_xLfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoIxL returns 17, consuming 23 bytes. +fI[0] = #3c010000 80000000 46 +fI[1] = #3c010000 80000000 47 +fI[0] == strtoxL + + +Input: 2.2250738585072013e-308 + +strtoxL consumes 23 bytes and returns 17 +with bits = #3c000000 ffffffff fffffd4f +g_xLfmt(0) gives 23 bytes: "2.2250738585072013e-308" + +strtoIxL returns 17, consuming 23 bytes. +fI[0] = #3c000000 ffffffff fffffd4f +fI[1] = #3c000000 ffffffff fffffd50 +fI[0] == strtoxL + +Rounding mode for strtor... changed from 1 (nearest) to 0 (toward zero) + +Input: 1.1 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 8ccccccc cccccccc +g_xLfmt(0) gives 21 bytes: "1.0999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 8ccccccc cccccccc +fI[1] = #3fff0000 8ccccccc cccccccd +fI[0] == strtoxL + + +Input: -1.1 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 8ccccccc cccccccc +g_xLfmt(0) gives 22 bytes: "-1.0999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 8ccccccc cccccccd +fI[1] = #bfff0000 8ccccccc cccccccc +fI[1] == strtoxL + + +Input: 1.2 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 99999999 99999999 +g_xLfmt(0) gives 21 bytes: "1.1999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 99999999 99999999 +fI[1] = #3fff0000 99999999 9999999a +fI[0] == strtoxL + + +Input: -1.2 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 99999999 99999999 +g_xLfmt(0) gives 22 bytes: "-1.1999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 99999999 9999999a +fI[1] = #bfff0000 99999999 99999999 +fI[1] == strtoxL + + +Input: 1.3 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 a6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.3" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 a6666666 66666666 +fI[1] = #3fff0000 a6666666 66666667 +fI[0] == strtoxL + + +Input: -1.3 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 a6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.3" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 a6666666 66666667 +fI[1] = #bfff0000 a6666666 66666666 +fI[1] == strtoxL + + +Input: 1.4 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 b3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.4" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 b3333333 33333333 +fI[1] = #3fff0000 b3333333 33333334 +fI[0] == strtoxL + + +Input: -1.4 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 b3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.4" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 b3333333 33333334 +fI[1] = #bfff0000 b3333333 33333333 +fI[1] == strtoxL + + +Input: 1.5 + +strtoxL consumes 3 bytes and returns 1 +with bits = #3fff0000 c0000000 0 +g_xLfmt(0) gives 3 bytes: "1.5" + +strtoIxL returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtoxL + + +Input: -1.5 + +strtoxL consumes 4 bytes and returns 9 +with bits = #bfff0000 c0000000 0 +g_xLfmt(0) gives 4 bytes: "-1.5" + +strtoIxL returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.6 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 cccccccc cccccccc +g_xLfmt(0) gives 21 bytes: "1.5999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 cccccccc cccccccc +fI[1] = #3fff0000 cccccccc cccccccd +fI[0] == strtoxL + + +Input: -1.6 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 cccccccc cccccccc +g_xLfmt(0) gives 22 bytes: "-1.5999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 cccccccc cccccccd +fI[1] = #bfff0000 cccccccc cccccccc +fI[1] == strtoxL + + +Input: 1.7 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 d9999999 99999999 +g_xLfmt(0) gives 21 bytes: "1.6999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 d9999999 99999999 +fI[1] = #3fff0000 d9999999 9999999a +fI[0] == strtoxL + + +Input: -1.7 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 d9999999 99999999 +g_xLfmt(0) gives 22 bytes: "-1.6999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 d9999999 9999999a +fI[1] = #bfff0000 d9999999 99999999 +fI[1] == strtoxL + + +Input: 1.8 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 e6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.8" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 e6666666 66666666 +fI[1] = #3fff0000 e6666666 66666667 +fI[0] == strtoxL + + +Input: -1.8 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 e6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.8" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 e6666666 66666667 +fI[1] = #bfff0000 e6666666 66666666 +fI[1] == strtoxL + + +Input: 1.9 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 f3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.9" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 f3333333 33333333 +fI[1] = #3fff0000 f3333333 33333334 +fI[0] == strtoxL + + +Input: -1.9 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 f3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.9" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 f3333333 33333334 +fI[1] = #bfff0000 f3333333 33333333 +fI[1] == strtoxL + +Rounding mode for strtor... changed from 0 (toward zero) to 1 (nearest) + +Input: 1.1 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 8ccccccc cccccccd +g_xLfmt(0) gives 3 bytes: "1.1" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 8ccccccc cccccccc +fI[1] = #3fff0000 8ccccccc cccccccd +fI[1] == strtoxL + + +Input: -1.1 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 8ccccccc cccccccd +g_xLfmt(0) gives 4 bytes: "-1.1" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 8ccccccc cccccccd +fI[1] = #bfff0000 8ccccccc cccccccc +fI[0] == strtoxL + + +Input: 1.2 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 99999999 9999999a +g_xLfmt(0) gives 3 bytes: "1.2" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 99999999 99999999 +fI[1] = #3fff0000 99999999 9999999a +fI[1] == strtoxL + + +Input: -1.2 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 99999999 9999999a +g_xLfmt(0) gives 4 bytes: "-1.2" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 99999999 9999999a +fI[1] = #bfff0000 99999999 99999999 +fI[0] == strtoxL + + +Input: 1.3 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 a6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.3" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 a6666666 66666666 +fI[1] = #3fff0000 a6666666 66666667 +fI[0] == strtoxL + + +Input: -1.3 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 a6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.3" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 a6666666 66666667 +fI[1] = #bfff0000 a6666666 66666666 +fI[1] == strtoxL + + +Input: 1.4 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 b3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.4" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 b3333333 33333333 +fI[1] = #3fff0000 b3333333 33333334 +fI[0] == strtoxL + + +Input: -1.4 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 b3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.4" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 b3333333 33333334 +fI[1] = #bfff0000 b3333333 33333333 +fI[1] == strtoxL + + +Input: 1.5 + +strtoxL consumes 3 bytes and returns 1 +with bits = #3fff0000 c0000000 0 +g_xLfmt(0) gives 3 bytes: "1.5" + +strtoIxL returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtoxL + + +Input: -1.5 + +strtoxL consumes 4 bytes and returns 9 +with bits = #bfff0000 c0000000 0 +g_xLfmt(0) gives 4 bytes: "-1.5" + +strtoIxL returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.6 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 cccccccc cccccccd +g_xLfmt(0) gives 3 bytes: "1.6" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 cccccccc cccccccc +fI[1] = #3fff0000 cccccccc cccccccd +fI[1] == strtoxL + + +Input: -1.6 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 cccccccc cccccccd +g_xLfmt(0) gives 4 bytes: "-1.6" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 cccccccc cccccccd +fI[1] = #bfff0000 cccccccc cccccccc +fI[0] == strtoxL + + +Input: 1.7 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 d9999999 9999999a +g_xLfmt(0) gives 3 bytes: "1.7" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 d9999999 99999999 +fI[1] = #3fff0000 d9999999 9999999a +fI[1] == strtoxL + + +Input: -1.7 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 d9999999 9999999a +g_xLfmt(0) gives 4 bytes: "-1.7" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 d9999999 9999999a +fI[1] = #bfff0000 d9999999 99999999 +fI[0] == strtoxL + + +Input: 1.8 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 e6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.8" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 e6666666 66666666 +fI[1] = #3fff0000 e6666666 66666667 +fI[0] == strtoxL + + +Input: -1.8 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 e6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.8" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 e6666666 66666667 +fI[1] = #bfff0000 e6666666 66666666 +fI[1] == strtoxL + + +Input: 1.9 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 f3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.9" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 f3333333 33333333 +fI[1] = #3fff0000 f3333333 33333334 +fI[0] == strtoxL + + +Input: -1.9 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 f3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.9" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 f3333333 33333334 +fI[1] = #bfff0000 f3333333 33333333 +fI[1] == strtoxL + +Rounding mode for strtor... changed from 1 (nearest) to 2 (toward +Infinity) + +Input: 1.1 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 8ccccccc cccccccd +g_xLfmt(0) gives 3 bytes: "1.1" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 8ccccccc cccccccc +fI[1] = #3fff0000 8ccccccc cccccccd +fI[1] == strtoxL + + +Input: -1.1 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 8ccccccc cccccccc +g_xLfmt(0) gives 22 bytes: "-1.0999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 8ccccccc cccccccd +fI[1] = #bfff0000 8ccccccc cccccccc +fI[1] == strtoxL + + +Input: 1.2 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 99999999 9999999a +g_xLfmt(0) gives 3 bytes: "1.2" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 99999999 99999999 +fI[1] = #3fff0000 99999999 9999999a +fI[1] == strtoxL + + +Input: -1.2 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 99999999 99999999 +g_xLfmt(0) gives 22 bytes: "-1.1999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 99999999 9999999a +fI[1] = #bfff0000 99999999 99999999 +fI[1] == strtoxL + + +Input: 1.3 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 a6666666 66666667 +g_xLfmt(0) gives 21 bytes: "1.3000000000000000001" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 a6666666 66666666 +fI[1] = #3fff0000 a6666666 66666667 +fI[1] == strtoxL + + +Input: -1.3 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 a6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.3" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 a6666666 66666667 +fI[1] = #bfff0000 a6666666 66666666 +fI[1] == strtoxL + + +Input: 1.4 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 b3333333 33333334 +g_xLfmt(0) gives 21 bytes: "1.4000000000000000001" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 b3333333 33333333 +fI[1] = #3fff0000 b3333333 33333334 +fI[1] == strtoxL + + +Input: -1.4 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 b3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.4" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 b3333333 33333334 +fI[1] = #bfff0000 b3333333 33333333 +fI[1] == strtoxL + + +Input: 1.5 + +strtoxL consumes 3 bytes and returns 1 +with bits = #3fff0000 c0000000 0 +g_xLfmt(0) gives 3 bytes: "1.5" + +strtoIxL returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtoxL + + +Input: -1.5 + +strtoxL consumes 4 bytes and returns 9 +with bits = #bfff0000 c0000000 0 +g_xLfmt(0) gives 4 bytes: "-1.5" + +strtoIxL returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.6 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 cccccccc cccccccd +g_xLfmt(0) gives 3 bytes: "1.6" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 cccccccc cccccccc +fI[1] = #3fff0000 cccccccc cccccccd +fI[1] == strtoxL + + +Input: -1.6 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 cccccccc cccccccc +g_xLfmt(0) gives 22 bytes: "-1.5999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 cccccccc cccccccd +fI[1] = #bfff0000 cccccccc cccccccc +fI[1] == strtoxL + + +Input: 1.7 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 d9999999 9999999a +g_xLfmt(0) gives 3 bytes: "1.7" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 d9999999 99999999 +fI[1] = #3fff0000 d9999999 9999999a +fI[1] == strtoxL + + +Input: -1.7 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 d9999999 99999999 +g_xLfmt(0) gives 22 bytes: "-1.6999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 d9999999 9999999a +fI[1] = #bfff0000 d9999999 99999999 +fI[1] == strtoxL + + +Input: 1.8 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 e6666666 66666667 +g_xLfmt(0) gives 21 bytes: "1.8000000000000000001" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 e6666666 66666666 +fI[1] = #3fff0000 e6666666 66666667 +fI[1] == strtoxL + + +Input: -1.8 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 e6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.8" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 e6666666 66666667 +fI[1] = #bfff0000 e6666666 66666666 +fI[1] == strtoxL + + +Input: 1.9 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 f3333333 33333334 +g_xLfmt(0) gives 21 bytes: "1.9000000000000000001" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 f3333333 33333333 +fI[1] = #3fff0000 f3333333 33333334 +fI[1] == strtoxL + + +Input: -1.9 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 f3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.9" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 f3333333 33333334 +fI[1] = #bfff0000 f3333333 33333333 +fI[1] == strtoxL + +Rounding mode for strtor... changed from 2 (toward +Infinity) to 3 (toward -Infinity) + +Input: 1.1 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 8ccccccc cccccccc +g_xLfmt(0) gives 21 bytes: "1.0999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 8ccccccc cccccccc +fI[1] = #3fff0000 8ccccccc cccccccd +fI[0] == strtoxL + + +Input: -1.1 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 8ccccccc cccccccd +g_xLfmt(0) gives 4 bytes: "-1.1" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 8ccccccc cccccccd +fI[1] = #bfff0000 8ccccccc cccccccc +fI[0] == strtoxL + + +Input: 1.2 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 99999999 99999999 +g_xLfmt(0) gives 21 bytes: "1.1999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 99999999 99999999 +fI[1] = #3fff0000 99999999 9999999a +fI[0] == strtoxL + + +Input: -1.2 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 99999999 9999999a +g_xLfmt(0) gives 4 bytes: "-1.2" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 99999999 9999999a +fI[1] = #bfff0000 99999999 99999999 +fI[0] == strtoxL + + +Input: 1.3 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 a6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.3" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 a6666666 66666666 +fI[1] = #3fff0000 a6666666 66666667 +fI[0] == strtoxL + + +Input: -1.3 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 a6666666 66666667 +g_xLfmt(0) gives 22 bytes: "-1.3000000000000000001" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 a6666666 66666667 +fI[1] = #bfff0000 a6666666 66666666 +fI[0] == strtoxL + + +Input: 1.4 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 b3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.4" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 b3333333 33333333 +fI[1] = #3fff0000 b3333333 33333334 +fI[0] == strtoxL + + +Input: -1.4 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 b3333333 33333334 +g_xLfmt(0) gives 22 bytes: "-1.4000000000000000001" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 b3333333 33333334 +fI[1] = #bfff0000 b3333333 33333333 +fI[0] == strtoxL + + +Input: 1.5 + +strtoxL consumes 3 bytes and returns 1 +with bits = #3fff0000 c0000000 0 +g_xLfmt(0) gives 3 bytes: "1.5" + +strtoIxL returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtoxL + + +Input: -1.5 + +strtoxL consumes 4 bytes and returns 9 +with bits = #bfff0000 c0000000 0 +g_xLfmt(0) gives 4 bytes: "-1.5" + +strtoIxL returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.6 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 cccccccc cccccccc +g_xLfmt(0) gives 21 bytes: "1.5999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 cccccccc cccccccc +fI[1] = #3fff0000 cccccccc cccccccd +fI[0] == strtoxL + + +Input: -1.6 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 cccccccc cccccccd +g_xLfmt(0) gives 4 bytes: "-1.6" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 cccccccc cccccccd +fI[1] = #bfff0000 cccccccc cccccccc +fI[0] == strtoxL + + +Input: 1.7 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 d9999999 99999999 +g_xLfmt(0) gives 21 bytes: "1.6999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 d9999999 99999999 +fI[1] = #3fff0000 d9999999 9999999a +fI[0] == strtoxL + + +Input: -1.7 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 d9999999 9999999a +g_xLfmt(0) gives 4 bytes: "-1.7" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 d9999999 9999999a +fI[1] = #bfff0000 d9999999 99999999 +fI[0] == strtoxL + + +Input: 1.8 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 e6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.8" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 e6666666 66666666 +fI[1] = #3fff0000 e6666666 66666667 +fI[0] == strtoxL + + +Input: -1.8 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 e6666666 66666667 +g_xLfmt(0) gives 22 bytes: "-1.8000000000000000001" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 e6666666 66666667 +fI[1] = #bfff0000 e6666666 66666666 +fI[0] == strtoxL + + +Input: 1.9 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 f3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.9" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 f3333333 33333333 +fI[1] = #3fff0000 f3333333 33333334 +fI[0] == strtoxL + + +Input: -1.9 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 f3333333 33333334 +g_xLfmt(0) gives 22 bytes: "-1.9000000000000000001" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 f3333333 33333334 +fI[1] = #bfff0000 f3333333 33333333 +fI[0] == strtoxL + diff --git a/contrib/gdtoa/test/xL.ou1 b/contrib/gdtoa/test/xL.ou1 new file mode 100644 index 0000000..054690e --- /dev/null +++ b/contrib/gdtoa/test/xL.ou1 @@ -0,0 +1,1183 @@ +***** This file is not right. It needs to be generated on a +***** system with a Motorla 68881 or the equivalent. +Input: 1.23 + +strtoxL consumes 4 bytes and returns 33 +with bits = #3fff0000 9d70a3d7 a3d70a4 +g_xLfmt(0) gives 4 bytes: "1.23" + +strtoIxL returns 33, consuming 4 bytes. +fI[0] = #3fff0000 9d70a3d7 a3d70a3 +fI[1] = #3fff0000 9d70a3d7 a3d70a4 +fI[1] == strtoxL + + +Input: 1.23e+20 + +strtoxL consumes 8 bytes and returns 1 +with bits = #40410000 d55ef90a 2da18000 +g_xLfmt(0) gives 8 bytes: "1.23e+20" + +strtoIxL returns 1, consuming 8 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.23e-20 + +strtoxL consumes 8 bytes and returns 17 +with bits = #3fbc0000 e857267b b3a984f2 +g_xLfmt(0) gives 8 bytes: "1.23e-20" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #3fbc0000 e857267b b3a984f2 +fI[1] = #3fbc0000 e857267b b3a984f3 +fI[0] == strtoxL + + +Input: 1.23456789 + +strtoxL consumes 10 bytes and returns 33 +with bits = #3fff0000 9e065214 1ef0dbf6 +g_xLfmt(0) gives 10 bytes: "1.23456789" + +strtoIxL returns 33, consuming 10 bytes. +fI[0] = #3fff0000 9e065214 1ef0dbf5 +fI[1] = #3fff0000 9e065214 1ef0dbf6 +fI[1] == strtoxL + + +Input: 1.23456589e+20 + +strtoxL consumes 14 bytes and returns 1 +with bits = #40410000 d629bd33 5ccba00 +g_xLfmt(0) gives 14 bytes: "1.23456589e+20" + +strtoIxL returns 1, consuming 14 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.23e+30 + +strtoxL consumes 8 bytes and returns 17 +with bits = #40620000 f8658274 7dbc824a +g_xLfmt(0) gives 8 bytes: "1.23e+30" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #40620000 f8658274 7dbc824a +fI[1] = #40620000 f8658274 7dbc824b +fI[0] == strtoxL + + +Input: 1.23e-30 + +strtoxL consumes 8 bytes and returns 17 +with bits = #3f9b0000 c794337a 808554eb +g_xLfmt(0) gives 8 bytes: "1.23e-30" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #3f9b0000 c794337a 808554eb +fI[1] = #3f9b0000 c794337a 808554ec +fI[0] == strtoxL + + +Input: 1.23456789e-20 + +strtoxL consumes 14 bytes and returns 17 +with bits = #3fbc0000 e9340a38 f3d6d352 +g_xLfmt(0) gives 14 bytes: "1.23456789e-20" + +strtoIxL returns 17, consuming 14 bytes. +fI[0] = #3fbc0000 e9340a38 f3d6d352 +fI[1] = #3fbc0000 e9340a38 f3d6d353 +fI[0] == strtoxL + + +Input: 1.23456789e-30 + +strtoxL consumes 14 bytes and returns 17 +with bits = #3f9b0000 c851f19d decca8fc +g_xLfmt(0) gives 14 bytes: "1.23456789e-30" + +strtoIxL returns 17, consuming 14 bytes. +fI[0] = #3f9b0000 c851f19d decca8fc +fI[1] = #3f9b0000 c851f19d decca8fd +fI[0] == strtoxL + + +Input: 1.234567890123456789 + +strtoxL consumes 20 bytes and returns 17 +with bits = #3fff0000 9e065214 62cfdb8d +g_xLfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIxL returns 17, consuming 20 bytes. +fI[0] = #3fff0000 9e065214 62cfdb8d +fI[1] = #3fff0000 9e065214 62cfdb8e +fI[0] == strtoxL + + +Input: 1.23456789012345678901234567890123456789 + +strtoxL consumes 40 bytes and returns 17 +with bits = #3fff0000 9e065214 62cfdb8d +g_xLfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIxL returns 17, consuming 40 bytes. +fI[0] = #3fff0000 9e065214 62cfdb8d +fI[1] = #3fff0000 9e065214 62cfdb8e +fI[0] == strtoxL + + +Input: 1.23e306 + +strtoxL consumes 8 bytes and returns 17 +with bits = #43f70000 e033b668 e30fa6d5 +g_xLfmt(0) gives 9 bytes: "1.23e+306" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #43f70000 e033b668 e30fa6d5 +fI[1] = #43f70000 e033b668 e30fa6d6 +fI[0] == strtoxL + + +Input: 1.23e-306 + +strtoxL consumes 9 bytes and returns 33 +with bits = #3c060000 dd1dc2ed 1cb73f25 +g_xLfmt(0) gives 9 bytes: "1.23e-306" + +strtoIxL returns 33, consuming 9 bytes. +fI[0] = #3c060000 dd1dc2ed 1cb73f24 +fI[1] = #3c060000 dd1dc2ed 1cb73f25 +fI[1] == strtoxL + + +Input: 1.23e-320 + +strtoxL consumes 9 bytes and returns 33 +with bits = #3bd80000 9b98c371 844c3f1a +g_xLfmt(0) gives 9 bytes: "1.23e-320" + +strtoIxL returns 33, consuming 9 bytes. +fI[0] = #3bd80000 9b98c371 844c3f19 +fI[1] = #3bd80000 9b98c371 844c3f1a +fI[1] == strtoxL + + +Input: 1.23e-20 + +strtoxL consumes 8 bytes and returns 17 +with bits = #3fbc0000 e857267b b3a984f2 +g_xLfmt(0) gives 8 bytes: "1.23e-20" + +strtoIxL returns 17, consuming 8 bytes. +fI[0] = #3fbc0000 e857267b b3a984f2 +fI[1] = #3fbc0000 e857267b b3a984f3 +fI[0] == strtoxL + + +Input: 1.23456789e307 + +strtoxL consumes 14 bytes and returns 17 +with bits = #43fb0000 8ca58a5e d766de75 +g_xLfmt(0) gives 15 bytes: "1.23456789e+307" + +strtoIxL returns 17, consuming 14 bytes. +fI[0] = #43fb0000 8ca58a5e d766de75 +fI[1] = #43fb0000 8ca58a5e d766de76 +fI[0] == strtoxL + + +Input: 1.23456589e-307 + +strtoxL consumes 15 bytes and returns 17 +with bits = #3c030000 b18cb5dc c22fd369 +g_xLfmt(0) gives 15 bytes: "1.23456589e-307" + +strtoIxL returns 17, consuming 15 bytes. +fI[0] = #3c030000 b18cb5dc c22fd369 +fI[1] = #3c030000 b18cb5dc c22fd36a +fI[0] == strtoxL + + +Input: 1.234567890123456789 + +strtoxL consumes 20 bytes and returns 17 +with bits = #3fff0000 9e065214 62cfdb8d +g_xLfmt(0) gives 20 bytes: "1.234567890123456789" + +strtoIxL returns 17, consuming 20 bytes. +fI[0] = #3fff0000 9e065214 62cfdb8d +fI[1] = #3fff0000 9e065214 62cfdb8e +fI[0] == strtoxL + + +Input: 1.234567890123456789e301 + +strtoxL consumes 24 bytes and returns 33 +with bits = #43e70000 937a8baf ab20980c +g_xLfmt(0) gives 25 bytes: "1.234567890123456789e+301" + +strtoIxL returns 33, consuming 24 bytes. +fI[0] = #43e70000 937a8baf ab20980b +fI[1] = #43e70000 937a8baf ab20980c +fI[1] == strtoxL + + +Input: 1.234567890123456789e-301 + +strtoxL consumes 25 bytes and returns 33 +with bits = #3c170000 a953271a 5d069ad9 +g_xLfmt(0) gives 25 bytes: "1.234567890123456789e-301" + +strtoIxL returns 33, consuming 25 bytes. +fI[0] = #3c170000 a953271a 5d069ad8 +fI[1] = #3c170000 a953271a 5d069ad9 +fI[1] == strtoxL + + +Input: 1.234567890123456789e-321 + +strtoxL consumes 25 bytes and returns 33 +with bits = #3bd40000 f9e11b4c ea6dcce9 +g_xLfmt(0) gives 25 bytes: "1.234567890123456789e-321" + +strtoIxL returns 33, consuming 25 bytes. +fI[0] = #3bd40000 f9e11b4c ea6dcce8 +fI[1] = #3bd40000 f9e11b4c ea6dcce9 +fI[1] == strtoxL + + +Input: 1e23 + +strtoxL consumes 4 bytes and returns 1 +with bits = #404b0000 a968163f a57b400 +g_xLfmt(0) gives 5 bytes: "1e+23" + +strtoIxL returns 1, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1e310 + +strtoxL consumes 5 bytes and returns 33 +with bits = #44040000 de81e40a 34bcf50 +g_xLfmt(0) gives 6 bytes: "1e+310" + +strtoIxL returns 33, consuming 5 bytes. +fI[0] = #44040000 de81e40a 34bcf4f +fI[1] = #44040000 de81e40a 34bcf50 +fI[1] == strtoxL + + +Input: 9.0259718793241475e-277 + +strtoxL consumes 23 bytes and returns 33 +with bits = #3c690000 ffffffff fffffcf7 +g_xLfmt(0) gives 23 bytes: "9.0259718793241475e-277" + +strtoIxL returns 33, consuming 23 bytes. +fI[0] = #3c690000 ffffffff fffffcf6 +fI[1] = #3c690000 ffffffff fffffcf7 +fI[1] == strtoxL + + +Input: 9.025971879324147880346310405869e-277 + +strtoxL consumes 37 bytes and returns 17 +with bits = #3c6a0000 80000000 0 +g_xLfmt(0) gives 26 bytes: "9.0259718793241478803e-277" + +strtoIxL returns 17, consuming 37 bytes. +fI[0] = #3c6a0000 80000000 0 +fI[1] = #3c6a0000 80000000 1 +fI[0] == strtoxL + + +Input: 9.025971879324147880346310405868e-277 + +strtoxL consumes 37 bytes and returns 33 +with bits = #3c6a0000 80000000 0 +g_xLfmt(0) gives 26 bytes: "9.0259718793241478803e-277" + +strtoIxL returns 33, consuming 37 bytes. +fI[0] = #3c690000 ffffffff ffffffff +fI[1] = #3c6a0000 80000000 0 +fI[1] == strtoxL + + +Input: 2.2250738585072014e-308 + +strtoxL consumes 23 bytes and returns 17 +with bits = #3c010000 80000000 46 +g_xLfmt(0) gives 23 bytes: "2.2250738585072014e-308" + +strtoIxL returns 17, consuming 23 bytes. +fI[0] = #3c010000 80000000 46 +fI[1] = #3c010000 80000000 47 +fI[0] == strtoxL + + +Input: 2.2250738585072013e-308 + +strtoxL consumes 23 bytes and returns 17 +with bits = #3c000000 ffffffff fffffd4f +g_xLfmt(0) gives 23 bytes: "2.2250738585072013e-308" + +strtoIxL returns 17, consuming 23 bytes. +fI[0] = #3c000000 ffffffff fffffd4f +fI[1] = #3c000000 ffffffff fffffd50 +fI[0] == strtoxL + +Rounding mode for strtor... changed from 1 (nearest) to 0 (toward zero) + +Input: 1.1 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 8ccccccc cccccccc +g_xLfmt(0) gives 21 bytes: "1.0999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 8ccccccc cccccccc +fI[1] = #3fff0000 8ccccccc cccccccd +fI[0] == strtoxL + + +Input: -1.1 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 8ccccccc cccccccc +g_xLfmt(0) gives 22 bytes: "-1.0999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 8ccccccc cccccccd +fI[1] = #bfff0000 8ccccccc cccccccc +fI[1] == strtoxL + + +Input: 1.2 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 99999999 99999999 +g_xLfmt(0) gives 21 bytes: "1.1999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 99999999 99999999 +fI[1] = #3fff0000 99999999 9999999a +fI[0] == strtoxL + + +Input: -1.2 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 99999999 99999999 +g_xLfmt(0) gives 22 bytes: "-1.1999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 99999999 9999999a +fI[1] = #bfff0000 99999999 99999999 +fI[1] == strtoxL + + +Input: 1.3 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 a6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.3" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 a6666666 66666666 +fI[1] = #3fff0000 a6666666 66666667 +fI[0] == strtoxL + + +Input: -1.3 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 a6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.3" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 a6666666 66666667 +fI[1] = #bfff0000 a6666666 66666666 +fI[1] == strtoxL + + +Input: 1.4 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 b3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.4" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 b3333333 33333333 +fI[1] = #3fff0000 b3333333 33333334 +fI[0] == strtoxL + + +Input: -1.4 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 b3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.4" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 b3333333 33333334 +fI[1] = #bfff0000 b3333333 33333333 +fI[1] == strtoxL + + +Input: 1.5 + +strtoxL consumes 3 bytes and returns 1 +with bits = #3fff0000 c0000000 0 +g_xLfmt(0) gives 3 bytes: "1.5" + +strtoIxL returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtoxL + + +Input: -1.5 + +strtoxL consumes 4 bytes and returns 9 +with bits = #bfff0000 c0000000 0 +g_xLfmt(0) gives 4 bytes: "-1.5" + +strtoIxL returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.6 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 cccccccc cccccccc +g_xLfmt(0) gives 21 bytes: "1.5999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 cccccccc cccccccc +fI[1] = #3fff0000 cccccccc cccccccd +fI[0] == strtoxL + + +Input: -1.6 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 cccccccc cccccccc +g_xLfmt(0) gives 22 bytes: "-1.5999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 cccccccc cccccccd +fI[1] = #bfff0000 cccccccc cccccccc +fI[1] == strtoxL + + +Input: 1.7 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 d9999999 99999999 +g_xLfmt(0) gives 21 bytes: "1.6999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 d9999999 99999999 +fI[1] = #3fff0000 d9999999 9999999a +fI[0] == strtoxL + + +Input: -1.7 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 d9999999 99999999 +g_xLfmt(0) gives 22 bytes: "-1.6999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 d9999999 9999999a +fI[1] = #bfff0000 d9999999 99999999 +fI[1] == strtoxL + + +Input: 1.8 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 e6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.8" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 e6666666 66666666 +fI[1] = #3fff0000 e6666666 66666667 +fI[0] == strtoxL + + +Input: -1.8 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 e6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.8" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 e6666666 66666667 +fI[1] = #bfff0000 e6666666 66666666 +fI[1] == strtoxL + + +Input: 1.9 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 f3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.9" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 f3333333 33333333 +fI[1] = #3fff0000 f3333333 33333334 +fI[0] == strtoxL + + +Input: -1.9 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 f3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.9" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 f3333333 33333334 +fI[1] = #bfff0000 f3333333 33333333 +fI[1] == strtoxL + +Rounding mode for strtor... changed from 0 (toward zero) to 1 (nearest) + +Input: 1.1 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 8ccccccc cccccccd +g_xLfmt(0) gives 3 bytes: "1.1" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 8ccccccc cccccccc +fI[1] = #3fff0000 8ccccccc cccccccd +fI[1] == strtoxL + + +Input: -1.1 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 8ccccccc cccccccd +g_xLfmt(0) gives 4 bytes: "-1.1" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 8ccccccc cccccccd +fI[1] = #bfff0000 8ccccccc cccccccc +fI[0] == strtoxL + + +Input: 1.2 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 99999999 9999999a +g_xLfmt(0) gives 3 bytes: "1.2" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 99999999 99999999 +fI[1] = #3fff0000 99999999 9999999a +fI[1] == strtoxL + + +Input: -1.2 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 99999999 9999999a +g_xLfmt(0) gives 4 bytes: "-1.2" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 99999999 9999999a +fI[1] = #bfff0000 99999999 99999999 +fI[0] == strtoxL + + +Input: 1.3 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 a6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.3" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 a6666666 66666666 +fI[1] = #3fff0000 a6666666 66666667 +fI[0] == strtoxL + + +Input: -1.3 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 a6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.3" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 a6666666 66666667 +fI[1] = #bfff0000 a6666666 66666666 +fI[1] == strtoxL + + +Input: 1.4 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 b3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.4" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 b3333333 33333333 +fI[1] = #3fff0000 b3333333 33333334 +fI[0] == strtoxL + + +Input: -1.4 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 b3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.4" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 b3333333 33333334 +fI[1] = #bfff0000 b3333333 33333333 +fI[1] == strtoxL + + +Input: 1.5 + +strtoxL consumes 3 bytes and returns 1 +with bits = #3fff0000 c0000000 0 +g_xLfmt(0) gives 3 bytes: "1.5" + +strtoIxL returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtoxL + + +Input: -1.5 + +strtoxL consumes 4 bytes and returns 9 +with bits = #bfff0000 c0000000 0 +g_xLfmt(0) gives 4 bytes: "-1.5" + +strtoIxL returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.6 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 cccccccc cccccccd +g_xLfmt(0) gives 3 bytes: "1.6" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 cccccccc cccccccc +fI[1] = #3fff0000 cccccccc cccccccd +fI[1] == strtoxL + + +Input: -1.6 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 cccccccc cccccccd +g_xLfmt(0) gives 4 bytes: "-1.6" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 cccccccc cccccccd +fI[1] = #bfff0000 cccccccc cccccccc +fI[0] == strtoxL + + +Input: 1.7 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 d9999999 9999999a +g_xLfmt(0) gives 3 bytes: "1.7" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 d9999999 99999999 +fI[1] = #3fff0000 d9999999 9999999a +fI[1] == strtoxL + + +Input: -1.7 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 d9999999 9999999a +g_xLfmt(0) gives 4 bytes: "-1.7" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 d9999999 9999999a +fI[1] = #bfff0000 d9999999 99999999 +fI[0] == strtoxL + + +Input: 1.8 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 e6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.8" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 e6666666 66666666 +fI[1] = #3fff0000 e6666666 66666667 +fI[0] == strtoxL + + +Input: -1.8 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 e6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.8" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 e6666666 66666667 +fI[1] = #bfff0000 e6666666 66666666 +fI[1] == strtoxL + + +Input: 1.9 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 f3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.9" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 f3333333 33333333 +fI[1] = #3fff0000 f3333333 33333334 +fI[0] == strtoxL + + +Input: -1.9 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 f3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.9" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 f3333333 33333334 +fI[1] = #bfff0000 f3333333 33333333 +fI[1] == strtoxL + +Rounding mode for strtor... changed from 1 (nearest) to 2 (toward +Infinity) + +Input: 1.1 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 8ccccccc cccccccd +g_xLfmt(0) gives 3 bytes: "1.1" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 8ccccccc cccccccc +fI[1] = #3fff0000 8ccccccc cccccccd +fI[1] == strtoxL + + +Input: -1.1 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 8ccccccc cccccccc +g_xLfmt(0) gives 22 bytes: "-1.0999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 8ccccccc cccccccd +fI[1] = #bfff0000 8ccccccc cccccccc +fI[1] == strtoxL + + +Input: 1.2 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 99999999 9999999a +g_xLfmt(0) gives 3 bytes: "1.2" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 99999999 99999999 +fI[1] = #3fff0000 99999999 9999999a +fI[1] == strtoxL + + +Input: -1.2 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 99999999 99999999 +g_xLfmt(0) gives 22 bytes: "-1.1999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 99999999 9999999a +fI[1] = #bfff0000 99999999 99999999 +fI[1] == strtoxL + + +Input: 1.3 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 a6666666 66666667 +g_xLfmt(0) gives 21 bytes: "1.3000000000000000001" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 a6666666 66666666 +fI[1] = #3fff0000 a6666666 66666667 +fI[1] == strtoxL + + +Input: -1.3 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 a6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.3" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 a6666666 66666667 +fI[1] = #bfff0000 a6666666 66666666 +fI[1] == strtoxL + + +Input: 1.4 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 b3333333 33333334 +g_xLfmt(0) gives 21 bytes: "1.4000000000000000001" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 b3333333 33333333 +fI[1] = #3fff0000 b3333333 33333334 +fI[1] == strtoxL + + +Input: -1.4 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 b3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.4" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 b3333333 33333334 +fI[1] = #bfff0000 b3333333 33333333 +fI[1] == strtoxL + + +Input: 1.5 + +strtoxL consumes 3 bytes and returns 1 +with bits = #3fff0000 c0000000 0 +g_xLfmt(0) gives 3 bytes: "1.5" + +strtoIxL returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtoxL + + +Input: -1.5 + +strtoxL consumes 4 bytes and returns 9 +with bits = #bfff0000 c0000000 0 +g_xLfmt(0) gives 4 bytes: "-1.5" + +strtoIxL returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.6 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 cccccccc cccccccd +g_xLfmt(0) gives 3 bytes: "1.6" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 cccccccc cccccccc +fI[1] = #3fff0000 cccccccc cccccccd +fI[1] == strtoxL + + +Input: -1.6 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 cccccccc cccccccc +g_xLfmt(0) gives 22 bytes: "-1.5999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 cccccccc cccccccd +fI[1] = #bfff0000 cccccccc cccccccc +fI[1] == strtoxL + + +Input: 1.7 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 d9999999 9999999a +g_xLfmt(0) gives 3 bytes: "1.7" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 d9999999 99999999 +fI[1] = #3fff0000 d9999999 9999999a +fI[1] == strtoxL + + +Input: -1.7 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 d9999999 99999999 +g_xLfmt(0) gives 22 bytes: "-1.6999999999999999999" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 d9999999 9999999a +fI[1] = #bfff0000 d9999999 99999999 +fI[1] == strtoxL + + +Input: 1.8 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 e6666666 66666667 +g_xLfmt(0) gives 21 bytes: "1.8000000000000000001" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 e6666666 66666666 +fI[1] = #3fff0000 e6666666 66666667 +fI[1] == strtoxL + + +Input: -1.8 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 e6666666 66666666 +g_xLfmt(0) gives 4 bytes: "-1.8" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 e6666666 66666667 +fI[1] = #bfff0000 e6666666 66666666 +fI[1] == strtoxL + + +Input: 1.9 + +strtoxL consumes 3 bytes and returns 33 +with bits = #3fff0000 f3333333 33333334 +g_xLfmt(0) gives 21 bytes: "1.9000000000000000001" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 f3333333 33333333 +fI[1] = #3fff0000 f3333333 33333334 +fI[1] == strtoxL + + +Input: -1.9 + +strtoxL consumes 4 bytes and returns 25 +with bits = #bfff0000 f3333333 33333333 +g_xLfmt(0) gives 4 bytes: "-1.9" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 f3333333 33333334 +fI[1] = #bfff0000 f3333333 33333333 +fI[1] == strtoxL + +Rounding mode for strtor... changed from 2 (toward +Infinity) to 3 (toward -Infinity) + +Input: 1.1 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 8ccccccc cccccccc +g_xLfmt(0) gives 21 bytes: "1.0999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 8ccccccc cccccccc +fI[1] = #3fff0000 8ccccccc cccccccd +fI[0] == strtoxL + + +Input: -1.1 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 8ccccccc cccccccd +g_xLfmt(0) gives 4 bytes: "-1.1" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 8ccccccc cccccccd +fI[1] = #bfff0000 8ccccccc cccccccc +fI[0] == strtoxL + + +Input: 1.2 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 99999999 99999999 +g_xLfmt(0) gives 21 bytes: "1.1999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 99999999 99999999 +fI[1] = #3fff0000 99999999 9999999a +fI[0] == strtoxL + + +Input: -1.2 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 99999999 9999999a +g_xLfmt(0) gives 4 bytes: "-1.2" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 99999999 9999999a +fI[1] = #bfff0000 99999999 99999999 +fI[0] == strtoxL + + +Input: 1.3 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 a6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.3" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 a6666666 66666666 +fI[1] = #3fff0000 a6666666 66666667 +fI[0] == strtoxL + + +Input: -1.3 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 a6666666 66666667 +g_xLfmt(0) gives 22 bytes: "-1.3000000000000000001" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 a6666666 66666667 +fI[1] = #bfff0000 a6666666 66666666 +fI[0] == strtoxL + + +Input: 1.4 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 b3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.4" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 b3333333 33333333 +fI[1] = #3fff0000 b3333333 33333334 +fI[0] == strtoxL + + +Input: -1.4 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 b3333333 33333334 +g_xLfmt(0) gives 22 bytes: "-1.4000000000000000001" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 b3333333 33333334 +fI[1] = #bfff0000 b3333333 33333333 +fI[0] == strtoxL + + +Input: 1.5 + +strtoxL consumes 3 bytes and returns 1 +with bits = #3fff0000 c0000000 0 +g_xLfmt(0) gives 3 bytes: "1.5" + +strtoIxL returns 1, consuming 3 bytes. +fI[0] == fI[1] == strtoxL + + +Input: -1.5 + +strtoxL consumes 4 bytes and returns 9 +with bits = #bfff0000 c0000000 0 +g_xLfmt(0) gives 4 bytes: "-1.5" + +strtoIxL returns 9, consuming 4 bytes. +fI[0] == fI[1] == strtoxL + + +Input: 1.6 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 cccccccc cccccccc +g_xLfmt(0) gives 21 bytes: "1.5999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 cccccccc cccccccc +fI[1] = #3fff0000 cccccccc cccccccd +fI[0] == strtoxL + + +Input: -1.6 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 cccccccc cccccccd +g_xLfmt(0) gives 4 bytes: "-1.6" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 cccccccc cccccccd +fI[1] = #bfff0000 cccccccc cccccccc +fI[0] == strtoxL + + +Input: 1.7 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 d9999999 99999999 +g_xLfmt(0) gives 21 bytes: "1.6999999999999999999" + +strtoIxL returns 33, consuming 3 bytes. +fI[0] = #3fff0000 d9999999 99999999 +fI[1] = #3fff0000 d9999999 9999999a +fI[0] == strtoxL + + +Input: -1.7 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 d9999999 9999999a +g_xLfmt(0) gives 4 bytes: "-1.7" + +strtoIxL returns 41, consuming 4 bytes. +fI[0] = #bfff0000 d9999999 9999999a +fI[1] = #bfff0000 d9999999 99999999 +fI[0] == strtoxL + + +Input: 1.8 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 e6666666 66666666 +g_xLfmt(0) gives 3 bytes: "1.8" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 e6666666 66666666 +fI[1] = #3fff0000 e6666666 66666667 +fI[0] == strtoxL + + +Input: -1.8 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 e6666666 66666667 +g_xLfmt(0) gives 22 bytes: "-1.8000000000000000001" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 e6666666 66666667 +fI[1] = #bfff0000 e6666666 66666666 +fI[0] == strtoxL + + +Input: 1.9 + +strtoxL consumes 3 bytes and returns 17 +with bits = #3fff0000 f3333333 33333333 +g_xLfmt(0) gives 3 bytes: "1.9" + +strtoIxL returns 17, consuming 3 bytes. +fI[0] = #3fff0000 f3333333 33333333 +fI[1] = #3fff0000 f3333333 33333334 +fI[0] == strtoxL + + +Input: -1.9 + +strtoxL consumes 4 bytes and returns 41 +with bits = #bfff0000 f3333333 33333334 +g_xLfmt(0) gives 22 bytes: "-1.9000000000000000001" + +strtoIxL returns 25, consuming 4 bytes. +fI[0] = #bfff0000 f3333333 33333334 +fI[1] = #bfff0000 f3333333 33333333 +fI[0] == strtoxL + diff --git a/contrib/gdtoa/test/xLtest.c b/contrib/gdtoa/test/xLtest.c new file mode 100644 index 0000000..c923e19 --- /dev/null +++ b/contrib/gdtoa/test/xLtest.c @@ -0,0 +1,169 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +/* Test program for g_xLfmt, strtoIxL, strtopxL, and strtorxL. + * + * Inputs (on stdin): + * r rounding_mode + * n ndig + * number + * #hex0 hex1 hex2 + * + * rounding_mode values: + * 0 = toward zero + * 1 = nearest + * 2 = toward +Infinity + * 3 = toward -Infinity + * + * where number is a decimal floating-point number, + * hex0 is a string of <= 8 Hex digits for the most significant + * word of the number, hex1 is a similar string for the next + * word, etc., and ndig is a parameters to g_xLfmt. + */ + +#include "gdtoa.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + extern int getround ANSI((int,char*)); + + static char ibuf[2048], obuf[2048]; + +#define U (unsigned long) + +#undef _0 +#undef _1 + +/* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */ + +#ifdef IEEE_MC68k +#define _0 0 +#define _1 1 +#define _2 2 +#endif +#ifdef IEEE_8087 +#define _0 2 +#define _1 1 +#define _2 0 +#endif + + int +main(Void) +{ + char *s, *se, *se1; + int dItry, i, ndig = 0, r = 1; + union { long double d; ULong bits[3]; } u, v[2]; + + while(s = fgets(ibuf, sizeof(ibuf), stdin)) { + while(*s <= ' ') + if (!*s++) + continue; + dItry = 0; + switch(*s) { + case 'r': + r = getround(r, s); + continue; + case 'n': + i = s[1]; + if (i <= ' ' || i >= '0' && i <= '9') { + ndig = atoi(s+1); + continue; + } + break; /* nan? */ + case '#': + sscanf(s+1, "%lx %lx %lx", &u.bits[_0], + &u.bits[_1], &u.bits[_2]); + printf("\nInput: %s", ibuf); + printf(" --> f = #%lx %lx %lx\n", u.bits[_0], + u.bits[_1], u.bits[_2]); + goto fmt_test; + } + dItry = 1; + printf("\nInput: %s", ibuf); + i = strtorxL(ibuf, &se, r, u.bits); + if (r == 1 && (i != strtopxL(ibuf, &se1, v[0].bits) || se1 != se + || memcmp(u.bits, v[0].bits, 12))) + printf("***strtoxL and strtorxL disagree!!\n:"); + printf("\nstrtoxL consumes %d bytes and returns %d\n", + (int)(se-ibuf), i); + printf("with bits = #%lx %lx %lx\n", + U u.bits[_0], U u.bits[_1], U u.bits[_2]); + if (sizeof(long double) == 12) + printf("printf(\"%%.21Lg\") gives %.21Lg\n", u.d); + fmt_test: + se = g_xLfmt(obuf, u.bits, ndig, sizeof(obuf)); + printf("g_xLfmt(%d) gives %d bytes: \"%s\"\n\n", + ndig, (int)(se-obuf), se ? obuf : "<null>"); + if (!dItry) + continue; + printf("strtoIxL returns %d,", + strtoIxL(ibuf, &se, v[0].bits, v[1].bits)); + printf(" consuming %d bytes.\n", (int)(se-ibuf)); + if (!memcmp(v[0].bits, v[1].bits, 12)) { + if (!memcmp(u.bits, v[0].bits, 12)) + printf("fI[0] == fI[1] == strtoxL\n"); + else { + printf("fI[0] == fI[1] = #%lx %lx %lx\n", + U v[0].bits[_0], U v[0].bits[_1], + U v[0].bits[_2]); + if (sizeof(long double) == 12) + printf("= %.21Lg\n", v[0].d); + } + } + else { + printf("fI[0] = #%lx %lx %lx\n", + U v[0].bits[_0], U v[0].bits[_1], + U v[0].bits[_2]); + if (sizeof(long double) == 12) + printf("= %.21Lg\n", v[0].d); + printf("fI[1] = #%lx %lx %lx\n", + U v[1].bits[_0], U v[1].bits[_1], + U v[1].bits[_2]); + if (sizeof(long double) == 12) + printf("= %.21Lg\n", v[1].d); + if (!memcmp(v[0].bits, u.bits, 12)) + printf("fI[0] == strtoxL\n"); + else if (!memcmp(v[1].bits, u.bits, 12)) + printf("fI[1] == strtoxL\n"); + else + printf("**** Both differ from strtod ****\n"); + } + printf("\n"); + } + return 0; + } diff --git a/contrib/gdtoa/test/xQtest.c b/contrib/gdtoa/test/xQtest.c new file mode 100644 index 0000000..8dfe365 --- /dev/null +++ b/contrib/gdtoa/test/xQtest.c @@ -0,0 +1,46 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 2002 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +#include <stdio.h> + + int +main(void) +{ + switch(sizeof(long double)) { + case 10: + case 12: + printf("cp x.ou1 x.out; cp xL.ou1 xL.out; cp Q.ou0 Q.out\n"); + break; + case 16: + printf("cp x.ou0 x.out; cp xL.ou0 xL.out; cp Q.ou1 Q.out\n"); + break; + default: + printf("cp x.ou0 x.out; cp xL.ou0 xL.out; cp Q.ou0 Q.out\n"); + } + return 0; + } diff --git a/contrib/gdtoa/test/xsum0.out b/contrib/gdtoa/test/xsum0.out new file mode 100644 index 0000000..ee59cda --- /dev/null +++ b/contrib/gdtoa/test/xsum0.out @@ -0,0 +1,35 @@ +README e6ebdc91 2429 +Qtest.c 140625e2 4778 +dItest.c 8689031 2401 +ddtest.c ea24d330 4943 +dtest.c 900d971 4071 +dt.c addb61c 6198 +ftest.c f609ce43 3958 +getround.c f471599 2041 +strtoIdSI.c 7bfb88b 49 +strtoIddSI.c 72e8852 50 +strtodISI.c ed08b740 49 +strtodt.c 17aca428 3213 +strtopddSI.c 13e7138d 50 +strtorddSI.c f7e4b1d5 50 +xLtest.c faca328f 4646 +xQtest.c efdea3a2 1549 +xtest.c 1f19b87 4858 +rtestnos f94bcdf6 336 +testnos e89999d6 485 +testnos1 7e16229 294 +testnos3 fa5c8aca 11998 +dI.out d522eef 4369 +dIsi.out 1dd6d02f 4350 +ddsi.out 1f94bbe2 10251 +dd.out e262456e 40923 +dtst.out ee75f6b9 23308 +d.out f271efc9 28131 +f.out 4b0bd51 21207 +x.ou0 1cfc5d22 25378 +xL.ou0 faa3a741 26363 +x.ou1 1a7e9dd4 34587 +xL.ou1 418057a 26476 +Q.ou0 e4592b85 28742 +Q.ou1 ea0b344d 39572 +makefile ebbea1e1 4191 diff --git a/contrib/gdtoa/test/xtest.c b/contrib/gdtoa/test/xtest.c new file mode 100644 index 0000000..bd2b008 --- /dev/null +++ b/contrib/gdtoa/test/xtest.c @@ -0,0 +1,176 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to + David M. Gay + Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-0636 + U.S.A. + dmg@bell-labs.com + */ + +/* Test program for g_xfmt, strtoIx, strtopx, and strtorx. + * + * Inputs (on stdin): + * r rounding_mode + * n ndig + * number + * #hex0 hex1 hex2 hex3 hex4 + * + * rounding_mode values: + * 0 = toward zero + * 1 = nearest + * 2 = toward +Infinity + * 3 = toward -Infinity + * + * where number is a decimal floating-point number, + * hex0 is a string of <= 4 Hex digits for the most significant + * half-word of the number, hex1 is a similar string for the next + * half-word, etc., and ndig is a parameters to g_xfmt. + */ + +#include "gdtoa.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + extern int getround ANSI((int,char*)); + + static char ibuf[2048], obuf[2048]; + +#undef _0 +#undef _1 + +/* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */ + +#ifdef IEEE_MC68k +#define _0 0 +#define _1 1 +#define _2 2 +#define _3 3 +#define _4 4 +#endif +#ifdef IEEE_8087 +#define _0 4 +#define _1 3 +#define _2 2 +#define _3 1 +#define _4 0 +#endif + + int +main(Void) +{ + char *s, *se, *se1; + int i, dItry, ndig = 0, r = 1; + union { long double d; UShort bits[5]; } u, v[2]; + + while(s = fgets(ibuf, sizeof(ibuf), stdin)) { + while(*s <= ' ') + if (!*s++) + continue; + dItry = 0; + switch(*s) { + case 'r': + r = getround(r, s); + continue; + case 'n': + i = s[1]; + if (i <= ' ' || i >= '0' && i <= '9') { + ndig = atoi(s+1); + continue; + } + break; /* nan? */ + case '#': + sscanf(s+1, "%hx %hx %hx %hx hx", &u.bits[_0], + &u.bits[_1], &u.bits[_2], &u.bits[_3], + &u.bits[_4]); + printf("\nInput: %s", ibuf); + printf(" --> f = #%x %x %x %x %x\n", u.bits[_0], + u.bits[_1], u.bits[_2], u.bits[_3], u.bits[4]); + goto fmt_test; + } + dItry = 1; + printf("\nInput: %s", ibuf); + i = strtorx(ibuf, &se, r, u.bits); + if (r == 1 && (i != strtopx(ibuf, &se1, v[0].bits) || se1 != se + || memcmp(u.bits, v[0].bits, 10))) + printf("***strtox and strtorx disagree!!\n:"); + printf("\nstrtox consumes %d bytes and returns %d\n", + (int)(se-ibuf), i); + printf("with bits = #%x %x %x %x %x\n", + u.bits[_0], u.bits[_1], u.bits[_2], + u.bits[_3], u.bits[_4]); + if (sizeof(long double) == 12) + printf("printf(\"%%.21Lg\") gives %.21Lg\n", u.d); + fmt_test: + se = g_xfmt(obuf, u.bits, ndig, sizeof(obuf)); + printf("g_xfmt(%d) gives %d bytes: \"%s\"\n\n", + ndig, (int)(se-obuf), se ? obuf : "<null>"); + if (!dItry) + continue; + printf("strtoIx returns %d,", + strtoIx(ibuf, &se, v[0].bits, v[1].bits)); + printf(" consuming %d bytes.\n", (int)(se-ibuf)); + if (!memcmp(v[0].bits, v[1].bits, 10)) { + if (!memcmp(u.bits, v[0].bits, 10)) + printf("fI[0] == fI[1] == strtox\n"); + else { + printf("fI[0] == fI[1] = #%x %x %x %x %x\n", + v[0].bits[_0], v[0].bits[_1], + v[0].bits[_2], v[0].bits[_3], + v[0].bits[_4]); + if (sizeof(long double) == 12) + printf("= %.21Lg\n", v[0].d); + } + } + else { + printf("fI[0] = #%x %x %x %x %x\n", + v[0].bits[_0], v[0].bits[_1], + v[0].bits[_2], v[0].bits[_3], + v[0].bits[_4]); + if (sizeof(long double) == 12) + printf("= %.21Lg\n", v[0].d); + printf("fI[1] = #%x %x %x %x %x\n", + v[1].bits[_0], v[1].bits[_1], + v[1].bits[_2], v[0].bits[_3], + v[0].bits[_4]); + if (sizeof(long double) == 12) + printf("= %.21Lg\n", v[1].d); + if (!memcmp(v[0].bits, u.bits, 10)) + printf("fI[0] == strtox\n"); + else if (!memcmp(v[1].bits, u.bits, 10)) + printf("fI[1] == strtox\n"); + else + printf("**** Both differ from strtod ****\n"); + } + printf("\n"); + } + return 0; + } |