From db84cdb747ac926d3f272933386fc6196c40cb19 Mon Sep 17 00:00:00 2001 From: drh <> Date: Sat, 14 Feb 2026 17:58:46 +0000 Subject: [PATCH] Use a precomputed table of 696 powers of 10 to improve the performance of floating-point to decimal and decimal to floating-point conversions. FossilOrigin-Name: 64d9b7becf2da8927024adda278e837a46837e46af3cff51bd54a183d1716750 --- manifest | 15 +- manifest.uuid | 2 +- src/util.c | 989 +++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 861 insertions(+), 145 deletions(-) diff --git a/manifest b/manifest index 9e78194999..06fb22038a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\sperformance\senhancement\sto\sfloating-point\srendering. -D 2026-02-11T19:42:46.005 +C Use\sa\sprecomputed\stable\sof\s696\spowers\sof\s10\sto\simprove\sthe\sperformance\nof\sfloating-point\sto\sdecimal\sand\sdecimal\sto\sfloating-point\sconversions. +D 2026-02-14T17:58:46.735 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -803,7 +803,7 @@ F src/trigger.c cb894db98083c68c4a17c72566ed39434aa91286db20d2891279ee49e6bfec0c F src/update.c 3e5e7ff66fa19ebe4d1b113d480639a24cc1175adbefabbd1a948a07f28e37cf F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1 F src/utf.c 7267c3fb9e2467020507601af3354c2446c61f444387e094c779dccd5ca62165 -F src/util.c 0d191af08ce8bbc31d5ed7d7b5fb0907ac920220147676ca3c7a6288703954dc +F src/util.c cb0a38becd4eef1084eaf2838bffb3c1423a3bfbebfbeea179d30ac31c0f063b F src/vacuum.c d3d35d8ae893d419ade5fa196d761a83bddcbb62137a1a157ae751ef38b26e82 F src/vdbe.c fa28a8f740f3d94c4e6b6d42ba90c220472683486268e753017512a70ef715f5 F src/vdbe.h 966d0677a540b7ea6549b7c4e1312fc0d830fce3a235a58c801f2cc31cf5ecf9 @@ -2194,11 +2194,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P b67889e4f17c3280f839ee7045256cc47d6ce3ed60d880925e3d30f9ebbcf3ff -R cb6350b426b944c91b4d4e6b58ff7a00 -T *branch * fp-perf -T *sym-fp-perf * -T -sym-trunk * +P 38d8c0d8a0b0e9990ba7bdcce979f2824ffee22a083cb788a75917628b1eb559 +R 698349c0b3cdc46d85eb51f40079e9df U drh -Z 9c515e6aeb36a4ee4cbd4b664e3d6f49 +Z 17cef2cc342806b71491096998b8ccfe # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 998f9549d9..a6e1b96c00 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -38d8c0d8a0b0e9990ba7bdcce979f2824ffee22a083cb788a75917628b1eb559 +64d9b7becf2da8927024adda278e837a46837e46af3cff51bd54a183d1716750 diff --git a/src/util.c b/src/util.c index 20665632d5..40a3bf0e2a 100644 --- a/src/util.c +++ b/src/util.c @@ -457,41 +457,850 @@ u8 sqlite3StrIHash(const char *z){ } return h; } +/* +** The following array holds (approximate) powers-of-ten between +** 1.0e-348 and 1.0e+347. Each value is an unsigned 64-bit integer, +** shifted so that its most significant bit is 1. +*/ +static const u64 sqlite3PowerOfTen[] = { + 0xfa8fd5a0081c0288, /* 0: 1.0e-348 << 1220 */ + 0x9c99e58405118195, /* 1: 1.0e-347 << 1216 */ + 0xc3c05ee50655e1fa, /* 2: 1.0e-346 << 1213 */ + 0xf4b0769e47eb5a78, /* 3: 1.0e-345 << 1210 */ + 0x98ee4a22ecf3188b, /* 4: 1.0e-344 << 1206 */ + 0xbf29dcaba82fdeae, /* 5: 1.0e-343 << 1203 */ + 0xeef453d6923bd65a, /* 6: 1.0e-342 << 1200 */ + 0x9558b4661b6565f8, /* 7: 1.0e-341 << 1196 */ + 0xbaaee17fa23ebf76, /* 8: 1.0e-340 << 1193 */ + 0xe95a99df8ace6f53, /* 9: 1.0e-339 << 1190 */ + 0x91d8a02bb6c10594, /* 10: 1.0e-338 << 1186 */ + 0xb64ec836a47146f9, /* 11: 1.0e-337 << 1183 */ + 0xe3e27a444d8d98b7, /* 12: 1.0e-336 << 1180 */ + 0x8e6d8c6ab0787f72, /* 13: 1.0e-335 << 1176 */ + 0xb208ef855c969f4f, /* 14: 1.0e-334 << 1173 */ + 0xde8b2b66b3bc4723, /* 15: 1.0e-333 << 1170 */ + 0x8b16fb203055ac76, /* 16: 1.0e-332 << 1166 */ + 0xaddcb9e83c6b1793, /* 17: 1.0e-331 << 1163 */ + 0xd953e8624b85dd78, /* 18: 1.0e-330 << 1160 */ + 0x87d4713d6f33aa6b, /* 19: 1.0e-329 << 1156 */ + 0xa9c98d8ccb009506, /* 20: 1.0e-328 << 1153 */ + 0xd43bf0effdc0ba48, /* 21: 1.0e-327 << 1150 */ + 0x84a57695fe98746d, /* 22: 1.0e-326 << 1146 */ + 0xa5ced43b7e3e9188, /* 23: 1.0e-325 << 1143 */ + 0xcf42894a5dce35ea, /* 24: 1.0e-324 << 1140 */ + 0x818995ce7aa0e1b2, /* 25: 1.0e-323 << 1136 */ + 0xa1ebfb4219491a1f, /* 26: 1.0e-322 << 1133 */ + 0xca66fa129f9b60a6, /* 27: 1.0e-321 << 1130 */ + 0xfd00b897478238d0, /* 28: 1.0e-320 << 1127 */ + 0x9e20735e8cb16382, /* 29: 1.0e-319 << 1123 */ + 0xc5a890362fddbc62, /* 30: 1.0e-318 << 1120 */ + 0xf712b443bbd52b7b, /* 31: 1.0e-317 << 1117 */ + 0x9a6bb0aa55653b2d, /* 32: 1.0e-316 << 1113 */ + 0xc1069cd4eabe89f8, /* 33: 1.0e-315 << 1110 */ + 0xf148440a256e2c76, /* 34: 1.0e-314 << 1107 */ + 0x96cd2a865764dbca, /* 35: 1.0e-313 << 1103 */ + 0xbc807527ed3e12bc, /* 36: 1.0e-312 << 1100 */ + 0xeba09271e88d976b, /* 37: 1.0e-311 << 1097 */ + 0x93445b8731587ea3, /* 38: 1.0e-310 << 1093 */ + 0xb8157268fdae9e4c, /* 39: 1.0e-309 << 1090 */ + 0xe61acf033d1a45df, /* 40: 1.0e-308 << 1087 */ + 0x8fd0c16206306bab, /* 41: 1.0e-307 << 1083 */ + 0xb3c4f1ba87bc8696, /* 42: 1.0e-306 << 1080 */ + 0xe0b62e2929aba83c, /* 43: 1.0e-305 << 1077 */ + 0x8c71dcd9ba0b4925, /* 44: 1.0e-304 << 1073 */ + 0xaf8e5410288e1b6f, /* 45: 1.0e-303 << 1070 */ + 0xdb71e91432b1a24a, /* 46: 1.0e-302 << 1067 */ + 0x892731ac9faf056e, /* 47: 1.0e-301 << 1063 */ + 0xab70fe17c79ac6ca, /* 48: 1.0e-300 << 1060 */ + 0xd64d3d9db981787d, /* 49: 1.0e-299 << 1057 */ + 0x85f0468293f0eb4e, /* 50: 1.0e-298 << 1053 */ + 0xa76c582338ed2621, /* 51: 1.0e-297 << 1050 */ + 0xd1476e2c07286faa, /* 52: 1.0e-296 << 1047 */ + 0x82cca4db847945ca, /* 53: 1.0e-295 << 1043 */ + 0xa37fce126597973c, /* 54: 1.0e-294 << 1040 */ + 0xcc5fc196fefd7d0c, /* 55: 1.0e-293 << 1037 */ + 0xff77b1fcbebcdc4f, /* 56: 1.0e-292 << 1034 */ + 0x9faacf3df73609b1, /* 57: 1.0e-291 << 1030 */ + 0xc795830d75038c1d, /* 58: 1.0e-290 << 1027 */ + 0xf97ae3d0d2446f25, /* 59: 1.0e-289 << 1024 */ + 0x9becce62836ac577, /* 60: 1.0e-288 << 1020 */ + 0xc2e801fb244576d5, /* 61: 1.0e-287 << 1017 */ + 0xf3a20279ed56d48a, /* 62: 1.0e-286 << 1014 */ + 0x9845418c345644d6, /* 63: 1.0e-285 << 1010 */ + 0xbe5691ef416bd60c, /* 64: 1.0e-284 << 1007 */ + 0xedec366b11c6cb8f, /* 65: 1.0e-283 << 1004 */ + 0x94b3a202eb1c3f39, /* 66: 1.0e-282 << 1000 */ + 0xb9e08a83a5e34f07, /* 67: 1.0e-281 << 997 */ + 0xe858ad248f5c22c9, /* 68: 1.0e-280 << 994 */ + 0x91376c36d99995be, /* 69: 1.0e-279 << 990 */ + 0xb58547448ffffb2d, /* 70: 1.0e-278 << 987 */ + 0xe2e69915b3fff9f9, /* 71: 1.0e-277 << 984 */ + 0x8dd01fad907ffc3b, /* 72: 1.0e-276 << 980 */ + 0xb1442798f49ffb4a, /* 73: 1.0e-275 << 977 */ + 0xdd95317f31c7fa1d, /* 74: 1.0e-274 << 974 */ + 0x8a7d3eef7f1cfc52, /* 75: 1.0e-273 << 970 */ + 0xad1c8eab5ee43b66, /* 76: 1.0e-272 << 967 */ + 0xd863b256369d4a40, /* 77: 1.0e-271 << 964 */ + 0x873e4f75e2224e68, /* 78: 1.0e-270 << 960 */ + 0xa90de3535aaae202, /* 79: 1.0e-269 << 957 */ + 0xd3515c2831559a83, /* 80: 1.0e-268 << 954 */ + 0x8412d9991ed58091, /* 81: 1.0e-267 << 950 */ + 0xa5178fff668ae0b6, /* 82: 1.0e-266 << 947 */ + 0xce5d73ff402d98e3, /* 83: 1.0e-265 << 944 */ + 0x80fa687f881c7f8e, /* 84: 1.0e-264 << 940 */ + 0xa139029f6a239f72, /* 85: 1.0e-263 << 937 */ + 0xc987434744ac874e, /* 86: 1.0e-262 << 934 */ + 0xfbe9141915d7a922, /* 87: 1.0e-261 << 931 */ + 0x9d71ac8fada6c9b5, /* 88: 1.0e-260 << 927 */ + 0xc4ce17b399107c22, /* 89: 1.0e-259 << 924 */ + 0xf6019da07f549b2b, /* 90: 1.0e-258 << 921 */ + 0x99c102844f94e0fb, /* 91: 1.0e-257 << 917 */ + 0xc0314325637a1939, /* 92: 1.0e-256 << 914 */ + 0xf03d93eebc589f88, /* 93: 1.0e-255 << 911 */ + 0x96267c7535b763b5, /* 94: 1.0e-254 << 907 */ + 0xbbb01b9283253ca2, /* 95: 1.0e-253 << 904 */ + 0xea9c227723ee8bcb, /* 96: 1.0e-252 << 901 */ + 0x92a1958a7675175f, /* 97: 1.0e-251 << 897 */ + 0xb749faed14125d36, /* 98: 1.0e-250 << 894 */ + 0xe51c79a85916f484, /* 99: 1.0e-249 << 891 */ + 0x8f31cc0937ae58d2, /* 100: 1.0e-248 << 887 */ + 0xb2fe3f0b8599ef07, /* 101: 1.0e-247 << 884 */ + 0xdfbdcece67006ac9, /* 102: 1.0e-246 << 881 */ + 0x8bd6a141006042bd, /* 103: 1.0e-245 << 877 */ + 0xaecc49914078536d, /* 104: 1.0e-244 << 874 */ + 0xda7f5bf590966848, /* 105: 1.0e-243 << 871 */ + 0x888f99797a5e012d, /* 106: 1.0e-242 << 867 */ + 0xaab37fd7d8f58178, /* 107: 1.0e-241 << 864 */ + 0xd5605fcdcf32e1d6, /* 108: 1.0e-240 << 861 */ + 0x855c3be0a17fcd26, /* 109: 1.0e-239 << 857 */ + 0xa6b34ad8c9dfc06f, /* 110: 1.0e-238 << 854 */ + 0xd0601d8efc57b08b, /* 111: 1.0e-237 << 851 */ + 0x823c12795db6ce57, /* 112: 1.0e-236 << 847 */ + 0xa2cb1717b52481ed, /* 113: 1.0e-235 << 844 */ + 0xcb7ddcdda26da268, /* 114: 1.0e-234 << 841 */ + 0xfe5d54150b090b02, /* 115: 1.0e-233 << 838 */ + 0x9efa548d26e5a6e1, /* 116: 1.0e-232 << 834 */ + 0xc6b8e9b0709f109a, /* 117: 1.0e-231 << 831 */ + 0xf867241c8cc6d4c0, /* 118: 1.0e-230 << 828 */ + 0x9b407691d7fc44f8, /* 119: 1.0e-229 << 824 */ + 0xc21094364dfb5636, /* 120: 1.0e-228 << 821 */ + 0xf294b943e17a2bc4, /* 121: 1.0e-227 << 818 */ + 0x979cf3ca6cec5b5a, /* 122: 1.0e-226 << 814 */ + 0xbd8430bd08277231, /* 123: 1.0e-225 << 811 */ + 0xece53cec4a314ebd, /* 124: 1.0e-224 << 808 */ + 0x940f4613ae5ed136, /* 125: 1.0e-223 << 804 */ + 0xb913179899f68584, /* 126: 1.0e-222 << 801 */ + 0xe757dd7ec07426e5, /* 127: 1.0e-221 << 798 */ + 0x9096ea6f3848984f, /* 128: 1.0e-220 << 794 */ + 0xb4bca50b065abe63, /* 129: 1.0e-219 << 791 */ + 0xe1ebce4dc7f16dfb, /* 130: 1.0e-218 << 788 */ + 0x8d3360f09cf6e4bd, /* 131: 1.0e-217 << 784 */ + 0xb080392cc4349dec, /* 132: 1.0e-216 << 781 */ + 0xdca04777f541c567, /* 133: 1.0e-215 << 778 */ + 0x89e42caaf9491b60, /* 134: 1.0e-214 << 774 */ + 0xac5d37d5b79b6239, /* 135: 1.0e-213 << 771 */ + 0xd77485cb25823ac7, /* 136: 1.0e-212 << 768 */ + 0x86a8d39ef77164bc, /* 137: 1.0e-211 << 764 */ + 0xa8530886b54dbdeb, /* 138: 1.0e-210 << 761 */ + 0xd267caa862a12d66, /* 139: 1.0e-209 << 758 */ + 0x8380dea93da4bc60, /* 140: 1.0e-208 << 754 */ + 0xa46116538d0deb78, /* 141: 1.0e-207 << 751 */ + 0xcd795be870516656, /* 142: 1.0e-206 << 748 */ + 0x806bd9714632dff6, /* 143: 1.0e-205 << 744 */ + 0xa086cfcd97bf97f3, /* 144: 1.0e-204 << 741 */ + 0xc8a883c0fdaf7df0, /* 145: 1.0e-203 << 738 */ + 0xfad2a4b13d1b5d6c, /* 146: 1.0e-202 << 735 */ + 0x9cc3a6eec6311a63, /* 147: 1.0e-201 << 731 */ + 0xc3f490aa77bd60fc, /* 148: 1.0e-200 << 728 */ + 0xf4f1b4d515acb93b, /* 149: 1.0e-199 << 725 */ + 0x991711052d8bf3c5, /* 150: 1.0e-198 << 721 */ + 0xbf5cd54678eef0b6, /* 151: 1.0e-197 << 718 */ + 0xef340a98172aace4, /* 152: 1.0e-196 << 715 */ + 0x9580869f0e7aac0e, /* 153: 1.0e-195 << 711 */ + 0xbae0a846d2195712, /* 154: 1.0e-194 << 708 */ + 0xe998d258869facd7, /* 155: 1.0e-193 << 705 */ + 0x91ff83775423cc06, /* 156: 1.0e-192 << 701 */ + 0xb67f6455292cbf08, /* 157: 1.0e-191 << 698 */ + 0xe41f3d6a7377eeca, /* 158: 1.0e-190 << 695 */ + 0x8e938662882af53e, /* 159: 1.0e-189 << 691 */ + 0xb23867fb2a35b28d, /* 160: 1.0e-188 << 688 */ + 0xdec681f9f4c31f31, /* 161: 1.0e-187 << 685 */ + 0x8b3c113c38f9f37e, /* 162: 1.0e-186 << 681 */ + 0xae0b158b4738705e, /* 163: 1.0e-185 << 678 */ + 0xd98ddaee19068c76, /* 164: 1.0e-184 << 675 */ + 0x87f8a8d4cfa417c9, /* 165: 1.0e-183 << 671 */ + 0xa9f6d30a038d1dbc, /* 166: 1.0e-182 << 668 */ + 0xd47487cc8470652b, /* 167: 1.0e-181 << 665 */ + 0x84c8d4dfd2c63f3b, /* 168: 1.0e-180 << 661 */ + 0xa5fb0a17c777cf09, /* 169: 1.0e-179 << 658 */ + 0xcf79cc9db955c2cc, /* 170: 1.0e-178 << 655 */ + 0x81ac1fe293d599bf, /* 171: 1.0e-177 << 651 */ + 0xa21727db38cb002f, /* 172: 1.0e-176 << 648 */ + 0xca9cf1d206fdc03b, /* 173: 1.0e-175 << 645 */ + 0xfd442e4688bd304a, /* 174: 1.0e-174 << 642 */ + 0x9e4a9cec15763e2e, /* 175: 1.0e-173 << 638 */ + 0xc5dd44271ad3cdba, /* 176: 1.0e-172 << 635 */ + 0xf7549530e188c128, /* 177: 1.0e-171 << 632 */ + 0x9a94dd3e8cf578b9, /* 178: 1.0e-170 << 628 */ + 0xc13a148e3032d6e7, /* 179: 1.0e-169 << 625 */ + 0xf18899b1bc3f8ca1, /* 180: 1.0e-168 << 622 */ + 0x96f5600f15a7b7e5, /* 181: 1.0e-167 << 618 */ + 0xbcb2b812db11a5de, /* 182: 1.0e-166 << 615 */ + 0xebdf661791d60f56, /* 183: 1.0e-165 << 612 */ + 0x936b9fcebb25c995, /* 184: 1.0e-164 << 608 */ + 0xb84687c269ef3bfb, /* 185: 1.0e-163 << 605 */ + 0xe65829b3046b0afa, /* 186: 1.0e-162 << 602 */ + 0x8ff71a0fe2c2e6dc, /* 187: 1.0e-161 << 598 */ + 0xb3f4e093db73a093, /* 188: 1.0e-160 << 595 */ + 0xe0f218b8d25088b8, /* 189: 1.0e-159 << 592 */ + 0x8c974f7383725573, /* 190: 1.0e-158 << 588 */ + 0xafbd2350644eeacf, /* 191: 1.0e-157 << 585 */ + 0xdbac6c247d62a583, /* 192: 1.0e-156 << 582 */ + 0x894bc396ce5da772, /* 193: 1.0e-155 << 578 */ + 0xab9eb47c81f5114f, /* 194: 1.0e-154 << 575 */ + 0xd686619ba27255a2, /* 195: 1.0e-153 << 572 */ + 0x8613fd0145877585, /* 196: 1.0e-152 << 568 */ + 0xa798fc4196e952e7, /* 197: 1.0e-151 << 565 */ + 0xd17f3b51fca3a7a0, /* 198: 1.0e-150 << 562 */ + 0x82ef85133de648c4, /* 199: 1.0e-149 << 558 */ + 0xa3ab66580d5fdaf5, /* 200: 1.0e-148 << 555 */ + 0xcc963fee10b7d1b3, /* 201: 1.0e-147 << 552 */ + 0xffbbcfe994e5c61f, /* 202: 1.0e-146 << 549 */ + 0x9fd561f1fd0f9bd3, /* 203: 1.0e-145 << 545 */ + 0xc7caba6e7c5382c8, /* 204: 1.0e-144 << 542 */ + 0xf9bd690a1b68637b, /* 205: 1.0e-143 << 539 */ + 0x9c1661a651213e2d, /* 206: 1.0e-142 << 535 */ + 0xc31bfa0fe5698db8, /* 207: 1.0e-141 << 532 */ + 0xf3e2f893dec3f126, /* 208: 1.0e-140 << 529 */ + 0x986ddb5c6b3a76b7, /* 209: 1.0e-139 << 525 */ + 0xbe89523386091465, /* 210: 1.0e-138 << 522 */ + 0xee2ba6c0678b597f, /* 211: 1.0e-137 << 519 */ + 0x94db483840b717ef, /* 212: 1.0e-136 << 515 */ + 0xba121a4650e4ddeb, /* 213: 1.0e-135 << 512 */ + 0xe896a0d7e51e1566, /* 214: 1.0e-134 << 509 */ + 0x915e2486ef32cd60, /* 215: 1.0e-133 << 505 */ + 0xb5b5ada8aaff80b8, /* 216: 1.0e-132 << 502 */ + 0xe3231912d5bf60e6, /* 217: 1.0e-131 << 499 */ + 0x8df5efabc5979c8f, /* 218: 1.0e-130 << 495 */ + 0xb1736b96b6fd83b3, /* 219: 1.0e-129 << 492 */ + 0xddd0467c64bce4a0, /* 220: 1.0e-128 << 489 */ + 0x8aa22c0dbef60ee4, /* 221: 1.0e-127 << 485 */ + 0xad4ab7112eb3929d, /* 222: 1.0e-126 << 482 */ + 0xd89d64d57a607744, /* 223: 1.0e-125 << 479 */ + 0x87625f056c7c4a8b, /* 224: 1.0e-124 << 475 */ + 0xa93af6c6c79b5d2d, /* 225: 1.0e-123 << 472 */ + 0xd389b47879823479, /* 226: 1.0e-122 << 469 */ + 0x843610cb4bf160cb, /* 227: 1.0e-121 << 465 */ + 0xa54394fe1eedb8fe, /* 228: 1.0e-120 << 462 */ + 0xce947a3da6a9273e, /* 229: 1.0e-119 << 459 */ + 0x811ccc668829b887, /* 230: 1.0e-118 << 455 */ + 0xa163ff802a3426a8, /* 231: 1.0e-117 << 452 */ + 0xc9bcff6034c13052, /* 232: 1.0e-116 << 449 */ + 0xfc2c3f3841f17c67, /* 233: 1.0e-115 << 446 */ + 0x9d9ba7832936edc0, /* 234: 1.0e-114 << 442 */ + 0xc5029163f384a931, /* 235: 1.0e-113 << 439 */ + 0xf64335bcf065d37d, /* 236: 1.0e-112 << 436 */ + 0x99ea0196163fa42e, /* 237: 1.0e-111 << 432 */ + 0xc06481fb9bcf8d39, /* 238: 1.0e-110 << 429 */ + 0xf07da27a82c37088, /* 239: 1.0e-109 << 426 */ + 0x964e858c91ba2655, /* 240: 1.0e-108 << 422 */ + 0xbbe226efb628afea, /* 241: 1.0e-107 << 419 */ + 0xeadab0aba3b2dbe5, /* 242: 1.0e-106 << 416 */ + 0x92c8ae6b464fc96f, /* 243: 1.0e-105 << 412 */ + 0xb77ada0617e3bbcb, /* 244: 1.0e-104 << 409 */ + 0xe55990879ddcaabd, /* 245: 1.0e-103 << 406 */ + 0x8f57fa54c2a9eab6, /* 246: 1.0e-102 << 402 */ + 0xb32df8e9f3546564, /* 247: 1.0e-101 << 399 */ + 0xdff9772470297ebd, /* 248: 1.0e-100 << 396 */ + 0x8bfbea76c619ef36, /* 249: 1.0e-99 << 392 */ + 0xaefae51477a06b03, /* 250: 1.0e-98 << 389 */ + 0xdab99e59958885c4, /* 251: 1.0e-97 << 386 */ + 0x88b402f7fd75539b, /* 252: 1.0e-96 << 382 */ + 0xaae103b5fcd2a881, /* 253: 1.0e-95 << 379 */ + 0xd59944a37c0752a2, /* 254: 1.0e-94 << 376 */ + 0x857fcae62d8493a5, /* 255: 1.0e-93 << 372 */ + 0xa6dfbd9fb8e5b88e, /* 256: 1.0e-92 << 369 */ + 0xd097ad07a71f26b2, /* 257: 1.0e-91 << 366 */ + 0x825ecc24c873782f, /* 258: 1.0e-90 << 362 */ + 0xa2f67f2dfa90563b, /* 259: 1.0e-89 << 359 */ + 0xcbb41ef979346bca, /* 260: 1.0e-88 << 356 */ + 0xfea126b7d78186bc, /* 261: 1.0e-87 << 353 */ + 0x9f24b832e6b0f436, /* 262: 1.0e-86 << 349 */ + 0xc6ede63fa05d3143, /* 263: 1.0e-85 << 346 */ + 0xf8a95fcf88747d94, /* 264: 1.0e-84 << 343 */ + 0x9b69dbe1b548ce7c, /* 265: 1.0e-83 << 339 */ + 0xc24452da229b021b, /* 266: 1.0e-82 << 336 */ + 0xf2d56790ab41c2a2, /* 267: 1.0e-81 << 333 */ + 0x97c560ba6b0919a5, /* 268: 1.0e-80 << 329 */ + 0xbdb6b8e905cb600f, /* 269: 1.0e-79 << 326 */ + 0xed246723473e3813, /* 270: 1.0e-78 << 323 */ + 0x9436c0760c86e30b, /* 271: 1.0e-77 << 319 */ + 0xb94470938fa89bce, /* 272: 1.0e-76 << 316 */ + 0xe7958cb87392c2c2, /* 273: 1.0e-75 << 313 */ + 0x90bd77f3483bb9b9, /* 274: 1.0e-74 << 309 */ + 0xb4ecd5f01a4aa828, /* 275: 1.0e-73 << 306 */ + 0xe2280b6c20dd5232, /* 276: 1.0e-72 << 303 */ + 0x8d590723948a535f, /* 277: 1.0e-71 << 299 */ + 0xb0af48ec79ace837, /* 278: 1.0e-70 << 296 */ + 0xdcdb1b2798182244, /* 279: 1.0e-69 << 293 */ + 0x8a08f0f8bf0f156b, /* 280: 1.0e-68 << 289 */ + 0xac8b2d36eed2dac5, /* 281: 1.0e-67 << 286 */ + 0xd7adf884aa879177, /* 282: 1.0e-66 << 283 */ + 0x86ccbb52ea94baea, /* 283: 1.0e-65 << 279 */ + 0xa87fea27a539e9a5, /* 284: 1.0e-64 << 276 */ + 0xd29fe4b18e88640e, /* 285: 1.0e-63 << 273 */ + 0x83a3eeeef9153e89, /* 286: 1.0e-62 << 269 */ + 0xa48ceaaab75a8e2b, /* 287: 1.0e-61 << 266 */ + 0xcdb02555653131b6, /* 288: 1.0e-60 << 263 */ + 0x808e17555f3ebf11, /* 289: 1.0e-59 << 259 */ + 0xa0b19d2ab70e6ed6, /* 290: 1.0e-58 << 256 */ + 0xc8de047564d20a8b, /* 291: 1.0e-57 << 253 */ + 0xfb158592be068d2e, /* 292: 1.0e-56 << 250 */ + 0x9ced737bb6c4183d, /* 293: 1.0e-55 << 246 */ + 0xc428d05aa4751e4c, /* 294: 1.0e-54 << 243 */ + 0xf53304714d9265df, /* 295: 1.0e-53 << 240 */ + 0x993fe2c6d07b7fab, /* 296: 1.0e-52 << 236 */ + 0xbf8fdb78849a5f96, /* 297: 1.0e-51 << 233 */ + 0xef73d256a5c0f77c, /* 298: 1.0e-50 << 230 */ + 0x95a8637627989aad, /* 299: 1.0e-49 << 226 */ + 0xbb127c53b17ec159, /* 300: 1.0e-48 << 223 */ + 0xe9d71b689dde71af, /* 301: 1.0e-47 << 220 */ + 0x9226712162ab070d, /* 302: 1.0e-46 << 216 */ + 0xb6b00d69bb55c8d1, /* 303: 1.0e-45 << 213 */ + 0xe45c10c42a2b3b05, /* 304: 1.0e-44 << 210 */ + 0x8eb98a7a9a5b04e3, /* 305: 1.0e-43 << 206 */ + 0xb267ed1940f1c61c, /* 306: 1.0e-42 << 203 */ + 0xdf01e85f912e37a3, /* 307: 1.0e-41 << 200 */ + 0x8b61313bbabce2c6, /* 308: 1.0e-40 << 196 */ + 0xae397d8aa96c1b77, /* 309: 1.0e-39 << 193 */ + 0xd9c7dced53c72255, /* 310: 1.0e-38 << 190 */ + 0x881cea14545c7575, /* 311: 1.0e-37 << 186 */ + 0xaa242499697392d2, /* 312: 1.0e-36 << 183 */ + 0xd4ad2dbfc3d07787, /* 313: 1.0e-35 << 180 */ + 0x84ec3c97da624ab4, /* 314: 1.0e-34 << 176 */ + 0xa6274bbdd0fadd61, /* 315: 1.0e-33 << 173 */ + 0xcfb11ead453994ba, /* 316: 1.0e-32 << 170 */ + 0x81ceb32c4b43fcf4, /* 317: 1.0e-31 << 166 */ + 0xa2425ff75e14fc31, /* 318: 1.0e-30 << 163 */ + 0xcad2f7f5359a3b3e, /* 319: 1.0e-29 << 160 */ + 0xfd87b5f28300ca0d, /* 320: 1.0e-28 << 157 */ + 0x9e74d1b791e07e48, /* 321: 1.0e-27 << 153 */ + 0xc612062576589dda, /* 322: 1.0e-26 << 150 */ + 0xf79687aed3eec551, /* 323: 1.0e-25 << 147 */ + 0x9abe14cd44753b52, /* 324: 1.0e-24 << 143 */ + 0xc16d9a0095928a27, /* 325: 1.0e-23 << 140 */ + 0xf1c90080baf72cb1, /* 326: 1.0e-22 << 137 */ + 0x971da05074da7bee, /* 327: 1.0e-21 << 133 */ + 0xbce5086492111aea, /* 328: 1.0e-20 << 130 */ + 0xec1e4a7db69561a5, /* 329: 1.0e-19 << 127 */ + 0x9392ee8e921d5d07, /* 330: 1.0e-18 << 123 */ + 0xb877aa3236a4b449, /* 331: 1.0e-17 << 120 */ + 0xe69594bec44de15b, /* 332: 1.0e-16 << 117 */ + 0x901d7cf73ab0acd9, /* 333: 1.0e-15 << 113 */ + 0xb424dc35095cd80f, /* 334: 1.0e-14 << 110 */ + 0xe12e13424bb40e13, /* 335: 1.0e-13 << 107 */ + 0x8cbccc096f5088cb, /* 336: 1.0e-12 << 103 */ + 0xafebff0bcb24aafe, /* 337: 1.0e-11 << 100 */ + 0xdbe6fecebdedd5be, /* 338: 1.0e-10 << 97 */ + 0x89705f4136b4a597, /* 339: 1.0e-9 << 93 */ + 0xabcc77118461cefc, /* 340: 1.0e-8 << 90 */ + 0xd6bf94d5e57a42bc, /* 341: 1.0e-7 << 87 */ + 0x8637bd05af6c69b5, /* 342: 1.0e-6 << 83 */ + 0xa7c5ac471b478423, /* 343: 1.0e-5 << 80 */ + 0xd1b71758e219652b, /* 344: 1.0e-4 << 77 */ + 0x83126e978d4fdf3b, /* 345: 1.0e-3 << 73 */ + 0xa3d70a3d70a3d70a, /* 346: 1.0e-2 << 70 */ + 0xcccccccccccccccc, /* 347: 1.0e-1 << 67 */ + 0x8000000000000000, /* 348: 1.0e+0 << 63 */ + 0xa000000000000000, /* 349: 1.0e+1 << 60 */ + 0xc800000000000000, /* 350: 1.0e+2 << 57 */ + 0xfa00000000000000, /* 351: 1.0e+3 << 54 */ + 0x9c40000000000000, /* 352: 1.0e+4 << 50 */ + 0xc350000000000000, /* 353: 1.0e+5 << 47 */ + 0xf424000000000000, /* 354: 1.0e+6 << 44 */ + 0x9896800000000000, /* 355: 1.0e+7 << 40 */ + 0xbebc200000000000, /* 356: 1.0e+8 << 37 */ + 0xee6b280000000000, /* 357: 1.0e+9 << 34 */ + 0x9502f90000000000, /* 358: 1.0e+10 << 30 */ + 0xba43b74000000000, /* 359: 1.0e+11 << 27 */ + 0xe8d4a51000000000, /* 360: 1.0e+12 << 24 */ + 0x9184e72a00000000, /* 361: 1.0e+13 << 20 */ + 0xb5e620f480000000, /* 362: 1.0e+14 << 17 */ + 0xe35fa931a0000000, /* 363: 1.0e+15 << 14 */ + 0x8e1bc9bf04000000, /* 364: 1.0e+16 << 10 */ + 0xb1a2bc2ec5000000, /* 365: 1.0e+17 << 7 */ + 0xde0b6b3a76400000, /* 366: 1.0e+18 << 4 */ + 0x8ac7230489e80000, /* 367: 1.0e+19 >> 0 */ + 0xad78ebc5ac620000, /* 368: 1.0e+20 >> 3 */ + 0xd8d726b7177a8000, /* 369: 1.0e+21 >> 6 */ + 0x878678326eac9000, /* 370: 1.0e+22 >> 10 */ + 0xa968163f0a57b400, /* 371: 1.0e+23 >> 13 */ + 0xd3c21bcecceda100, /* 372: 1.0e+24 >> 16 */ + 0x84595161401484a0, /* 373: 1.0e+25 >> 20 */ + 0xa56fa5b99019a5c8, /* 374: 1.0e+26 >> 23 */ + 0xcecb8f27f4200f3a, /* 375: 1.0e+27 >> 26 */ + 0x813f3978f8940984, /* 376: 1.0e+28 >> 30 */ + 0xa18f07d736b90be5, /* 377: 1.0e+29 >> 33 */ + 0xc9f2c9cd04674ede, /* 378: 1.0e+30 >> 36 */ + 0xfc6f7c4045812296, /* 379: 1.0e+31 >> 39 */ + 0x9dc5ada82b70b59d, /* 380: 1.0e+32 >> 43 */ + 0xc5371912364ce305, /* 381: 1.0e+33 >> 46 */ + 0xf684df56c3e01bc6, /* 382: 1.0e+34 >> 49 */ + 0x9a130b963a6c115c, /* 383: 1.0e+35 >> 53 */ + 0xc097ce7bc90715b3, /* 384: 1.0e+36 >> 56 */ + 0xf0bdc21abb48db20, /* 385: 1.0e+37 >> 59 */ + 0x96769950b50d88f4, /* 386: 1.0e+38 >> 63 */ + 0xbc143fa4e250eb31, /* 387: 1.0e+39 >> 66 */ + 0xeb194f8e1ae525fd, /* 388: 1.0e+40 >> 69 */ + 0x92efd1b8d0cf37be, /* 389: 1.0e+41 >> 73 */ + 0xb7abc627050305ad, /* 390: 1.0e+42 >> 76 */ + 0xe596b7b0c643c719, /* 391: 1.0e+43 >> 79 */ + 0x8f7e32ce7bea5c6f, /* 392: 1.0e+44 >> 83 */ + 0xb35dbf821ae4f38b, /* 393: 1.0e+45 >> 86 */ + 0xe0352f62a19e306e, /* 394: 1.0e+46 >> 89 */ + 0x8c213d9da502de45, /* 395: 1.0e+47 >> 93 */ + 0xaf298d050e4395d6, /* 396: 1.0e+48 >> 96 */ + 0xdaf3f04651d47b4c, /* 397: 1.0e+49 >> 99 */ + 0x88d8762bf324cd0f, /* 398: 1.0e+50 >> 103 */ + 0xab0e93b6efee0053, /* 399: 1.0e+51 >> 106 */ + 0xd5d238a4abe98068, /* 400: 1.0e+52 >> 109 */ + 0x85a36366eb71f041, /* 401: 1.0e+53 >> 113 */ + 0xa70c3c40a64e6c51, /* 402: 1.0e+54 >> 116 */ + 0xd0cf4b50cfe20765, /* 403: 1.0e+55 >> 119 */ + 0x82818f1281ed449f, /* 404: 1.0e+56 >> 123 */ + 0xa321f2d7226895c7, /* 405: 1.0e+57 >> 126 */ + 0xcbea6f8ceb02bb39, /* 406: 1.0e+58 >> 129 */ + 0xfee50b7025c36a08, /* 407: 1.0e+59 >> 132 */ + 0x9f4f2726179a2245, /* 408: 1.0e+60 >> 136 */ + 0xc722f0ef9d80aad6, /* 409: 1.0e+61 >> 139 */ + 0xf8ebad2b84e0d58b, /* 410: 1.0e+62 >> 142 */ + 0x9b934c3b330c8577, /* 411: 1.0e+63 >> 146 */ + 0xc2781f49ffcfa6d5, /* 412: 1.0e+64 >> 149 */ + 0xf316271c7fc3908a, /* 413: 1.0e+65 >> 152 */ + 0x97edd871cfda3a56, /* 414: 1.0e+66 >> 156 */ + 0xbde94e8e43d0c8ec, /* 415: 1.0e+67 >> 159 */ + 0xed63a231d4c4fb27, /* 416: 1.0e+68 >> 162 */ + 0x945e455f24fb1cf8, /* 417: 1.0e+69 >> 166 */ + 0xb975d6b6ee39e436, /* 418: 1.0e+70 >> 169 */ + 0xe7d34c64a9c85d44, /* 419: 1.0e+71 >> 172 */ + 0x90e40fbeea1d3a4a, /* 420: 1.0e+72 >> 176 */ + 0xb51d13aea4a488dd, /* 421: 1.0e+73 >> 179 */ + 0xe264589a4dcdab14, /* 422: 1.0e+74 >> 182 */ + 0x8d7eb76070a08aec, /* 423: 1.0e+75 >> 186 */ + 0xb0de65388cc8ada8, /* 424: 1.0e+76 >> 189 */ + 0xdd15fe86affad912, /* 425: 1.0e+77 >> 192 */ + 0x8a2dbf142dfcc7ab, /* 426: 1.0e+78 >> 196 */ + 0xacb92ed9397bf996, /* 427: 1.0e+79 >> 199 */ + 0xd7e77a8f87daf7fb, /* 428: 1.0e+80 >> 202 */ + 0x86f0ac99b4e8dafd, /* 429: 1.0e+81 >> 206 */ + 0xa8acd7c0222311bc, /* 430: 1.0e+82 >> 209 */ + 0xd2d80db02aabd62b, /* 431: 1.0e+83 >> 212 */ + 0x83c7088e1aab65db, /* 432: 1.0e+84 >> 216 */ + 0xa4b8cab1a1563f52, /* 433: 1.0e+85 >> 219 */ + 0xcde6fd5e09abcf26, /* 434: 1.0e+86 >> 222 */ + 0x80b05e5ac60b6178, /* 435: 1.0e+87 >> 226 */ + 0xa0dc75f1778e39d6, /* 436: 1.0e+88 >> 229 */ + 0xc913936dd571c84c, /* 437: 1.0e+89 >> 232 */ + 0xfb5878494ace3a5f, /* 438: 1.0e+90 >> 235 */ + 0x9d174b2dcec0e47b, /* 439: 1.0e+91 >> 239 */ + 0xc45d1df942711d9a, /* 440: 1.0e+92 >> 242 */ + 0xf5746577930d6500, /* 441: 1.0e+93 >> 245 */ + 0x9968bf6abbe85f20, /* 442: 1.0e+94 >> 249 */ + 0xbfc2ef456ae276e8, /* 443: 1.0e+95 >> 252 */ + 0xefb3ab16c59b14a2, /* 444: 1.0e+96 >> 255 */ + 0x95d04aee3b80ece5, /* 445: 1.0e+97 >> 259 */ + 0xbb445da9ca61281f, /* 446: 1.0e+98 >> 262 */ + 0xea1575143cf97226, /* 447: 1.0e+99 >> 265 */ + 0x924d692ca61be758, /* 448: 1.0e+100 >> 269 */ + 0xb6e0c377cfa2e12e, /* 449: 1.0e+101 >> 272 */ + 0xe498f455c38b997a, /* 450: 1.0e+102 >> 275 */ + 0x8edf98b59a373fec, /* 451: 1.0e+103 >> 279 */ + 0xb2977ee300c50fe7, /* 452: 1.0e+104 >> 282 */ + 0xdf3d5e9bc0f653e1, /* 453: 1.0e+105 >> 285 */ + 0x8b865b215899f46c, /* 454: 1.0e+106 >> 289 */ + 0xae67f1e9aec07187, /* 455: 1.0e+107 >> 292 */ + 0xda01ee641a708de9, /* 456: 1.0e+108 >> 295 */ + 0x884134fe908658b2, /* 457: 1.0e+109 >> 299 */ + 0xaa51823e34a7eede, /* 458: 1.0e+110 >> 302 */ + 0xd4e5e2cdc1d1ea96, /* 459: 1.0e+111 >> 305 */ + 0x850fadc09923329e, /* 460: 1.0e+112 >> 309 */ + 0xa6539930bf6bff45, /* 461: 1.0e+113 >> 312 */ + 0xcfe87f7cef46ff16, /* 462: 1.0e+114 >> 315 */ + 0x81f14fae158c5f6e, /* 463: 1.0e+115 >> 319 */ + 0xa26da3999aef7749, /* 464: 1.0e+116 >> 322 */ + 0xcb090c8001ab551c, /* 465: 1.0e+117 >> 325 */ + 0xfdcb4fa002162a63, /* 466: 1.0e+118 >> 328 */ + 0x9e9f11c4014dda7e, /* 467: 1.0e+119 >> 332 */ + 0xc646d63501a1511d, /* 468: 1.0e+120 >> 335 */ + 0xf7d88bc24209a565, /* 469: 1.0e+121 >> 338 */ + 0x9ae757596946075f, /* 470: 1.0e+122 >> 342 */ + 0xc1a12d2fc3978937, /* 471: 1.0e+123 >> 345 */ + 0xf209787bb47d6b84, /* 472: 1.0e+124 >> 348 */ + 0x9745eb4d50ce6332, /* 473: 1.0e+125 >> 352 */ + 0xbd176620a501fbff, /* 474: 1.0e+126 >> 355 */ + 0xec5d3fa8ce427aff, /* 475: 1.0e+127 >> 358 */ + 0x93ba47c980e98cdf, /* 476: 1.0e+128 >> 362 */ + 0xb8a8d9bbe123f017, /* 477: 1.0e+129 >> 365 */ + 0xe6d3102ad96cec1d, /* 478: 1.0e+130 >> 368 */ + 0x9043ea1ac7e41392, /* 479: 1.0e+131 >> 372 */ + 0xb454e4a179dd1877, /* 480: 1.0e+132 >> 375 */ + 0xe16a1dc9d8545e94, /* 481: 1.0e+133 >> 378 */ + 0x8ce2529e2734bb1d, /* 482: 1.0e+134 >> 382 */ + 0xb01ae745b101e9e4, /* 483: 1.0e+135 >> 385 */ + 0xdc21a1171d42645d, /* 484: 1.0e+136 >> 388 */ + 0x899504ae72497eba, /* 485: 1.0e+137 >> 392 */ + 0xabfa45da0edbde69, /* 486: 1.0e+138 >> 395 */ + 0xd6f8d7509292d603, /* 487: 1.0e+139 >> 398 */ + 0x865b86925b9bc5c2, /* 488: 1.0e+140 >> 402 */ + 0xa7f26836f282b732, /* 489: 1.0e+141 >> 405 */ + 0xd1ef0244af2364ff, /* 490: 1.0e+142 >> 408 */ + 0x8335616aed761f1f, /* 491: 1.0e+143 >> 412 */ + 0xa402b9c5a8d3a6e7, /* 492: 1.0e+144 >> 415 */ + 0xcd036837130890a1, /* 493: 1.0e+145 >> 418 */ + 0x802221226be55a64, /* 494: 1.0e+146 >> 422 */ + 0xa02aa96b06deb0fd, /* 495: 1.0e+147 >> 425 */ + 0xc83553c5c8965d3d, /* 496: 1.0e+148 >> 428 */ + 0xfa42a8b73abbf48c, /* 497: 1.0e+149 >> 431 */ + 0x9c69a97284b578d7, /* 498: 1.0e+150 >> 435 */ + 0xc38413cf25e2d70d, /* 499: 1.0e+151 >> 438 */ + 0xf46518c2ef5b8cd1, /* 500: 1.0e+152 >> 441 */ + 0x98bf2f79d5993802, /* 501: 1.0e+153 >> 445 */ + 0xbeeefb584aff8603, /* 502: 1.0e+154 >> 448 */ + 0xeeaaba2e5dbf6784, /* 503: 1.0e+155 >> 451 */ + 0x952ab45cfa97a0b2, /* 504: 1.0e+156 >> 455 */ + 0xba756174393d88df, /* 505: 1.0e+157 >> 458 */ + 0xe912b9d1478ceb17, /* 506: 1.0e+158 >> 461 */ + 0x91abb422ccb812ee, /* 507: 1.0e+159 >> 465 */ + 0xb616a12b7fe617aa, /* 508: 1.0e+160 >> 468 */ + 0xe39c49765fdf9d94, /* 509: 1.0e+161 >> 471 */ + 0x8e41ade9fbebc27d, /* 510: 1.0e+162 >> 475 */ + 0xb1d219647ae6b31c, /* 511: 1.0e+163 >> 478 */ + 0xde469fbd99a05fe3, /* 512: 1.0e+164 >> 481 */ + 0x8aec23d680043bee, /* 513: 1.0e+165 >> 485 */ + 0xada72ccc20054ae9, /* 514: 1.0e+166 >> 488 */ + 0xd910f7ff28069da4, /* 515: 1.0e+167 >> 491 */ + 0x87aa9aff79042286, /* 516: 1.0e+168 >> 495 */ + 0xa99541bf57452b28, /* 517: 1.0e+169 >> 498 */ + 0xd3fa922f2d1675f2, /* 518: 1.0e+170 >> 501 */ + 0x847c9b5d7c2e09b7, /* 519: 1.0e+171 >> 505 */ + 0xa59bc234db398c25, /* 520: 1.0e+172 >> 508 */ + 0xcf02b2c21207ef2e, /* 521: 1.0e+173 >> 511 */ + 0x8161afb94b44f57d, /* 522: 1.0e+174 >> 515 */ + 0xa1ba1ba79e1632dc, /* 523: 1.0e+175 >> 518 */ + 0xca28a291859bbf93, /* 524: 1.0e+176 >> 521 */ + 0xfcb2cb35e702af78, /* 525: 1.0e+177 >> 524 */ + 0x9defbf01b061adab, /* 526: 1.0e+178 >> 528 */ + 0xc56baec21c7a1916, /* 527: 1.0e+179 >> 531 */ + 0xf6c69a72a3989f5b, /* 528: 1.0e+180 >> 534 */ + 0x9a3c2087a63f6399, /* 529: 1.0e+181 >> 538 */ + 0xc0cb28a98fcf3c7f, /* 530: 1.0e+182 >> 541 */ + 0xf0fdf2d3f3c30b9f, /* 531: 1.0e+183 >> 544 */ + 0x969eb7c47859e743, /* 532: 1.0e+184 >> 548 */ + 0xbc4665b596706114, /* 533: 1.0e+185 >> 551 */ + 0xeb57ff22fc0c7959, /* 534: 1.0e+186 >> 554 */ + 0x9316ff75dd87cbd8, /* 535: 1.0e+187 >> 558 */ + 0xb7dcbf5354e9bece, /* 536: 1.0e+188 >> 561 */ + 0xe5d3ef282a242e81, /* 537: 1.0e+189 >> 564 */ + 0x8fa475791a569d10, /* 538: 1.0e+190 >> 568 */ + 0xb38d92d760ec4455, /* 539: 1.0e+191 >> 571 */ + 0xe070f78d3927556a, /* 540: 1.0e+192 >> 574 */ + 0x8c469ab843b89562, /* 541: 1.0e+193 >> 578 */ + 0xaf58416654a6babb, /* 542: 1.0e+194 >> 581 */ + 0xdb2e51bfe9d0696a, /* 543: 1.0e+195 >> 584 */ + 0x88fcf317f22241e2, /* 544: 1.0e+196 >> 588 */ + 0xab3c2fddeeaad25a, /* 545: 1.0e+197 >> 591 */ + 0xd60b3bd56a5586f1, /* 546: 1.0e+198 >> 594 */ + 0x85c7056562757456, /* 547: 1.0e+199 >> 598 */ + 0xa738c6bebb12d16c, /* 548: 1.0e+200 >> 601 */ + 0xd106f86e69d785c7, /* 549: 1.0e+201 >> 604 */ + 0x82a45b450226b39c, /* 550: 1.0e+202 >> 608 */ + 0xa34d721642b06084, /* 551: 1.0e+203 >> 611 */ + 0xcc20ce9bd35c78a5, /* 552: 1.0e+204 >> 614 */ + 0xff290242c83396ce, /* 553: 1.0e+205 >> 617 */ + 0x9f79a169bd203e41, /* 554: 1.0e+206 >> 621 */ + 0xc75809c42c684dd1, /* 555: 1.0e+207 >> 624 */ + 0xf92e0c3537826145, /* 556: 1.0e+208 >> 627 */ + 0x9bbcc7a142b17ccb, /* 557: 1.0e+209 >> 631 */ + 0xc2abf989935ddbfe, /* 558: 1.0e+210 >> 634 */ + 0xf356f7ebf83552fe, /* 559: 1.0e+211 >> 637 */ + 0x98165af37b2153de, /* 560: 1.0e+212 >> 641 */ + 0xbe1bf1b059e9a8d6, /* 561: 1.0e+213 >> 644 */ + 0xeda2ee1c7064130c, /* 562: 1.0e+214 >> 647 */ + 0x9485d4d1c63e8be7, /* 563: 1.0e+215 >> 651 */ + 0xb9a74a0637ce2ee1, /* 564: 1.0e+216 >> 654 */ + 0xe8111c87c5c1ba99, /* 565: 1.0e+217 >> 657 */ + 0x910ab1d4db9914a0, /* 566: 1.0e+218 >> 661 */ + 0xb54d5e4a127f59c8, /* 567: 1.0e+219 >> 664 */ + 0xe2a0b5dc971f303a, /* 568: 1.0e+220 >> 667 */ + 0x8da471a9de737e24, /* 569: 1.0e+221 >> 671 */ + 0xb10d8e1456105dad, /* 570: 1.0e+222 >> 674 */ + 0xdd50f1996b947518, /* 571: 1.0e+223 >> 677 */ + 0x8a5296ffe33cc92f, /* 572: 1.0e+224 >> 681 */ + 0xace73cbfdc0bfb7b, /* 573: 1.0e+225 >> 684 */ + 0xd8210befd30efa5a, /* 574: 1.0e+226 >> 687 */ + 0x8714a775e3e95c78, /* 575: 1.0e+227 >> 691 */ + 0xa8d9d1535ce3b396, /* 576: 1.0e+228 >> 694 */ + 0xd31045a8341ca07c, /* 577: 1.0e+229 >> 697 */ + 0x83ea2b892091e44d, /* 578: 1.0e+230 >> 701 */ + 0xa4e4b66b68b65d60, /* 579: 1.0e+231 >> 704 */ + 0xce1de40642e3f4b9, /* 580: 1.0e+232 >> 707 */ + 0x80d2ae83e9ce78f3, /* 581: 1.0e+233 >> 711 */ + 0xa1075a24e4421730, /* 582: 1.0e+234 >> 714 */ + 0xc94930ae1d529cfc, /* 583: 1.0e+235 >> 717 */ + 0xfb9b7cd9a4a7443c, /* 584: 1.0e+236 >> 720 */ + 0x9d412e0806e88aa5, /* 585: 1.0e+237 >> 724 */ + 0xc491798a08a2ad4e, /* 586: 1.0e+238 >> 727 */ + 0xf5b5d7ec8acb58a2, /* 587: 1.0e+239 >> 730 */ + 0x9991a6f3d6bf1765, /* 588: 1.0e+240 >> 734 */ + 0xbff610b0cc6edd3f, /* 589: 1.0e+241 >> 737 */ + 0xeff394dcff8a948e, /* 590: 1.0e+242 >> 740 */ + 0x95f83d0a1fb69cd9, /* 591: 1.0e+243 >> 744 */ + 0xbb764c4ca7a4440f, /* 592: 1.0e+244 >> 747 */ + 0xea53df5fd18d5513, /* 593: 1.0e+245 >> 750 */ + 0x92746b9be2f8552c, /* 594: 1.0e+246 >> 754 */ + 0xb7118682dbb66a77, /* 595: 1.0e+247 >> 757 */ + 0xe4d5e82392a40515, /* 596: 1.0e+248 >> 760 */ + 0x8f05b1163ba6832d, /* 597: 1.0e+249 >> 764 */ + 0xb2c71d5bca9023f8, /* 598: 1.0e+250 >> 767 */ + 0xdf78e4b2bd342cf6, /* 599: 1.0e+251 >> 770 */ + 0x8bab8eefb6409c1a, /* 600: 1.0e+252 >> 774 */ + 0xae9672aba3d0c320, /* 601: 1.0e+253 >> 777 */ + 0xda3c0f568cc4f3e8, /* 602: 1.0e+254 >> 780 */ + 0x8865899617fb1871, /* 603: 1.0e+255 >> 784 */ + 0xaa7eebfb9df9de8d, /* 604: 1.0e+256 >> 787 */ + 0xd51ea6fa85785631, /* 605: 1.0e+257 >> 790 */ + 0x8533285c936b35de, /* 606: 1.0e+258 >> 794 */ + 0xa67ff273b8460356, /* 607: 1.0e+259 >> 797 */ + 0xd01fef10a657842c, /* 608: 1.0e+260 >> 800 */ + 0x8213f56a67f6b29b, /* 609: 1.0e+261 >> 804 */ + 0xa298f2c501f45f42, /* 610: 1.0e+262 >> 807 */ + 0xcb3f2f7642717713, /* 611: 1.0e+263 >> 810 */ + 0xfe0efb53d30dd4d7, /* 612: 1.0e+264 >> 813 */ + 0x9ec95d1463e8a506, /* 613: 1.0e+265 >> 817 */ + 0xc67bb4597ce2ce48, /* 614: 1.0e+266 >> 820 */ + 0xf81aa16fdc1b81da, /* 615: 1.0e+267 >> 823 */ + 0x9b10a4e5e9913128, /* 616: 1.0e+268 >> 827 */ + 0xc1d4ce1f63f57d72, /* 617: 1.0e+269 >> 830 */ + 0xf24a01a73cf2dccf, /* 618: 1.0e+270 >> 833 */ + 0x976e41088617ca01, /* 619: 1.0e+271 >> 837 */ + 0xbd49d14aa79dbc82, /* 620: 1.0e+272 >> 840 */ + 0xec9c459d51852ba2, /* 621: 1.0e+273 >> 843 */ + 0x93e1ab8252f33b45, /* 622: 1.0e+274 >> 847 */ + 0xb8da1662e7b00a17, /* 623: 1.0e+275 >> 850 */ + 0xe7109bfba19c0c9d, /* 624: 1.0e+276 >> 853 */ + 0x906a617d450187e2, /* 625: 1.0e+277 >> 857 */ + 0xb484f9dc9641e9da, /* 626: 1.0e+278 >> 860 */ + 0xe1a63853bbd26451, /* 627: 1.0e+279 >> 863 */ + 0x8d07e33455637eb2, /* 628: 1.0e+280 >> 867 */ + 0xb049dc016abc5e5f, /* 629: 1.0e+281 >> 870 */ + 0xdc5c5301c56b75f7, /* 630: 1.0e+282 >> 873 */ + 0x89b9b3e11b6329ba, /* 631: 1.0e+283 >> 877 */ + 0xac2820d9623bf429, /* 632: 1.0e+284 >> 880 */ + 0xd732290fbacaf133, /* 633: 1.0e+285 >> 883 */ + 0x867f59a9d4bed6c0, /* 634: 1.0e+286 >> 887 */ + 0xa81f301449ee8c70, /* 635: 1.0e+287 >> 890 */ + 0xd226fc195c6a2f8c, /* 636: 1.0e+288 >> 893 */ + 0x83585d8fd9c25db7, /* 637: 1.0e+289 >> 897 */ + 0xa42e74f3d032f525, /* 638: 1.0e+290 >> 900 */ + 0xcd3a1230c43fb26f, /* 639: 1.0e+291 >> 903 */ + 0x80444b5e7aa7cf85, /* 640: 1.0e+292 >> 907 */ + 0xa0555e361951c366, /* 641: 1.0e+293 >> 910 */ + 0xc86ab5c39fa63440, /* 642: 1.0e+294 >> 913 */ + 0xfa856334878fc150, /* 643: 1.0e+295 >> 916 */ + 0x9c935e00d4b9d8d2, /* 644: 1.0e+296 >> 920 */ + 0xc3b8358109e84f07, /* 645: 1.0e+297 >> 923 */ + 0xf4a642e14c6262c8, /* 646: 1.0e+298 >> 926 */ + 0x98e7e9cccfbd7dbd, /* 647: 1.0e+299 >> 930 */ + 0xbf21e44003acdd2c, /* 648: 1.0e+300 >> 933 */ + 0xeeea5d5004981478, /* 649: 1.0e+301 >> 936 */ + 0x95527a5202df0ccb, /* 650: 1.0e+302 >> 940 */ + 0xbaa718e68396cffd, /* 651: 1.0e+303 >> 943 */ + 0xe950df20247c83fd, /* 652: 1.0e+304 >> 946 */ + 0x91d28b7416cdd27e, /* 653: 1.0e+305 >> 950 */ + 0xb6472e511c81471d, /* 654: 1.0e+306 >> 953 */ + 0xe3d8f9e563a198e5, /* 655: 1.0e+307 >> 956 */ + 0x8e679c2f5e44ff8f, /* 656: 1.0e+308 >> 960 */ + 0xb201833b35d63f73, /* 657: 1.0e+309 >> 963 */ + 0xde81e40a034bcf4f, /* 658: 1.0e+310 >> 966 */ + 0x8b112e86420f6191, /* 659: 1.0e+311 >> 970 */ + 0xadd57a27d29339f6, /* 660: 1.0e+312 >> 973 */ + 0xd94ad8b1c7380874, /* 661: 1.0e+313 >> 976 */ + 0x87cec76f1c830548, /* 662: 1.0e+314 >> 980 */ + 0xa9c2794ae3a3c69a, /* 663: 1.0e+315 >> 983 */ + 0xd433179d9c8cb841, /* 664: 1.0e+316 >> 986 */ + 0x849feec281d7f328, /* 665: 1.0e+317 >> 990 */ + 0xa5c7ea73224deff3, /* 666: 1.0e+318 >> 993 */ + 0xcf39e50feae16bef, /* 667: 1.0e+319 >> 996 */ + 0x81842f29f2cce375, /* 668: 1.0e+320 >> 1000 */ + 0xa1e53af46f801c53, /* 669: 1.0e+321 >> 1003 */ + 0xca5e89b18b602368, /* 670: 1.0e+322 >> 1006 */ + 0xfcf62c1dee382c42, /* 671: 1.0e+323 >> 1009 */ + 0x9e19db92b4e31ba9, /* 672: 1.0e+324 >> 1013 */ + 0xc5a05277621be293, /* 673: 1.0e+325 >> 1016 */ + 0xf70867153aa2db38, /* 674: 1.0e+326 >> 1019 */ + 0x9a65406d44a5c903, /* 675: 1.0e+327 >> 1023 */ + 0xc0fe908895cf3b44, /* 676: 1.0e+328 >> 1026 */ + 0xf13e34aabb430a15, /* 677: 1.0e+329 >> 1029 */ + 0x96c6e0eab509e64d, /* 678: 1.0e+330 >> 1033 */ + 0xbc789925624c5fe0, /* 679: 1.0e+331 >> 1036 */ + 0xeb96bf6ebadf77d8, /* 680: 1.0e+332 >> 1039 */ + 0x933e37a534cbaae7, /* 681: 1.0e+333 >> 1043 */ + 0xb80dc58e81fe95a1, /* 682: 1.0e+334 >> 1046 */ + 0xe61136f2227e3b09, /* 683: 1.0e+335 >> 1049 */ + 0x8fcac257558ee4e6, /* 684: 1.0e+336 >> 1053 */ + 0xb3bd72ed2af29e1f, /* 685: 1.0e+337 >> 1056 */ + 0xe0accfa875af45a7, /* 686: 1.0e+338 >> 1059 */ + 0x8c6c01c9498d8b88, /* 687: 1.0e+339 >> 1063 */ + 0xaf87023b9bf0ee6a, /* 688: 1.0e+340 >> 1066 */ + 0xdb68c2ca82ed2a05, /* 689: 1.0e+341 >> 1069 */ + 0x892179be91d43a43, /* 690: 1.0e+342 >> 1073 */ + 0xab69d82e364948d4, /* 691: 1.0e+343 >> 1076 */ + 0xd6444e39c3db9b09, /* 692: 1.0e+344 >> 1079 */ + 0x85eab0e41a6940e5, /* 693: 1.0e+345 >> 1083 */ + 0xa7655d1d2103911f, /* 694: 1.0e+346 >> 1086 */ + 0xd13eb46469447567, /* 695: 1.0e+347 >> 1089 */ +}; +#define POWERSOF10_FIRST (-348) +#define POWERSOF10_LAST (+347) +#define POWERSOF10_COUNT (696) + +/* +** Two inputs are multiplied to get a 128-bit result. Return +** the high-order 64 bits of that result. +*/ +static u64 sqlite3Multiply128(u64 a, u64 b){ +#if (defined(__GNUC__) || defined(__clang__)) \ + && (defined(__x86_64__) || defined(__aarch64__) || defined(__riscv)) + return ((__uint128_t)a * b) >> 64; +#elif defined(_MSC_VER) && defined(_M_X64) + return __umulh(a, b); +#else + u32 a1 = (u32)a; + u32 a2 = a >> 32; + u32 b1 = (u32)b; + u32 b2 = b >> 32; + u32 p0 = a1 * b1; + u32 p1 = a1 * b2; + u32 p2 = a2 * b1; + u32 p3 = a2 * b2; + u32 mid = p1 + (p0 >> 32); + mid += p2; + u32 carry = (mid < p2) ? 1 : 0; + return p3 + (mid >> 32) + carry; +#endif +} -/* Double-Double multiplication. (x[0],x[1]) *= (y,yy) +/* +** pow10to2(x) computes floor(log2(pow(10,x))). +** pow2to10(y) computes floor(log10(pow(2,y))). +** +** Conceptually, pow10to2(p) converts a base-10 exponent p into +** a corresponding base-2 exponent, and pow2to10(e) converts a base-2 +** exponent into a base-10 exponent. +** +** The conversions are based on the observation that: ** -** Reference: -** T. J. Dekker, "A Floating-Point Technique for Extending the -** Available Precision". 1971-07-26. +** ln(10.0)/ln(2.0) == 108853/32768 (approximately) +** ln(2.0)/ln(10.0) == 78913/262144 (approximately) +** +** These ratios are approximate, but they are accurate to 5 digits, +** which is close enough for the usage here. Right-shift is used +** for division so that rounding of negative numbers happens in the +** right direction. */ -static void dekkerMul2(volatile double *x, double y, double yy){ - /* - ** The "volatile" keywords on parameter x[] and on local variables - ** below are needed force intermediate results to be truncated to - ** binary64 rather than be carried around in an extended-precision - ** format. The truncation is necessary for the Dekker algorithm to - ** work. Intel x86 floating point might omit the truncation without - ** the use of volatile. - */ - volatile double tx, ty, p, q, c, cc; - double hx, hy; - u64 m; - memcpy(&m, (void*)&x[0], 8); - m &= 0xfffffffffc000000LL; - memcpy(&hx, &m, 8); - tx = x[0] - hx; - memcpy(&m, &y, 8); - m &= 0xfffffffffc000000LL; - memcpy(&hy, &m, 8); - ty = y - hy; - p = hx*hy; - q = hx*ty + tx*hy; - c = p+q; - cc = p - c + q + tx*ty; - cc = x[0]*yy + x[1]*y + cc; - x[0] = c + cc; - x[1] = c - x[0]; - x[1] += cc; +static int pwr10to2(int p){ return (p*108853) >> 15; } +static int pwr2to10(int p){ return (p*78913) >> 18; } + +/* +** Return a u64 with the N-th bit set. +*/ +#define U64_BIT(N) (((u64)1)<<(N)) + +/* +** Count leading zeros for a 64-bit unsigned integer. +*/ +static int countLeadingZeros(u64 m){ +#if defined(__GNUC__) || defined(__clang__) + return __builtin_clzll(m); +#else + int n = 0; + if( m <= 0x00000000ffffffffULL) { n += 32; m <<= 32; } + if( m <= 0x0000ffffffffffffULL) { n += 16; m <<= 16; } + if( m <= 0x00ffffffffffffffULL) { n += 8; m <<= 8; } + if( m <= 0x0fffffffffffffffULL) { n += 4; m <<= 4; } + if( m <= 0x3fffffffffffffffULL) { n += 2; m <<= 2; } + if( m <= 0x7fffffffffffffffULL) { n += 1; } + return n; +#endif +} + +/* +** Given m and e, which represent a quantity r == m*pow(2,e), +** return values *pD and *pP such that r == (*pD)*pow(10,*pP), +** approximately. *pD should contain at least n significant digits. +** +** The input m is required to have its highest bit set. In other words, +** m should be left-shifted, and e decremented, to maximize the value of m. +*/ +static void sqlite3Fp2Convert10(u64 m, int e, int n, u64 *pD, int *pP){ + int p, idx; + u64 h, out; + p = n - 1 - pwr2to10(e+63); + idx = p - POWERSOF10_FIRST; + h = sqlite3Multiply128(m, sqlite3PowerOfTen[idx]); + assert( -(e + pwr10to2(p) + 3) >=0 ); + assert( -(e + pwr10to2(p) + 3) <64 ); + out = h >> -(e + pwr10to2(p) + 3); + *pD = (out + 2 + ((out>>2)&1)) >> 2; + *pP = -p; +} + +/* +** Return an IEEE754 floating point value that approximates d*pow(10,p). +** +** The "d" value must not have its most significant bit set. +*/ +static double sqlite3Fp10Convert2(u64 d, int p){ + u64 out; + int b; + int e1; + int e2; + int lp; + int idx; + u64 h; + double r; + if( pPOWERSOF10_LAST ){ + return INFINITY; + } + b = 64 - countLeadingZeros(d); + lp = pwr10to2(p); + e1 = 53 - b - lp; + if( e1>1074 ){ + if( -(b + lp) >= 1077 ) return 0.0; + e1 = 1074; + } + e2 = e1 - (64-b); + idx = p - POWERSOF10_FIRST; + h = sqlite3Multiply128(d<<(64-b), sqlite3PowerOfTen[idx]); + assert( -(e2 + lp + 3) >=0 ); + assert( -(e2 + lp + 3) <64 ); + out = (h >> -(e2 + lp + 3)) | 1; + if( out >= U64_BIT(55)-2 ){ + out = (out>>1) | (out&1); + e1--; + } + if( e1<=(-972) ){ + return INFINITY; + } + out = (out + 1 + ((out>>2)&1)) >> 2; + if( (out & U64_BIT(52))!=0 ){ + out = (out & ~U64_BIT(52)) | ((u64)(1075-e1)<<52); + } + memcpy(&r, &out, 8); + return r; } /* @@ -539,8 +1348,6 @@ int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){ int eValid = 1; /* True exponent is either not used or is well-formed */ int nDigit = 0; /* Number of digits processed */ int eType = 1; /* 1: pure integer, 2+: fractional -1 or less: bad UTF16 */ - u64 s2; /* round-tripped significand */ - double rr[2]; assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE ); *pResult = 0.0; /* Default return value, in case of an error */ @@ -578,7 +1385,7 @@ int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){ while( z=((LARGEST_UINT64-9)/10) ){ + if( s>=((LARGEST_INT64-9)/10) ){ /* skip non-significant significand digits ** (increase exponent by d to shift decimal left) */ while( z0 && s<((LARGEST_UINT64-0x7ff)/10) ){ - s *= 10; - e--; - } - while( e<0 && (s%10)==0 ){ - s /= 10; - e++; - } - - rr[0] = (double)s; - assert( sizeof(s2)==sizeof(rr[0]) ); -#ifdef SQLITE_DEBUG - rr[1] = 18446744073709549568.0; - memcpy(&s2, &rr[1], sizeof(s2)); - assert( s2==0x43efffffffffffffLL ); -#endif - /* Largest double that can be safely converted to u64 - ** vvvvvvvvvvvvvvvvvvvvvv */ - if( rr[0]<=18446744073709549568.0 ){ - s2 = (u64)rr[0]; - rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s); - }else{ - rr[1] = 0.0; - } - assert( rr[1]<=1.0e-10*rr[0] ); /* Equal only when rr[0]==0.0 */ - - if( e>0 ){ - while( e>=100 ){ - e -= 100; - dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83); - } - while( e>=10 ){ - e -= 10; - dekkerMul2(rr, 1.0e+10, 0.0); - } - while( e>=1 ){ - e -= 1; - dekkerMul2(rr, 1.0e+01, 0.0); - } - }else{ - while( e<=-100 ){ - e += 100; - dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117); - } - while( e<=-10 ){ - e += 10; - dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27); - } - while( e<=-1 ){ - e += 1; - dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18); - } - } - *pResult = rr[0]+rr[1]; - if( sqlite3IsNaN(*pResult) ) *pResult = 1e300*1e300; + *pResult = sqlite3Fp10Convert2(s,e); if( sign<0 ) *pResult = -*pResult; assert( !sqlite3IsNaN(*pResult) ); @@ -1018,7 +1770,6 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ int i; u64 v; int e, exp = 0; - double rr[2]; p->isSpecial = 0; p->z = p->zBuf; @@ -1039,55 +1790,23 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ p->sign = '+'; } memcpy(&v,&r,8); - e = v>>52; - if( (e&0x7ff)==0x7ff ){ + e = (v>>52)&0x7ff; + if( e==0x7ff ){ p->isSpecial = 1 + (v!=0x7ff0000000000000LL); p->n = 0; p->iDP = 0; return; } - - /* Multiply r by powers of ten until it lands somewhere in between - ** 1.0e+19 and 1.0e+17. - ** - ** Use Dekker-style double-double computation to increase the - ** precision. - ** - ** The error terms on constants like 1.0e+100 computed using the - ** decimal extension, for example as follows: - ** - ** SELECT decimal_exp(decimal_sub('1.0e+100',decimal(1.0e+100))); - */ - rr[0] = r; - rr[1] = 0.0; - if( rr[0]>9.223372036854774784e+18 ){ - while( rr[0]>9.223372036854774784e+118 ){ - exp += 100; - dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117); - } - while( rr[0]>9.223372036854774784e+28 ){ - exp += 10; - dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27); - } - while( rr[0]>9.223372036854774784e+18 ){ - exp += 1; - dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18); - } + v &= 0x000fffffffffffffULL; + if( e==0 ){ + int n = countLeadingZeros(v); + v <<= n; + e = -1074 - n; }else{ - while( rr[0]<9.223372036854774784e-83 ){ - exp -= 100; - dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83); - } - while( rr[0]<9.223372036854774784e+07 ){ - exp -= 10; - dekkerMul2(rr, 1.0e+10, 0.0); - } - while( rr[0]<9.22337203685477478e+17 ){ - exp -= 1; - dekkerMul2(rr, 1.0e+01, 0.0); - } + v = (v<<11) | U64_BIT(63); + e -= 1086; } - v = rr[1]<0.0 ? (u64)rr[0]-(u64)(-rr[1]) : (u64)rr[0]+(u64)rr[1]; + sqlite3Fp2Convert10(v, e, 17, &v, &exp); /* Extract significant digits. */ i = sizeof(p->zBuf)-1; -- 2.47.3