format: Add errol3 lookup
This commit is contained in:
parent
24056d53c5
commit
a5b84deca7
@ -1423,6 +1423,497 @@ do
|
||||
}
|
||||
}
|
||||
|
||||
private char[] errol3(double value,
|
||||
return ref char[512] buffer,
|
||||
out int exponent) @nogc nothrow pure @safe
|
||||
{
|
||||
static struct Pathology
|
||||
{
|
||||
ulong representation;
|
||||
string digits;
|
||||
int exponent;
|
||||
}
|
||||
|
||||
static immutable Pathology[432] pathologies = [
|
||||
{ 0x001d243f646eaf51, "40526371999771488", -307 },
|
||||
{ 0x002d243f646eaf51, "81052743999542975", -307 },
|
||||
{ 0x00ab7aa3d73f6658, "1956574196882425", -304 },
|
||||
{ 0x00bb7aa3d73f6658, "391314839376485", -304 },
|
||||
{ 0x00cb7aa3d73f6658, "78262967875297", -304 },
|
||||
{ 0x00f5d15b26b80e30, "4971131903427841", -303 },
|
||||
{ 0x010b7aa3d73f6658, "1252207486004752", -302 },
|
||||
{ 0x011b7aa3d73f6658, "2504414972009504", -302 },
|
||||
{ 0x012b7aa3d73f6658, "5008829944019008", -302 },
|
||||
{ 0x0180a0f3c55062c5, "19398723835545928", -300 },
|
||||
{ 0x0180a0f3c55062c6, "1939872383554593", -300 },
|
||||
{ 0x0190a0f3c55062c5, "38797447671091856", -300 },
|
||||
{ 0x0190a0f3c55062c6, "3879744767109186", -300 },
|
||||
{ 0x01f393b456eef178, "29232758945460627", -298 },
|
||||
{ 0x03719f08ccdccfe5, "44144884605471774", -291 },
|
||||
{ 0x037be9d5a60850b5, "69928982131052126", -291 },
|
||||
{ 0x03dc25ba6a45de02, "45129663866844427", -289 },
|
||||
{ 0x05798e3445512a6e, "27497183057384368", -281 },
|
||||
{ 0x05798e3445512a6f, "2749718305738437", -281 },
|
||||
{ 0x05898e3445512a6e, "54994366114768736", -281 },
|
||||
{ 0x05898e3445512a6f, "5499436611476874", -281 },
|
||||
{ 0x06afdadafcacdf85, "17970091719480621", -275 },
|
||||
{ 0x06bfdadafcacdf85, "35940183438961242", -275 },
|
||||
{ 0x06ceb7f2c53db97f, "69316187906522606", -275 },
|
||||
{ 0x06cfdadafcacdf85, "71880366877922484", -275 },
|
||||
{ 0x06e8b03fd6894b66, "22283747288943228", -274 },
|
||||
{ 0x06f8b03fd6894b66, "44567494577886457", -274 },
|
||||
{ 0x07bfe89cf1bd76ac, "23593494977819109", -270 },
|
||||
{ 0x07c1707c02068785, "25789638850173173", -270 },
|
||||
{ 0x07cfe89cf1bd76ac, "47186989955638217", -270 },
|
||||
{ 0x08567a3c8dc4bc9c, "17018905290641991", -267 },
|
||||
{ 0x08667a3c8dc4bc9c, "34037810581283983", -267 },
|
||||
{ 0x089c25584881552a, "3409719593752201", -266 },
|
||||
{ 0x08ac25584881552a, "6819439187504402", -266 },
|
||||
{ 0x08dfa7ebe304ee3d, "6135911659254281", -265 },
|
||||
{ 0x08dfa7ebe304ee3e, "61359116592542813", -265 },
|
||||
{ 0x096822507db6a8fd, "23951010625355228", -262 },
|
||||
{ 0x097822507db6a8fd, "47902021250710456", -262 },
|
||||
{ 0x09e41934d77659be, "51061856989121905", -260 },
|
||||
{ 0x0b8f3d82e9356287, "53263359599109627", -252 },
|
||||
{ 0x0c27b35936d56e27, "4137829457097561", -249 },
|
||||
{ 0x0c27b35936d56e28, "41378294570975613", -249 },
|
||||
{ 0x0c43165633977bc9, "13329597309520689", -248 },
|
||||
{ 0x0c43165633977bca, "1332959730952069", -248 },
|
||||
{ 0x0c53165633977bc9, "26659194619041378", -248 },
|
||||
{ 0x0c53165633977bca, "2665919461904138", -248 },
|
||||
{ 0x0c63165633977bc9, "53318389238082755", -248 },
|
||||
{ 0x0c63165633977bca, "5331838923808276", -248 },
|
||||
{ 0x0c7e9eddbbb259b4, "1710711888535566", -247 },
|
||||
{ 0x0c8e9eddbbb259b4, "3421423777071132", -247 },
|
||||
{ 0x0c9e9eddbbb259b4, "6842847554142264", -247 },
|
||||
{ 0x0e104273b18918b0, "6096109271490509", -240 },
|
||||
{ 0x0e104273b18918b1, "609610927149051", -240 },
|
||||
{ 0x0e204273b18918b0, "12192218542981019", -239 },
|
||||
{ 0x0e204273b18918b1, "1219221854298102", -239 },
|
||||
{ 0x0e304273b18918b0, "24384437085962037", -239 },
|
||||
{ 0x0e304273b18918b1, "2438443708596204", -239 },
|
||||
{ 0x0f1d16d6d4b89689, "7147520638007367", -235 },
|
||||
{ 0x0fd6ba8608faa6a8, "2287474118824999", -231 },
|
||||
{ 0x0fd6ba8608faa6a9, "22874741188249992", -231 },
|
||||
{ 0x0fe6ba8608faa6a8, "4574948237649998", -231 },
|
||||
{ 0x0fe6ba8608faa6a9, "45749482376499984", -231 },
|
||||
{ 0x1006b100e18e5c17, "18269851255456139", -230 },
|
||||
{ 0x1016b100e18e5c17, "36539702510912277", -230 },
|
||||
{ 0x104f48347c60a1be, "40298468695006992", -229 },
|
||||
{ 0x105f48347c60a1be, "80596937390013985", -229 },
|
||||
{ 0x10a4139a6b17b224, "16552474403007851", -227 },
|
||||
{ 0x10b4139a6b17b224, "33104948806015703", -227 },
|
||||
{ 0x12cb91d317c8ebe9, "39050270537318193", -217 },
|
||||
{ 0x13627383c5456c5e, "26761990828289327", -214 },
|
||||
{ 0x138fb24e492936f6, "1838927069906671", -213 },
|
||||
{ 0x139fb24e492936f6, "3677854139813342", -213 },
|
||||
{ 0x13afb24e492936f6, "7355708279626684", -213 },
|
||||
{ 0x13f93bb1e72a2033, "18738512510673039", -211 },
|
||||
{ 0x14093bb1e72a2033, "37477025021346077", -211 },
|
||||
{ 0x1466cc4fc92a0fa6, "21670630627577332", -209 },
|
||||
{ 0x1476cc4fc92a0fa6, "43341261255154663", -209 },
|
||||
{ 0x148048cb468bc208, "619160875073638", -209 },
|
||||
{ 0x149048cb468bc209, "12383217501472761", -208 },
|
||||
{ 0x14a048cb468bc209, "24766435002945523", -208 },
|
||||
{ 0x1504c0b3a63c1444, "2019986500244655", -206 },
|
||||
{ 0x1514c0b3a63c1444, "403997300048931", -206 },
|
||||
{ 0x161ba6008389068a, "35273912934356928", -201 },
|
||||
{ 0x162ba6008389068a, "70547825868713855", -201 },
|
||||
{ 0x168cfab1a09b49c4, "47323883490786093", -199 },
|
||||
{ 0x175090684f5fe997, "22159015457577768", -195 },
|
||||
{ 0x175090684f5fe998, "2215901545757777", -195 },
|
||||
{ 0x176090684f5fe997, "44318030915155535", -195 },
|
||||
{ 0x176090684f5fe998, "4431803091515554", -195 },
|
||||
{ 0x17e4116d591ef1fb, "13745435592982211", -192 },
|
||||
{ 0x17f4116d591ef1fb, "27490871185964422", -192 },
|
||||
{ 0x1804116d591ef1fb, "54981742371928845", -192 },
|
||||
{ 0x18a710b7a2ef18b7, "64710073234908765", -189 },
|
||||
{ 0x18cde996371c6060, "33567940583589088", -188 },
|
||||
{ 0x18d99fccca44882a, "57511323531737074", -188 },
|
||||
{ 0x18dde996371c6060, "67135881167178176", -188 },
|
||||
{ 0x199a2cf604c30d3f, "2406355597625261", -184 },
|
||||
{ 0x19aa2cf604c30d3f, "4812711195250522", -184 },
|
||||
{ 0x1b5ebddc6593c857, "75862936714499446", -176 },
|
||||
{ 0x1c513770474911bd, "27843818440071113", -171 },
|
||||
{ 0x1d1b1ad9101b1bfd, "1795518315109779", -167 },
|
||||
{ 0x1d2b1ad9101b1bfd, "3591036630219558", -167 },
|
||||
{ 0x1d3b1ad9101b1bfd, "7182073260439116", -167 },
|
||||
{ 0x1e3035e7b5183922, "28150140033551147", -162 },
|
||||
{ 0x1e4035e7b5183923, "563002800671023", -162 },
|
||||
{ 0x1e5035e7b5183923, "1126005601342046", -161 },
|
||||
{ 0x1e6035e7b5183923, "2252011202684092", -161 },
|
||||
{ 0x1e7035e7b5183923, "4504022405368184", -161 },
|
||||
{ 0x1fd5a79c4e71d028, "2523567903248961", -154 },
|
||||
{ 0x1fe5a79c4e71d028, "5047135806497922", -154 },
|
||||
{ 0x20cc29bc6879dfcd, "10754533488024391", -149 },
|
||||
{ 0x20dc29bc6879dfcd, "21509066976048781", -149 },
|
||||
{ 0x20e8823a57adbef8, "37436263604934127", -149 },
|
||||
{ 0x20ec29bc6879dfcd, "43018133952097563", -149 },
|
||||
{ 0x2104dab846e19e25, "1274175730310828", -148 },
|
||||
{ 0x2114dab846e19e25, "2548351460621656", -148 },
|
||||
{ 0x2124dab846e19e25, "5096702921243312", -148 },
|
||||
{ 0x218ce77c2b3328fb, "45209911804158747", -146 },
|
||||
{ 0x220ce77c2b3328fb, "11573737421864639", -143 },
|
||||
{ 0x220ce77c2b3328fc, "1157373742186464", -143 },
|
||||
{ 0x221ce77c2b3328fb, "23147474843729279", -143 },
|
||||
{ 0x221ce77c2b3328fc, "2314747484372928", -143 },
|
||||
{ 0x222ce77c2b3328fb, "46294949687458557", -143 },
|
||||
{ 0x222ce77c2b3328fc, "4629494968745856", -143 },
|
||||
{ 0x229197b290631476, "36067106647774144", -141 },
|
||||
{ 0x233f346f9ed36b89, "65509428048152994", -138 },
|
||||
{ 0x240a28877a09a4e0, "44986453555921307", -134 },
|
||||
{ 0x240a28877a09a4e1, "4498645355592131", -134 },
|
||||
{ 0x243441ed79830181, "27870735485790148", -133 },
|
||||
{ 0x243441ed79830182, "2787073548579015", -133 },
|
||||
{ 0x244441ed79830181, "55741470971580295", -133 },
|
||||
{ 0x244441ed79830182, "557414709715803", -133 },
|
||||
{ 0x245441ed79830181, "11148294194316059", -132 },
|
||||
{ 0x245441ed79830182, "1114829419431606", -132 },
|
||||
{ 0x246441ed79830181, "22296588388632118", -132 },
|
||||
{ 0x246441ed79830182, "2229658838863212", -132 },
|
||||
{ 0x247441ed79830181, "44593176777264236", -132 },
|
||||
{ 0x247441ed79830182, "4459317677726424", -132 },
|
||||
{ 0x248b23b50fc204db, "11948502190822011", -131 },
|
||||
{ 0x249b23b50fc204db, "23897004381644022", -131 },
|
||||
{ 0x24ab23b50fc204db, "47794008763288043", -131 },
|
||||
{ 0x2541e4ee41180c0a, "32269008655522087", -128 },
|
||||
{ 0x2633dc6227de9148, "1173600085235347", -123 },
|
||||
{ 0x2643dc6227de9148, "2347200170470694", -123 },
|
||||
{ 0x2653dc6227de9148, "4694400340941388", -123 },
|
||||
{ 0x277aacfcb88c92d6, "16528675364037979", -117 },
|
||||
{ 0x277aacfcb88c92d7, "1652867536403798", -117 },
|
||||
{ 0x278aacfcb88c92d6, "33057350728075958", -117 },
|
||||
{ 0x278aacfcb88c92d7, "3305735072807596", -117 },
|
||||
{ 0x279aacfcb88c92d6, "66114701456151916", -117 },
|
||||
{ 0x279aacfcb88c92d7, "6611470145615192", -117 },
|
||||
{ 0x279b5cd8bbdd8770, "67817280930489786", -117 },
|
||||
{ 0x27bbb4c6bd8601bd, "27467428267063488", -116 },
|
||||
{ 0x27cbb4c6bd8601bd, "54934856534126976", -116 },
|
||||
{ 0x289d52af46e5fa69, "4762882274418243", -112 },
|
||||
{ 0x289d52af46e5fa6a, "47628822744182433", -112 },
|
||||
{ 0x28b04a616046e074, "10584182832040541", -111 },
|
||||
{ 0x28c04a616046e074, "21168365664081082", -111 },
|
||||
{ 0x28d04a616046e074, "42336731328162165", -111 },
|
||||
{ 0x297c2c31a31998ae, "74973710847373845", -108 },
|
||||
{ 0x2a3eeff57768f88c, "33722866731879692", -104 },
|
||||
{ 0x2a4eeff57768f88c, "67445733463759384", -104 },
|
||||
{ 0x2b8e3a0aeed7be19, "69097540994131414", -98 },
|
||||
{ 0x2bdec922478c0421, "22520091703825729", -96 },
|
||||
{ 0x2beec922478c0421, "45040183407651457", -96 },
|
||||
{ 0x2c2379f099a86227, "45590931008842566", -95 },
|
||||
{ 0x2cc7c3fba45c1271, "5696647848853893", -92 },
|
||||
{ 0x2cc7c3fba45c1272, "56966478488538934", -92 },
|
||||
{ 0x2cf4f14348a4c5db, "40159515855058247", -91 },
|
||||
{ 0x2d04f14348a4c5db, "8031903171011649", -91 },
|
||||
{ 0x2d44f14348a4c5db, "12851045073618639", -89 },
|
||||
{ 0x2d44f14348a4c5dc, "1285104507361864", -89 },
|
||||
{ 0x2d54f14348a4c5db, "25702090147237278", -89 },
|
||||
{ 0x2d54f14348a4c5dc, "2570209014723728", -89 },
|
||||
{ 0x2d5a8c931c19b77a, "3258302752792233", -89 },
|
||||
{ 0x2d64f14348a4c5db, "51404180294474556", -89 },
|
||||
{ 0x2d64f14348a4c5dc, "5140418029447456", -89 },
|
||||
{ 0x2d6a8c931c19b77a, "6516605505584466", -89 },
|
||||
{ 0x2efc1249e96b6d8d, "23119896893873391", -81 },
|
||||
{ 0x2f0c1249e96b6d8d, "46239793787746783", -81 },
|
||||
{ 0x2f0f6b23cfe98807, "51753157237874753", -81 },
|
||||
{ 0x2fa387cf9cb4ad4e, "32943123175907307", -78 },
|
||||
{ 0x2fe91b9de4d5cf31, "67761208324172855", -77 },
|
||||
{ 0x3081eab25ad0fcf7, "49514357246452655", -74 },
|
||||
{ 0x308ddc7e975c5045, "8252392874408775", -74 },
|
||||
{ 0x308ddc7e975c5046, "82523928744087755", -74 },
|
||||
{ 0x309ddc7e975c5045, "1650478574881755", -73 },
|
||||
{ 0x30addc7e975c5045, "330095714976351", -73 },
|
||||
{ 0x30bddc7e975c5045, "660191429952702", -73 },
|
||||
{ 0x3149190e30e46c1d, "28409785190323268", -70 },
|
||||
{ 0x3150ed9bd6bfd003, "3832399419240467", -70 },
|
||||
{ 0x3159190e30e46c1d, "56819570380646536", -70 },
|
||||
{ 0x317d2ec75df6ba2a, "26426943389906988", -69 },
|
||||
{ 0x318d2ec75df6ba2a, "52853886779813977", -69 },
|
||||
{ 0x321aedaa0fc32ac8, "2497072464210591", -66 },
|
||||
{ 0x322aedaa0fc32ac8, "4994144928421182", -66 },
|
||||
{ 0x32448050091c3c24, "15208651188557789", -65 },
|
||||
{ 0x32548050091c3c24, "30417302377115577", -65 },
|
||||
{ 0x328f5a18504dfaac, "37213051060716888", -64 },
|
||||
{ 0x329f5a18504dfaac, "74426102121433776", -64 },
|
||||
{ 0x3336dca59d035820, "55574205388093594", -61 },
|
||||
{ 0x33beef5e1f90ac34, "1925091640472375", -58 },
|
||||
{ 0x33ceef5e1f90ac34, "385018328094475", -58 },
|
||||
{ 0x33deef5e1f90ac34, "77003665618895", -58 },
|
||||
{ 0x33eeef5e1f90ac35, "15400733123779001", -57 },
|
||||
{ 0x33feef5e1f90ac35, "30801466247558002", -57 },
|
||||
{ 0x340eef5e1f90ac35, "61602932495116004", -57 },
|
||||
{ 0x341eef5e1f90ac35, "12320586499023201", -56 },
|
||||
{ 0x34228f9edfbd3420, "14784703798827841", -56 },
|
||||
{ 0x342eef5e1f90ac35, "24641172998046401", -56 },
|
||||
{ 0x34328f9edfbd3420, "29569407597655683", -56 },
|
||||
{ 0x343eef5e1f90ac35, "49282345996092803", -56 },
|
||||
{ 0x344eef5e1f90ac35, "9856469199218561", -56 },
|
||||
{ 0x345eef5e1f90ac35, "19712938398437121", -55 },
|
||||
{ 0x346eef5e1f90ac35, "39425876796874242", -55 },
|
||||
{ 0x347eef5e1f90ac35, "78851753593748485", -55 },
|
||||
{ 0x35008621c4199208, "21564764513659432", -52 },
|
||||
{ 0x35108621c4199208, "43129529027318865", -52 },
|
||||
{ 0x35e0ac2e7f90b8a3, "35649516398744314", -48 },
|
||||
{ 0x35ef1de1f7f14439, "66534156679273626", -48 },
|
||||
{ 0x361dde4a4ab13e09, "51091836539008967", -47 },
|
||||
{ 0x366b870de5d93270, "15068094409836911", -45 },
|
||||
{ 0x367b870de5d93270, "30136188819673822", -45 },
|
||||
{ 0x368b870de5d93270, "60272377639347644", -45 },
|
||||
{ 0x375b20c2f4f8d49f, "4865841847892019", -41 },
|
||||
{ 0x375b20c2f4f8d4a0, "48658418478920193", -41 },
|
||||
{ 0x37f25d342b1e33e5, "33729482964455627", -38 },
|
||||
{ 0x3854faba79ea92ec, "24661175471861008", -36 },
|
||||
{ 0x3854faba79ea92ed, "2466117547186101", -36 },
|
||||
{ 0x3864faba79ea92ec, "49322350943722016", -36 },
|
||||
{ 0x3864faba79ea92ed, "4932235094372202", -36 },
|
||||
{ 0x3a978cfcab31064c, "19024128529074359", -25 },
|
||||
{ 0x3a978cfcab31064d, "1902412852907436", -25 },
|
||||
{ 0x3aa78cfcab31064c, "38048257058148717", -25 },
|
||||
{ 0x3aa78cfcab31064d, "3804825705814872", -25 },
|
||||
{ 0x47f52d02c7e14af7, "45035996273704964", 39 },
|
||||
{ 0x490cd230a7ff47c3, "80341375308088225", 44 },
|
||||
{ 0x4919d9577de925d5, "14411294198511291", 45 },
|
||||
{ 0x4929d9577de925d5, "28822588397022582", 45 },
|
||||
{ 0x4931159a8bd8a240, "38099461575161174", 45 },
|
||||
{ 0x4939d9577de925d5, "57645176794045164", 45 },
|
||||
{ 0x49ccadd6dd730c96, "32745697577386472", 48 },
|
||||
{ 0x49dcadd6dd730c96, "65491395154772944", 48 },
|
||||
{ 0x4a6bb6979ae39c49, "32402369146794532", 51 },
|
||||
{ 0x4a7bb6979ae39c49, "64804738293589064", 51 },
|
||||
{ 0x4b9a32ac316fb3ab, "16059290466419889", 57 },
|
||||
{ 0x4b9a32ac316fb3ac, "1605929046641989", 57 },
|
||||
{ 0x4baa32ac316fb3ab, "32118580932839778", 57 },
|
||||
{ 0x4baa32ac316fb3ac, "3211858093283978", 57 },
|
||||
{ 0x4bba32ac316fb3ab, "64237161865679556", 57 },
|
||||
{ 0x4bba32ac316fb3ac, "6423716186567956", 57 },
|
||||
{ 0x4c85564fb098c955, "42859354584576066", 61 },
|
||||
{ 0x4cef20b1a0d7f626, "4001624164855121", 63 },
|
||||
{ 0x4cff20b1a0d7f626, "8003248329710242", 63 },
|
||||
{ 0x4e2e2785c3a2a20a, "4064803033949531", 69 },
|
||||
{ 0x4e2e2785c3a2a20b, "40648030339495312", 69 },
|
||||
{ 0x4e3e2785c3a2a20a, "8129606067899062", 69 },
|
||||
{ 0x4e3e2785c3a2a20b, "81296060678990625", 69 },
|
||||
{ 0x4e6454b1aef62c8d, "4384946084578497", 70 },
|
||||
{ 0x4e80fde34c996086, "1465909318208761", 71 },
|
||||
{ 0x4e90fde34c996086, "2931818636417522", 71 },
|
||||
{ 0x4ea9a2c2a34ac2f9, "8846583389443709", 71 },
|
||||
{ 0x4ea9a2c2a34ac2fa, "884658338944371", 71 },
|
||||
{ 0x4eb9a2c2a34ac2f9, "17693166778887419", 72 },
|
||||
{ 0x4eb9a2c2a34ac2fa, "1769316677888742", 72 },
|
||||
{ 0x4ec9a2c2a34ac2f9, "35386333557774838", 72 },
|
||||
{ 0x4ec9a2c2a34ac2fa, "3538633355777484", 72 },
|
||||
{ 0x4ed9a2c2a34ac2f9, "70772667115549675", 72 },
|
||||
{ 0x4ed9a2c2a34ac2fa, "7077266711554968", 72 },
|
||||
{ 0x4f28750ea732fdae, "21606114462319112", 74 },
|
||||
{ 0x4f38750ea732fdae, "43212228924638223", 74 },
|
||||
{ 0x503ca9bade45b94a, "3318949537676913", 79 },
|
||||
{ 0x504ca9bade45b94a, "6637899075353826", 79 },
|
||||
{ 0x513843e10734fa57, "18413733104063271", 84 },
|
||||
{ 0x514843e10734fa57, "36827466208126543", 84 },
|
||||
{ 0x51a3274280201a89, "18604316837693468", 86 },
|
||||
{ 0x51b3274280201a89, "37208633675386937", 86 },
|
||||
{ 0x51e71760b3c0bc13, "35887030159858487", 87 },
|
||||
{ 0x521f6a5025e71a61, "39058878597126768", 88 },
|
||||
{ 0x522f6a5025e71a61, "78117757194253536", 88 },
|
||||
{ 0x52c6a47d4e7ec633, "57654578150150385", 91 },
|
||||
{ 0x55693ba3249a8511, "2825769263311679", 104 },
|
||||
{ 0x55793ba3249a8511, "5651538526623358", 104 },
|
||||
{ 0x574fe0403124a00e, "38329392744333992", 113 },
|
||||
{ 0x575fe0403124a00e, "76658785488667984", 113 },
|
||||
{ 0x57763ae2caed4528, "2138446062528161", 114 },
|
||||
{ 0x57863ae2caed4528, "4276892125056322", 114 },
|
||||
{ 0x57d561def4a9ee32, "1316415380484425", 116 },
|
||||
{ 0x57e561def4a9ee32, "263283076096885", 116 },
|
||||
{ 0x57f561def4a9ee32, "52656615219377", 116 },
|
||||
{ 0x580561def4a9ee31, "10531323043875399", 117 },
|
||||
{ 0x581561def4a9ee31, "21062646087750798", 117 },
|
||||
{ 0x582561def4a9ee31, "42125292175501597", 117 },
|
||||
{ 0x584561def4a9ee31, "16850116870200639", 118 },
|
||||
{ 0x585561def4a9ee31, "33700233740401277", 118 },
|
||||
{ 0x5935ede8cce30845, "56627018760181905", 122 },
|
||||
{ 0x59d0dd8f2788d699, "44596066840334405", 125 },
|
||||
{ 0x5b45ed1f039cebfe, "48635409059147446", 132 },
|
||||
{ 0x5b55ed1f039cebfe, "9727081811829489", 132 },
|
||||
{ 0x5b55ed1f039cebff, "972708181182949", 132 },
|
||||
{ 0x5beaf5b5378aa2e5, "61235700073843246", 135 },
|
||||
{ 0x5bfaf5b5378aa2e5, "12247140014768649", 136 },
|
||||
{ 0x5c0af5b5378aa2e5, "24494280029537298", 136 },
|
||||
{ 0x5c1af5b5378aa2e5, "48988560059074597", 136 },
|
||||
{ 0x5c4ef3052ef0a361, "4499029632233837", 137 },
|
||||
{ 0x5c6cf45d333da323, "16836228873919609", 138 },
|
||||
{ 0x5e1780695036a679, "18341526859645389", 146 },
|
||||
{ 0x5e2780695036a679, "36683053719290777", 146 },
|
||||
{ 0x5e54ec8fd70420c7, "2612787385440923", 147 },
|
||||
{ 0x5e64ec8fd70420c7, "5225574770881846", 147 },
|
||||
{ 0x5e6b5e2f86026f05, "6834859331393543", 147 },
|
||||
{ 0x5f9aeac2d1ea2695, "35243988108650928", 153 },
|
||||
{ 0x5faaeac2d1ea2695, "70487976217301855", 153 },
|
||||
{ 0x6009813653f62db7, "42745323906998127", 155 },
|
||||
{ 0x611260322d04d50b, "40366692112133834", 160 },
|
||||
{ 0x624be064a3fb2725, "32106017483029628", 166 },
|
||||
{ 0x625be064a3fb2725, "64212034966059256", 166 },
|
||||
{ 0x64112a13daa46fe4, "10613173493886741", 175 },
|
||||
{ 0x64212a13daa46fe4, "21226346987773482", 175 },
|
||||
{ 0x64312a13daa46fe4, "42452693975546964", 175 },
|
||||
{ 0x671dcfee6690ffc6, "51886190678901447", 189 },
|
||||
{ 0x672dcfee6690ffc6, "10377238135780289", 190 },
|
||||
{ 0x673dcfee6690ffc6, "20754476271560579", 190 },
|
||||
{ 0x674dcfee6690ffc6, "41508952543121158", 190 },
|
||||
{ 0x675dcfee6690ffc6, "83017905086242315", 190 },
|
||||
{ 0x677a77581053543b, "29480080280199528", 191 },
|
||||
{ 0x678a77581053543b, "58960160560399056", 191 },
|
||||
{ 0x6820ee7811241ad3, "38624526316654214", 194 },
|
||||
{ 0x682d3683fa3d1ee0, "66641177824100826", 194 },
|
||||
{ 0x699873e3758bc6b3, "4679330956996797", 201 },
|
||||
{ 0x699cb490951e8515, "5493127645170153", 201 },
|
||||
{ 0x6a6cc08102f0da5b, "45072812455233127", 205 },
|
||||
{ 0x6b3ef9beaa7aa583, "39779219869333628", 209 },
|
||||
{ 0x6b3ef9beaa7aa584, "3977921986933363", 209 },
|
||||
{ 0x6b4ef9beaa7aa583, "79558439738667255", 209 },
|
||||
{ 0x6b4ef9beaa7aa584, "7955843973866726", 209 },
|
||||
{ 0x6b7896beb0c66eb9, "50523702331566894", 210 },
|
||||
{ 0x6b7b86d8c3df7cd1, "56560320317673966", 210 },
|
||||
{ 0x6bdf20938e7414bb, "40933393326155808", 212 },
|
||||
{ 0x6be6c9e14b7c22c4, "59935550661561155", 212 },
|
||||
{ 0x6bef20938e7414bb, "81866786652311615", 212 },
|
||||
{ 0x6bf6c9e14b7c22c3, "1198711013231223", 213 },
|
||||
{ 0x6bf6c9e14b7c22c4, "11987110132312231", 213 },
|
||||
{ 0x6c06c9e14b7c22c3, "2397422026462446", 213 },
|
||||
{ 0x6c06c9e14b7c22c4, "23974220264624462", 213 },
|
||||
{ 0x6c16c9e14b7c22c3, "4794844052924892", 213 },
|
||||
{ 0x6c16c9e14b7c22c4, "47948440529248924", 213 },
|
||||
{ 0x6ce75d226331d03a, "40270821632825953", 217 },
|
||||
{ 0x6cf75d226331d03a, "8054164326565191", 217 },
|
||||
{ 0x6d075d226331d03a, "16108328653130381", 218 },
|
||||
{ 0x6d175d226331d03a, "32216657306260762", 218 },
|
||||
{ 0x6d275d226331d03a, "64433314612521525", 218 },
|
||||
{ 0x6d4b9445072f4374, "30423431424080128", 219 },
|
||||
{ 0x6d5a3bdac4f00f33, "57878622568856074", 219 },
|
||||
{ 0x6d5b9445072f4374, "60846862848160256", 219 },
|
||||
{ 0x6e4a2fbffdb7580c, "18931483477278361", 224 },
|
||||
{ 0x6e5a2fbffdb7580c, "37862966954556723", 224 },
|
||||
{ 0x6e927edd0dbb8c08, "4278822588984689", 225 },
|
||||
{ 0x6e927edd0dbb8c09, "42788225889846894", 225 },
|
||||
{ 0x6ee1c382c3819a0a, "1315044757954692", 227 },
|
||||
{ 0x6ef1c382c3819a0a, "2630089515909384", 227 },
|
||||
{ 0x70f60cf8f38b0465, "14022275014833741", 237 },
|
||||
{ 0x71060cf8f38b0465, "28044550029667482", 237 },
|
||||
{ 0x7114390c68b888ce, "5143975308105889", 237 },
|
||||
{ 0x71160cf8f38b0465, "56089100059334965", 237 },
|
||||
{ 0x714fb4840532a9e5, "64517311884236306", 238 },
|
||||
{ 0x71b1d7cb7eae05d9, "46475406389115295", 240 },
|
||||
{ 0x727fca36c06cf106, "3391607972972965", 244 },
|
||||
{ 0x728fca36c06cf106, "678321594594593", 244 },
|
||||
{ 0x72eba10d818fdafd, "3773057430100257", 246 },
|
||||
{ 0x72fba10d818fdafd, "7546114860200514", 246 },
|
||||
{ 0x737a37935f3b71c9, "1833078106007497", 249 },
|
||||
{ 0x738a37935f3b71c9, "3666156212014994", 249 },
|
||||
{ 0x73972852443155ae, "64766168833734675", 249 },
|
||||
{ 0x739a37935f3b71c9, "7332312424029988", 249 },
|
||||
{ 0x754fe46e378bf132, "1197160149212491", 258 },
|
||||
{ 0x754fe46e378bf133, "11971601492124911", 258 },
|
||||
{ 0x755fe46e378bf132, "2394320298424982", 258 },
|
||||
{ 0x755fe46e378bf133, "23943202984249821", 258 },
|
||||
{ 0x756fe46e378bf132, "4788640596849964", 258 },
|
||||
{ 0x756fe46e378bf133, "47886405968499643", 258 },
|
||||
{ 0x76603d7cb98edc58, "1598075144577112", 263 },
|
||||
{ 0x76603d7cb98edc59, "15980751445771122", 263 },
|
||||
{ 0x76703d7cb98edc58, "3196150289154224", 263 },
|
||||
{ 0x76703d7cb98edc59, "31961502891542243", 263 },
|
||||
{ 0x782f7c6a9ad432a1, "83169412421960475", 271 },
|
||||
{ 0x78447e17e7814ce7, "21652206566352648", 272 },
|
||||
{ 0x78547e17e7814ce7, "43304413132705296", 272 },
|
||||
{ 0x7856d2aa2fc5f2b5, "48228872759189434", 272 },
|
||||
{ 0x7964066d88c7cab8, "5546524276967009", 277 },
|
||||
{ 0x799d696737fe68c7, "65171333649148234", 278 },
|
||||
{ 0x7ace779fddf21621, "3539481653469909", 284 },
|
||||
{ 0x7ace779fddf21622, "35394816534699092", 284 },
|
||||
{ 0x7ade779fddf21621, "7078963306939818", 284 },
|
||||
{ 0x7ade779fddf21622, "70789633069398184", 284 },
|
||||
{ 0x7bc3b063946e10ae, "14990287287869931", 289 },
|
||||
{ 0x7bd3b063946e10ae, "29980574575739863", 289 },
|
||||
{ 0x7c0c283ffc61c87d, "34300126555012788", 290 },
|
||||
{ 0x7c1c283ffc61c87d, "68600253110025576", 290 },
|
||||
{ 0x7c31926c7a7122ba, "17124434349589332", 291 },
|
||||
{ 0x7c41926c7a7122ba, "34248868699178663", 291 },
|
||||
{ 0x7d0a85c6f7fba05d, "2117392354885733", 295 },
|
||||
{ 0x7d1a85c6f7fba05d, "4234784709771466", 295 },
|
||||
{ 0x7d52a5daf9226f04, "47639264836707725", 296 },
|
||||
{ 0x7d8220e1772428d7, "37049827284413546", 297 },
|
||||
{ 0x7d9220e1772428d7, "7409965456882709", 297 },
|
||||
{ 0x7da220e1772428d7, "14819930913765419", 298 },
|
||||
{ 0x7db220e1772428d7, "29639861827530837", 298 },
|
||||
{ 0x7df22815078cb97b, "47497368114750945", 299 },
|
||||
{ 0x7dfe5aceedf1c1f1, "79407577493590275", 299 },
|
||||
{ 0x7e022815078cb97b, "9499473622950189", 299 },
|
||||
{ 0x7e122815078cb97b, "18998947245900378", 300 },
|
||||
{ 0x7e222815078cb97b, "37997894491800756", 300 },
|
||||
{ 0x7e8a9b45a91f1700, "35636409637317792", 302 },
|
||||
{ 0x7e9a9b45a91f1700, "71272819274635585", 302 },
|
||||
{ 0x7eb6202598194bee, "23707742595255608", 303 },
|
||||
{ 0x7ec490abad057752, "4407140524515149", 303 },
|
||||
{ 0x7ec6202598194bee, "47415485190511216", 303 },
|
||||
{ 0x7ee3c8eeb77b8d05, "16959746108988652", 304 },
|
||||
{ 0x7ef3c8eeb77b8d05, "33919492217977303", 304 },
|
||||
{ 0x7ef5bc471d5456c7, "37263572163337027", 304 },
|
||||
{ 0x7f03c8eeb77b8d05, "6783898443595461", 304 },
|
||||
{ 0x7f13c8eeb77b8d05, "13567796887190921", 305 },
|
||||
{ 0x7f23c8eeb77b8d05, "27135593774381842", 305 },
|
||||
{ 0x7f33c8eeb77b8d05, "54271187548763685", 305 },
|
||||
{ 0x7f5594223f5654bf, "2367662756557091", 306 },
|
||||
{ 0x7f6594223f5654bf, "4735325513114182", 306 },
|
||||
{ 0x7f9914e03c9260ee, "44032152438472327", 307 },
|
||||
{ 0x7fb82baa4ae611dc, "16973149506391291", 308 },
|
||||
{ 0x7fc82baa4ae611dc, "33946299012782582", 308 },
|
||||
{ 0x7fd82baa4ae611dc, "67892598025565165", 308 },
|
||||
{ 0x7fefffffffffffff, "17976931348623157", 309 },
|
||||
];
|
||||
|
||||
short low;
|
||||
short high = pathologies.length - 1;
|
||||
const FloatBits!double bits = { value };
|
||||
|
||||
while (high >= low)
|
||||
{
|
||||
const short middle = (low + high) / 2;
|
||||
if (pathologies[middle].representation == bits.integral)
|
||||
{
|
||||
exponent = pathologies[middle].exponent;
|
||||
copy(pathologies[middle].digits, buffer);
|
||||
return buffer[0 .. pathologies[middle].digits.length];
|
||||
}
|
||||
else if (pathologies[middle].representation < bits.integral)
|
||||
{
|
||||
low = cast(short) (middle + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
high = cast(short) (middle - 1);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@nogc nothrow pure @safe unittest
|
||||
{
|
||||
int exponent;
|
||||
char[512] buffer;
|
||||
|
||||
assert(errol3(double.max, buffer, exponent) == "17976931348623157");
|
||||
assert(exponent == 309);
|
||||
|
||||
assert(errol3(0.67892598025565165e308, buffer, exponent) == "67892598025565165");
|
||||
assert(exponent == 308);
|
||||
|
||||
assert(errol3(0.40526371999771488e-307, buffer, exponent) == "40526371999771488");
|
||||
assert(exponent == -307);
|
||||
|
||||
assert(errol3(0.81052743999542975e-307, buffer, exponent) == "81052743999542975");
|
||||
assert(exponent == -307);
|
||||
|
||||
assert(errol3(0.810307, buffer, exponent) is null);
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a float value, returns the significant bits, and the position of the
|
||||
* decimal point in $(D_PARAM exponent). +/-Inf and NaN are specified by
|
||||
@ -1454,10 +1945,10 @@ private const(char)[] real2String(double value,
|
||||
buffer[0] = '0';
|
||||
return buffer[0 .. 1];
|
||||
}
|
||||
else if (value == double.max)
|
||||
|
||||
auto digits = errol3(value, buffer, exponent);
|
||||
if (digits !is null)
|
||||
{
|
||||
copy("17976931348623157", buffer);
|
||||
exponent = 309;
|
||||
return buffer;
|
||||
}
|
||||
else if (value >= 16.0 && value <= 9.007199254740992e15)
|
||||
@ -1923,6 +2414,7 @@ package(tanya) String format(string fmt, Args...)(auto ref Args args)
|
||||
assert(format!"{}"(0x1p-16382L) == "0");
|
||||
assert(format!"{}"(1e+3) == "1000");
|
||||
assert(format!"{}"(38234.1234) == "38234.1");
|
||||
assert(format!"{}"(double.max) == "1.79769e+308");
|
||||
|
||||
// typeof(null).
|
||||
assert(format!"{}"(null) == "null");
|
||||
|
Loading…
Reference in New Issue
Block a user