use util::*;
use super::cached::{ExtendedFloatArray, ModeratePathPowers};
const BASE10_SMALL_MANTISSA: [u64; 10] = [
9223372036854775808,
11529215046068469760,
14411518807585587200,
18014398509481984000,
11258999068426240000,
14073748835532800000,
17592186044416000000,
10995116277760000000,
13743895347200000000,
17179869184000000000,
];
const BASE10_SMALL_EXPONENT: [i32; 10] = [
-63,
-60,
-57,
-54,
-50,
-47,
-44,
-40,
-37,
-34,
];
const BASE10_LARGE_MANTISSA: [u64; 66] = [
11555125961253852697,
13451937075301367670,
15660115838168849784,
18230774251475056848,
10611707258198326947,
12353653155963782858,
14381545078898527261,
16742321987285426889,
9745314011399999080,
11345038669416679861,
13207363278391631158,
15375394465392026070,
17899314949046850752,
10418772551374772303,
12129047596099288555,
14120069793541087484,
16437924692338667210,
9568131466127621947,
11138771039116687545,
12967236152753102995,
15095849699286165408,
17573882009934360870,
10229345649675443343,
11908525658859223294,
13863348470604074297,
16139061738043178685,
9394170331095332911,
10936253623915059621,
12731474852090538039,
14821387422376473014,
17254365866976409468,
10043362776618689222,
11692013098647223345,
13611294676837538538,
15845632502852867518,
9223372036854775808,
10737418240000000000,
12500000000000000000,
14551915228366851806,
16940658945086006781,
9860761315262647567,
11479437019748901445,
13363823550460978230,
15557538194652854267,
18111358157653424735,
10542197943230523224,
12272733663244316382,
14287342391028437277,
16632655625031838749,
9681479787123295682,
11270725851789228247,
13120851772591970218,
15274681817498023410,
17782069995880619867,
10350527006597618960,
12049599325514420588,
14027579833653779454,
16330252207878254650,
9505457831475799117,
11065809325636130661,
12882297539194266616,
14996968138956309548,
17458768723248864463,
10162340898095201970,
11830521861667747109,
13772540099066387756,
];
const BASE10_LARGE_EXPONENT: [i32; 66] = [
-1226,
-1193,
-1160,
-1127,
-1093,
-1060,
-1027,
-994,
-960,
-927,
-894,
-861,
-828,
-794,
-761,
-728,
-695,
-661,
-628,
-595,
-562,
-529,
-495,
-462,
-429,
-396,
-362,
-329,
-296,
-263,
-230,
-196,
-163,
-130,
-97,
-63,
-30,
3,
36,
69,
103,
136,
169,
202,
235,
269,
302,
335,
368,
402,
435,
468,
501,
534,
568,
601,
634,
667,
701,
734,
767,
800,
833,
867,
900,
933,
];
const BASE10_SMALL_INT_POWERS: [u64; 10] = [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000];
const BASE10_STEP: i32 = 10;
const BASE10_BIAS: i32 = 350;
cfg_if! {
if #[cfg(feature = "radix")] {
const BASE3_SMALL_MANTISSA: [u64; 20] = [
9223372036854775808,
13835058055282163712,
10376293541461622784,
15564440312192434176,
11673330234144325632,
17509995351216488448,
13132496513412366336,
9849372385059274752,
14774058577588912128,
11080543933191684096,
16620815899787526144,
12465611924840644608,
9349208943630483456,
14023813415445725184,
10517860061584293888,
15776790092376440832,
11832592569282330624,
17748888853923495936,
13311666640442621952,
9983749980331966464,
];
const BASE3_SMALL_EXPONENT: [i32; 20] = [
-63,
-62,
-60,
-59,
-57,
-56,
-54,
-52,
-51,
-49,
-48,
-46,
-44,
-43,
-41,
-40,
-38,
-37,
-35,
-33,
];
const BASE3_LARGE_MANTISSA: [u64; 69] = [
16362187946641408838,
13283319235448605538,
10783800460320302292,
17509230984627012859,
14214523479040558273,
11539780240125690827,
9368342750761260524,
15211008194170796346,
12348756681875770872,
10025094302862174179,
16277349755993950451,
13214445025385558299,
10727886292707736997,
17418445358572088840,
14140820960965941427,
11479946305982273645,
9319767752666157840,
15132138887857638912,
12284728192712064755,
9973114038089604413,
16192951452641260116,
13145927929137795237,
10672262040895386089,
17328130457353990660,
14067500591556283265,
11420422611687500217,
9271444616666914905,
15053678520084183432,
12221031692227883264,
9921403291771844100,
16108990755761097026,
13077766095064811873,
10616926201665464118,
17238283840257358043,
13994560389365007134,
11361207548643088241,
9223372036854775808,
14975624970497949696,
12157665459056928801,
9869960666451650558,
16025465396357318008,
13009957681126887596,
10561877279594392463,
17148903079221976570,
13921998383219366688,
11302299516591361707,
18351097428184282358,
14897976129740516999,
12094627780758213915,
9818784771917617934,
15942373117198559022,
12942500854835305460,
10507113787012386253,
17059985758777160561,
13849812612167175924,
11243696923572004730,
18255946711954919292,
14820729899390519784,
12031916953769783440,
9767874225166607426,
15859711672757234610,
12875393793202830082,
10452634243963250834,
16971529475976476179,
13778001125423815423,
11185398185879039609,
18161289353620602647,
14743884191906938838,
11969531283362676572,
];
const BASE3_LARGE_EXPONENT: [i32; 69] = [
-1205,
-1173,
-1141,
-1110,
-1078,
-1046,
-1014,
-983,
-951,
-919,
-888,
-856,
-824,
-793,
-761,
-729,
-697,
-666,
-634,
-602,
-571,
-539,
-507,
-476,
-444,
-412,
-380,
-349,
-317,
-285,
-254,
-222,
-190,
-159,
-127,
-95,
-63,
-32,
0,
32,
63,
95,
127,
158,
190,
222,
253,
285,
317,
349,
380,
412,
444,
475,
507,
539,
570,
602,
634,
666,
697,
729,
761,
792,
824,
856,
887,
919,
951,
];
const BASE3_SMALL_INT_POWERS: [u64; 20] = [1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147, 531441, 1594323, 4782969, 14348907, 43046721, 129140163, 387420489, 1162261467];
const BASE3_STEP: i32 = 20;
const BASE3_BIAS: i32 = 720;
const BASE5_SMALL_MANTISSA: [u64; 14] = [
9223372036854775808,
11529215046068469760,
14411518807585587200,
18014398509481984000,
11258999068426240000,
14073748835532800000,
17592186044416000000,
10995116277760000000,
13743895347200000000,
17179869184000000000,
10737418240000000000,
13421772800000000000,
16777216000000000000,
10485760000000000000,
];
const BASE5_SMALL_EXPONENT: [i32; 14] = [
-63,
-61,
-59,
-57,
-54,
-52,
-50,
-47,
-45,
-43,
-40,
-38,
-36,
-33,
];
const BASE5_LARGE_MANTISSA: [u64; 68] = [
15492890949478498119,
11008361120075348168,
15643822052986917253,
11115604119273511155,
15796223521069679172,
11223891875338892399,
15950109677957715915,
11333234566249726012,
16105494987428025427,
11443642469137689536,
16262394054163123565,
11555125961253852697,
16420821625123739831,
11667695520944036383,
16580792590934885855,
11781361728633673532,
16742321987285426889,
11896135267822264502,
16905424996341287883,
12012026926087520367,
17070116948172426941,
12129047596099288555,
17236413322193710308,
12247208276643356092,
17404329748619824289,
12366520073655226703,
17573882009934360870,
12486994201263968925,
17745086042373215101,
12608641982846233347,
17917957937422433684,
12731474852090538039,
18092513943330655534,
12855504354071922204,
18268770466636286477,
12980742146337069071,
9223372036854775808,
13107200000000000000,
9313225746154785156,
13234889800848442797,
9403954806578300063,
13363823550460978230,
9495567745759798747,
13494013367335069727,
9588073174409622174,
13625471488026082303,
9681479787123295682,
13758210268297397763,
9775796363198734982,
13892242184281734271,
9871031767461413346,
14027579833653779454,
9967194951097567535,
14164235936814247246,
10064294952495520794,
14302223338085469768,
10162340898095201970,
14441555006918636608,
10261342003245940623,
14582244039112794984,
10361307573072618726,
14724303658045725350,
10462247003350260393,
14867747215916808149,
10564169781387141817,
15012588195001998509,
10667085486916504429,
15158840208921026870,
];
const BASE5_LARGE_EXPONENT: [i32; 68] = [
-1234,
-1201,
-1169,
-1136,
-1104,
-1071,
-1039,
-1006,
-974,
-941,
-909,
-876,
-844,
-811,
-779,
-746,
-714,
-681,
-649,
-616,
-584,
-551,
-519,
-486,
-454,
-421,
-389,
-356,
-324,
-291,
-259,
-226,
-194,
-161,
-129,
-96,
-63,
-31,
2,
34,
67,
99,
132,
164,
197,
229,
262,
294,
327,
359,
392,
424,
457,
489,
522,
554,
587,
619,
652,
684,
717,
749,
782,
814,
847,
879,
912,
944,
];
const BASE5_SMALL_INT_POWERS: [u64; 14] = [1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, 48828125, 244140625, 1220703125];
const BASE5_STEP: i32 = 14;
const BASE5_BIAS: i32 = 504;
const BASE6_SMALL_MANTISSA: [u64; 12] = [
9223372036854775808,
13835058055282163712,
10376293541461622784,
15564440312192434176,
11673330234144325632,
17509995351216488448,
13132496513412366336,
9849372385059274752,
14774058577588912128,
11080543933191684096,
16620815899787526144,
12465611924840644608,
];
const BASE6_SMALL_EXPONENT: [i32; 12] = [
-63,
-61,
-58,
-56,
-53,
-51,
-48,
-45,
-43,
-40,
-38,
-35,
];
const BASE6_LARGE_MANTISSA: [u64; 71] = [
11172994339528645078,
11325430459582219446,
11479946305982273645,
11636570252986002899,
11795331061968106016,
11956257886702331980,
12119380278715084095,
12284728192712064755,
12452331992078957377,
12622222454457155586,
12794430777395563548,
12968988584079505325,
13145927929137795237,
13325281304529035642,
13507081645508223020,
13691362336674758052,
13878157218102970303,
14067500591556283265,
14259427226786160917,
14453972367916992462,
14651171739918087751,
14851061555163971849,
15053678520084183432,
15259059841903798156,
15467243235475914756,
15678266930207358578,
15892169677078874302,
16108990755761097026,
16328769981827608423,
16551547714066402526,
16777364861891103792,
17006262892853298360,
17238283840257358043,
17473470310879155380,
17711865492790087155,
17953513163287843146,
18198457696935376453,
9223372036854775808,
9349208943630483456,
9476762676643233792,
9606056659007943744,
9737114633407288801,
9869960666451650558,
10004619153098548172,
10141114821132365302,
10279472735705195138,
10419718303939637392,
10561877279594392463,
10705975767793509530,
10852040229820157048,
11000097487975795902,
11150174730505647564,
11302299516591361707,
11456499781411800112,
11612803841272866179,
11771240398807322073,
11931838548245548344,
12094627780758213915,
12259637989871837542,
12426899476958235198,
12596442956798861450,
12768299563225066619,
12942500854835305460,
13119078820790347231,
13298065886687551351,
13479494920515287357,
13663399238688592583,
13849812612167175924,
14038769272656891137,
14230303918895818486,
14424451723026109070,
];
const BASE6_LARGE_EXPONENT: [i32; 71] = [
-1211,
-1180,
-1149,
-1118,
-1087,
-1056,
-1025,
-994,
-963,
-932,
-901,
-870,
-839,
-808,
-777,
-746,
-715,
-684,
-653,
-622,
-591,
-560,
-529,
-498,
-467,
-436,
-405,
-374,
-343,
-312,
-281,
-250,
-219,
-188,
-157,
-126,
-95,
-63,
-32,
-1,
30,
61,
92,
123,
154,
185,
216,
247,
278,
309,
340,
371,
402,
433,
464,
495,
526,
557,
588,
619,
650,
681,
712,
743,
774,
805,
836,
867,
898,
929,
960,
];
const BASE6_SMALL_INT_POWERS: [u64; 12] = [1, 6, 36, 216, 1296, 7776, 46656, 279936, 1679616, 10077696, 60466176, 362797056];
const BASE6_STEP: i32 = 12;
const BASE6_BIAS: i32 = 444;
const BASE7_SMALL_MANTISSA: [u64; 11] = [
9223372036854775808,
16140901064495857664,
14123288431433875456,
12357877377504641024,
10813142705316560896,
9461499867151990784,
16557624767515983872,
14487921671576485888,
12676931462629425152,
11092315029800747008,
9705775651075653632,
];
const BASE7_SMALL_EXPONENT: [i32; 11] = [
-63,
-61,
-58,
-55,
-52,
-49,
-47,
-44,
-41,
-38,
-35,
];
const BASE7_LARGE_MANTISSA: [u64; 71] = [
12225664820028455743,
11256958357801915874,
10365007820408367996,
9543731415037814164,
17575058485347314089,
16182490230010039076,
14900262793588950961,
13719633267955538670,
12632551493533408059,
11631605169031861852,
10709969310436274791,
9861359714639799269,
18159980220813419398,
16721065408999761282,
15396163707909854531,
14176241233598532153,
13052979906282242272,
12018720733250263776,
11066411585781870352,
10189559113984709052,
9382184471684205580,
17277565098945522629,
15908568875896010079,
14648045730389016129,
13487400745686688174,
12418720027433908743,
11434716742520575143,
10528681433580712628,
9694436270346269630,
17852585851834022264,
16438027581449061548,
15135552519453149331,
13936279698645574929,
12832031839555071753,
11815279593402393441,
10879090202998704701,
10017080231522506848,
9223372036854775808,
16985107389382393856,
15639284194331952196,
14400097950748064600,
13259099228230139701,
12208508091080056405,
11241161050565762112,
10350462220447909415,
9530338342721952463,
17550394753834620135,
16159780741186857313,
14879352702091044991,
13700379997665963732,
12614823765422770599,
11615282106028126090,
10694939613220642893,
9847520902748803399,
18134495646931893353,
16697600117649658875,
15374557700263623520,
14156347188413069088,
13034662175384360011,
12001854416615353596,
11050881679899153397,
10175259727702178785,
9369018104186475301,
17253318850937371954,
15886243791070066478,
14627489584451796037,
13468473375910191470,
12401292376951646786,
11418669980349265042,
10513906144367477972,
9680831708316613461,
];
const BASE7_LARGE_EXPONENT: [i32; 71] = [
-1206,
-1175,
-1144,
-1113,
-1083,
-1052,
-1021,
-990,
-959,
-928,
-897,
-866,
-836,
-805,
-774,
-743,
-712,
-681,
-650,
-619,
-588,
-558,
-527,
-496,
-465,
-434,
-403,
-372,
-341,
-311,
-280,
-249,
-218,
-187,
-156,
-125,
-94,
-63,
-33,
-2,
29,
60,
91,
122,
153,
184,
214,
245,
276,
307,
338,
369,
400,
431,
461,
492,
523,
554,
585,
616,
647,
678,
709,
739,
770,
801,
832,
863,
894,
925,
956,
];
const BASE7_SMALL_INT_POWERS: [u64; 11] = [1, 7, 49, 343, 2401, 16807, 117649, 823543, 5764801, 40353607, 282475249];
const BASE7_STEP: i32 = 11;
const BASE7_BIAS: i32 = 407;
const BASE9_SMALL_MANTISSA: [u64; 10] = [
9223372036854775808,
10376293541461622784,
11673330234144325632,
13132496513412366336,
14774058577588912128,
16620815899787526144,
9349208943630483456,
10517860061584293888,
11832592569282330624,
13311666640442621952,
];
const BASE9_SMALL_EXPONENT: [i32; 10] = [
-63,
-60,
-57,
-54,
-51,
-48,
-44,
-41,
-38,
-35,
];
const BASE9_LARGE_MANTISSA: [u64; 69] = [
16362187946641408838,
13283319235448605538,
10783800460320302292,
17509230984627012859,
14214523479040558273,
11539780240125690827,
9368342750761260524,
15211008194170796346,
12348756681875770872,
10025094302862174179,
16277349755993950451,
13214445025385558299,
10727886292707736997,
17418445358572088840,
14140820960965941427,
11479946305982273645,
9319767752666157840,
15132138887857638912,
12284728192712064755,
9973114038089604413,
16192951452641260116,
13145927929137795237,
10672262040895386089,
17328130457353990660,
14067500591556283265,
11420422611687500217,
9271444616666914905,
15053678520084183432,
12221031692227883264,
9921403291771844100,
16108990755761097026,
13077766095064811873,
10616926201665464118,
17238283840257358043,
13994560389365007134,
11361207548643088241,
9223372036854775808,
14975624970497949696,
12157665459056928801,
9869960666451650558,
16025465396357318008,
13009957681126887596,
10561877279594392463,
17148903079221976570,
13921998383219366688,
11302299516591361707,
18351097428184282358,
14897976129740516999,
12094627780758213915,
9818784771917617934,
15942373117198559022,
12942500854835305460,
10507113787012386253,
17059985758777160561,
13849812612167175924,
11243696923572004730,
18255946711954919292,
14820729899390519784,
12031916953769783440,
9767874225166607426,
15859711672757234610,
12875393793202830082,
10452634243963250834,
16971529475976476179,
13778001125423815423,
11185398185879039609,
18161289353620602647,
14743884191906938838,
11969531283362676572,
];
const BASE9_LARGE_EXPONENT: [i32; 69] = [
-1205,
-1173,
-1141,
-1110,
-1078,
-1046,
-1014,
-983,
-951,
-919,
-888,
-856,
-824,
-793,
-761,
-729,
-697,
-666,
-634,
-602,
-571,
-539,
-507,
-476,
-444,
-412,
-380,
-349,
-317,
-285,
-254,
-222,
-190,
-159,
-127,
-95,
-63,
-32,
0,
32,
63,
95,
127,
158,
190,
222,
253,
285,
317,
349,
380,
412,
444,
475,
507,
539,
570,
602,
634,
666,
697,
729,
761,
792,
824,
856,
887,
919,
951,
];
const BASE9_SMALL_INT_POWERS: [u64; 10] = [1, 9, 81, 729, 6561, 59049, 531441, 4782969, 43046721, 387420489];
const BASE9_STEP: i32 = 10;
const BASE9_BIAS: i32 = 360;
const BASE11_SMALL_MANTISSA: [u64; 9] = [
9223372036854775808,
12682136550675316736,
17437937757178560512,
11988582208060260352,
16484300536082857984,
11332956618556964864,
15582815350515826688,
10713185553479630848,
14730630136034492416,
];
const BASE11_SMALL_EXPONENT: [i32; 9] = [
-63,
-60,
-57,
-53,
-50,
-46,
-43,
-39,
-36,
];
const BASE11_LARGE_MANTISSA: [u64; 70] = [
9282833781626869722,
10192597509046958613,
11191522591630754840,
12288347284174558846,
13492666233761944748,
14815014410453217040,
16266959263598494876,
17861201909926315464,
9805844119283264859,
10766865452458105492,
11822071640254585128,
12980693265318349774,
14252865553152120313,
15649717031600177225,
17183466879401827195,
9433765907692842627,
10358321731667433590,
11373488609595385666,
12488146873940825498,
13712047173770907127,
15055895770097238115,
16531448190583591098,
18151612062879235750,
9965280013064351107,
10941926854184612877,
12014289927163860584,
13191749897208336388,
14484606781216284322,
15904170048801172427,
17462857553661839031,
9587152080358667750,
10526740509619734750,
11558413262671798860,
12691195059726361470,
13934995088312952370,
15300693685460773821,
16800237515163846269,
9223372036854775808,
10127308218523713536,
11119834626984462962,
12209633543621683835,
13406238156435497652,
14720115953107913248,
16162760287003157808,
17746790917089950882,
9743032200637278641,
10697897654413860244,
11746344656115154606,
12897544661339799796,
14161567973799797658,
15549471836891389165,
17073397158676562691,
9373337358196117359,
10291970884763903381,
11300635050781198339,
12408153305213523269,
13624213838764580644,
14959454332853289890,
16425555014410689631,
18035340830508227153,
9901446818303059920,
10871837689903097542,
11937331677337075986,
13107249357401447067,
14391824769622635037,
15802294940132787091,
17350998179329134782,
9525741006595626773,
10459310846201225147,
11484375157976259923,
];
const BASE11_LARGE_EXPONENT: [i32; 70] = [
-1215,
-1184,
-1153,
-1122,
-1091,
-1060,
-1029,
-998,
-966,
-935,
-904,
-873,
-842,
-811,
-780,
-748,
-717,
-686,
-655,
-624,
-593,
-562,
-531,
-499,
-468,
-437,
-406,
-375,
-344,
-313,
-281,
-250,
-219,
-188,
-157,
-126,
-95,
-63,
-32,
-1,
30,
61,
92,
123,
154,
186,
217,
248,
279,
310,
341,
372,
404,
435,
466,
497,
528,
559,
590,
621,
653,
684,
715,
746,
777,
808,
839,
871,
902,
933,
];
const BASE11_SMALL_INT_POWERS: [u64; 9] = [1, 11, 121, 1331, 14641, 161051, 1771561, 19487171, 214358881];
const BASE11_STEP: i32 = 9;
const BASE11_BIAS: i32 = 333;
const BASE12_SMALL_MANTISSA: [u64; 9] = [
9223372036854775808,
13835058055282163712,
10376293541461622784,
15564440312192434176,
11673330234144325632,
17509995351216488448,
13132496513412366336,
9849372385059274752,
14774058577588912128,
];
const BASE12_SMALL_EXPONENT: [i32; 9] = [
-63,
-60,
-56,
-53,
-49,
-46,
-42,
-38,
-35,
];
const BASE12_LARGE_MANTISSA: [u64; 68] = [
12794430777395563548,
15370653136686821126,
9232805349408163458,
11091876690210014731,
13325281304529035642,
16008393061343079134,
9615881366772943927,
11552086971569327107,
13878157218102970303,
16672593293696335722,
10014851495355986817,
12031391722600823274,
14453972367916992462,
17364351691754770668,
10430375193750279268,
12530583187169601247,
15053678520084183432,
18084811664478575592,
10863139281980340679,
13050486479932803075,
15678266930207358578,
9417582030861555141,
11313859076748534537,
13591960950173425616,
16328769981827608423,
9808324571298608904,
11783279573783601017,
14155901602220618825,
17006262892853298360,
10215279312745101062,
12272176679245716810,
14743240574804287352,
17711865492790087155,
10639118911577981124,
12781358492223474271,
15354948681789223882,
9223372036854775808,
11080543933191684096,
13311666640442621952,
15992037016835457024,
9606056659007943744,
11540284009964194135,
13863977671394362375,
16655558624637160317,
10004619153098548172,
12019099047267988506,
14439204501182606065,
17346610241502516795,
10419718303939637392,
12517780479519279956,
15038297923484984581,
18066334108151547333,
10852040229820157048,
13037152578341684032,
15662248181121787524,
9407959928864140132,
11302299516591361707,
13578073815006577911,
16312086602830473207,
9798303241073980839,
11771240398807322073,
14141438279402131370,
16988887307951181138,
10204842190014742991,
12259637989871837542,
14728177157876426901,
17693768981840924725,
10628248744799039348,
];
const BASE12_LARGE_EXPONENT: [i32; 68] = [
-1225,
-1193,
-1160,
-1128,
-1096,
-1064,
-1031,
-999,
-967,
-935,
-902,
-870,
-838,
-806,
-773,
-741,
-709,
-677,
-644,
-612,
-580,
-547,
-515,
-483,
-451,
-418,
-386,
-354,
-322,
-289,
-257,
-225,
-193,
-160,
-128,
-96,
-63,
-31,
1,
33,
66,
98,
130,
162,
195,
227,
259,
291,
324,
356,
388,
420,
453,
485,
517,
550,
582,
614,
646,
679,
711,
743,
775,
808,
840,
872,
904,
937,
];
const BASE12_SMALL_INT_POWERS: [u64; 9] = [1, 12, 144, 1728, 20736, 248832, 2985984, 35831808, 429981696];
const BASE12_STEP: i32 = 9;
const BASE12_BIAS: i32 = 324;
const BASE13_SMALL_MANTISSA: [u64; 8] = [
9223372036854775808,
14987979559889010688,
12177733392409821184,
9894408381332979712,
16078413619666092032,
13063711065978699776,
10614265241107693568,
17248181016800002048,
];
const BASE13_SMALL_EXPONENT: [i32; 8] = [
-63,
-60,
-56,
-52,
-49,
-45,
-41,
-38,
];
const BASE13_LARGE_MANTISSA: [u64; 74] = [
12711851154623003921,
9657300550123029827,
14673465379822171777,
11147555423761605318,
16937783776246970219,
12867777209673117558,
9775758889423702247,
14853452979012869128,
11284293521111612769,
17145545948207386966,
13025615884242430727,
9895670261906581517,
15035648341334079534,
11422708874734959378,
17355856571645749915,
13185390638896427802,
10017052490761162429,
15220078547640608376,
11562822058185475244,
17568746906366835671,
13347125221972482607,
10139923617799671626,
15406771010966328102,
11704653897376229735,
17784248595614306423,
13510843673109724761,
10264301906138736839,
15595753480598751694,
11848225473675019323,
18002393670774046392,
13676570326822204041,
10390205842913949994,
15787054046203585657,
11993558127037825287,
18223214556135190308,
13844329816115883890,
10517654142027727687,
15980701141999875583,
12140673459180707010,
9223372036854775808,
14014147076150001664,
10646665746930877456,
16176723550986364864,
12289593336790602348,
9336507724055083356,
14186047347943339851,
10777259833438283283,
16375150409219694755,
12440339894775512302,
9451031155744840189,
14360056182125959135,
10909455812579128852,
16576011210145081669,
12592935539554553092,
9566959354269653198,
14536199442736950948,
11043273333482082198,
16779335808980115413,
12747402952388364654,
9684309550774553205,
14714503311068774005,
11178732286295870598,
16985154427152329948,
12903765092750370582,
9803099187765169579,
14894994289558746218,
11315852805145679810,
17193497656791206265,
13062045201739390598,
9923345921700320715,
15077699205728270417,
11454655271125817073,
17404396465275275042,
13222266805534112801,
];
const BASE13_LARGE_EXPONENT: [i32; 74] = [
-1218,
-1188,
-1159,
-1129,
-1100,
-1070,
-1040,
-1011,
-981,
-952,
-922,
-892,
-863,
-833,
-804,
-774,
-744,
-715,
-685,
-656,
-626,
-596,
-567,
-537,
-508,
-478,
-448,
-419,
-389,
-360,
-330,
-300,
-271,
-241,
-212,
-182,
-152,
-123,
-93,
-63,
-34,
-4,
25,
55,
85,
114,
144,
173,
203,
233,
262,
292,
321,
351,
381,
410,
440,
469,
499,
529,
558,
588,
617,
647,
677,
706,
736,
765,
795,
825,
854,
884,
913,
943,
];
const BASE13_SMALL_INT_POWERS: [u64; 8] = [1, 13, 169, 2197, 28561, 371293, 4826809, 62748517];
const BASE13_STEP: i32 = 8;
const BASE13_BIAS: i32 = 312;
const BASE14_SMALL_MANTISSA: [u64; 8] = [
9223372036854775808,
16140901064495857664,
14123288431433875456,
12357877377504641024,
10813142705316560896,
9461499867151990784,
16557624767515983872,
14487921671576485888,
];
const BASE14_SMALL_EXPONENT: [i32; 8] = [
-63,
-60,
-56,
-52,
-48,
-44,
-41,
-37,
];
const BASE14_LARGE_MANTISSA: [u64; 72] = [
13636466802170654447,
9371223146631740442,
12880143300754023535,
17702928299982570560,
12165767999490239948,
16721065408999761282,
11491014312609104256,
15793659877858943182,
10853684694473876180,
14917691321465419740,
10251703482589146278,
14090306875260685218,
9683110137559136558,
13308811903980028150,
18292105715960495534,
12570661225733134820,
17277565098945522629,
11873450822826176619,
16319294256419936609,
11214910012329090474,
15414172280784786485,
10592894050889065017,
14559251360287507272,
10005377149705503250,
13751747178554400168,
9450445876917551117,
12989029846596759700,
17852585851834022264,
12268615337757900164,
16862422458582420498,
11588157397706317457,
15927176798452085633,
10945439903127358164,
15043802952525257461,
10338369644227094261,
14209423938610553080,
9764969507542378307,
13421322341453983785,
9223372036854775808,
12676931462629425152,
17423626702474969088,
11973826961285400900,
16457254800854930971,
11309718958523667683,
15544481077627229210,
10682444579695049354,
14682332800738954595,
10089960910324183248,
13868002115678253630,
9530338342721952463,
13098836900821174211,
18003508583233548621,
12372332129971187630,
17004974516675479989,
11686121713960805382,
16061822448435536582,
11037970794744924274,
15170980709914287138,
10425768466889213611,
14329547997401095751,
9847520902748803399,
13534783923074532648,
9301344858947275744,
12784100090075520076,
17570923086015569737,
12075051662586407952,
16596381640322157656,
11405329403461315009,
15675891482926176126,
10772752153475797540,
14806454750802381310,
10175259727702178785,
];
const BASE14_LARGE_EXPONENT: [i32; 72] = [
-1221,
-1190,
-1160,
-1130,
-1099,
-1069,
-1038,
-1008,
-977,
-947,
-916,
-886,
-855,
-825,
-795,
-764,
-734,
-703,
-673,
-642,
-612,
-581,
-551,
-520,
-490,
-459,
-429,
-399,
-368,
-338,
-307,
-277,
-246,
-216,
-185,
-155,
-124,
-94,
-63,
-33,
-3,
28,
58,
89,
119,
150,
180,
211,
241,
272,
302,
332,
363,
393,
424,
454,
485,
515,
546,
576,
607,
637,
668,
698,
728,
759,
789,
820,
850,
881,
911,
942,
];
const BASE14_SMALL_INT_POWERS: [u64; 8] = [1, 14, 196, 2744, 38416, 537824, 7529536, 105413504];
const BASE14_STEP: i32 = 8;
const BASE14_BIAS: i32 = 304;
const BASE15_SMALL_MANTISSA: [u64; 8] = [
9223372036854775808,
17293822569102704640,
16212958658533785600,
15199648742375424000,
14249670695976960000,
13359066277478400000,
12524124635136000000,
11741366845440000000,
];
const BASE15_SMALL_EXPONENT: [i32; 8] = [
-63,
-60,
-56,
-52,
-48,
-44,
-40,
-36,
];
const BASE15_LARGE_MANTISSA: [u64; 70] = [
13601350414362439244,
16232381325359158633,
9686178043528474499,
11559862131178364723,
13795989697002596758,
16464671426007778306,
9824790070164184132,
11725287122380398084,
13993414324420480958,
16700285665596816319,
9965385675239368708,
11893079393347852255,
14193664155710441018,
16939271613521887687,
10107993244338750184,
12063272820543086702,
14396779620362065880,
17181677519910502131,
10252641569253028545,
12235901765210495847,
14602801726422706134,
17427552325363535592,
10399359853791807565,
12411001080313881072,
14811772068776803956,
17676945670836105047,
10548177719679705225,
12588606117573098524,
15023732837543702665,
17929907907659841510,
10699125212536839185,
12768752734601403407,
15238726826595631383,
18186490107708584674,
10852232807944894743,
12951477302144931748,
15456797442197584532,
9223372036854775808,
11007531417600000000,
13136816711425781250,
15677988711770840524,
9355361174851030653,
11165052395553650442,
13324808381590173768,
15902345292781888946,
9489239115822963265,
11324827544542942993,
13515490267263203164,
16129912481758560891,
9625032889090827484,
11486889122411397534,
13708900866211693796,
16360736223435182728,
9762769910772315950,
11651269848621662268,
13905079227116716745,
16594863120028599690,
9902477989317744010,
11818002910861417777,
14104064957457333009,
16832340440646942057,
10044185331124443731,
11987121971743813505,
14305898231507155361,
17073216130833033517,
10187920546231501512,
12158661175603789420,
14510619798445343328,
17317538822244368489,
10333712654095989060,
];
const BASE15_LARGE_EXPONENT: [i32; 70] = [
-1220,
-1189,
-1157,
-1126,
-1095,
-1064,
-1032,
-1001,
-970,
-939,
-907,
-876,
-845,
-814,
-782,
-751,
-720,
-689,
-657,
-626,
-595,
-564,
-532,
-501,
-470,
-439,
-407,
-376,
-345,
-314,
-282,
-251,
-220,
-189,
-157,
-126,
-95,
-63,
-32,
-1,
30,
62,
93,
124,
155,
187,
218,
249,
280,
312,
343,
374,
405,
437,
468,
499,
530,
562,
593,
624,
655,
687,
718,
749,
780,
812,
843,
874,
905,
937,
];
const BASE15_SMALL_INT_POWERS: [u64; 8] = [1, 15, 225, 3375, 50625, 759375, 11390625, 170859375];
const BASE15_STEP: i32 = 8;
const BASE15_BIAS: i32 = 296;
const BASE17_SMALL_MANTISSA: [u64; 8] = [
9223372036854775808,
9799832789158199296,
10412322338480586752,
11063092484635623424,
11754535764925349888,
12489194250233184256,
13269768890872758272,
14099129446552305664,
];
const BASE17_SMALL_EXPONENT: [i32; 8] = [
-63,
-59,
-55,
-51,
-47,
-43,
-39,
-35,
];
const BASE17_LARGE_MANTISSA: [u64; 67] = [
13138227451101932889,
10669358063439695630,
17328852299072967575,
14072501842077846052,
11428068326595325663,
9280563409615280245,
15073213554289220394,
12240731344920942400,
9940514895438007254,
16145087021687770276,
13111183760586542995,
10647396286743453217,
17293182638130712658,
14043535043777936273,
11404544822822581011,
9261460323937079649,
15042186893809203473,
12215535057871861844,
9920053367473418578,
16111854019870470980,
13084195736727816960,
10625479716106730764,
17257586399518441101,
14014627870654357169,
11381069739763987898,
9242396559996829853,
15011224098520048145,
12190390634789334486,
9899633957460570790,
16078689424770850259,
13057263264941664926,
10603608258477502216,
17222063432103834911,
13985780199974813110,
11357642977750484199,
9223372036854775808,
14980325036961824768,
12165297968916717120,
9879256578703990224,
16045593095580712414,
13030386230879856604,
10581781820995279550,
17186613585065666435,
13956991909259640275,
11334264437318166304,
18408773347475537258,
14949489577945200446,
12140256953717114113,
9858921144686656932,
16012564891781700940,
13003564520429535778,
10560000310990718510,
17151236707893158013,
13928262876281286641,
11310934019207866827,
18370880780077845311,
14918717590550882042,
12115267482872925081,
9838627569069637357,
15979604673144701925,
12976798019712735820,
10538263635985225157,
17115932650385342947,
13899592979063793037,
11287651624364733171,
18333066210634546428,
14888008944129060322,
];
const BASE17_LARGE_EXPONENT: [i32; 67] = [
-1208,
-1175,
-1143,
-1110,
-1077,
-1044,
-1012,
-979,
-946,
-914,
-881,
-848,
-816,
-783,
-750,
-717,
-685,
-652,
-619,
-587,
-554,
-521,
-489,
-456,
-423,
-390,
-358,
-325,
-292,
-260,
-227,
-194,
-162,
-129,
-96,
-63,
-31,
2,
35,
67,
100,
133,
165,
198,
231,
263,
296,
329,
362,
394,
427,
460,
492,
525,
558,
590,
623,
656,
689,
721,
754,
787,
819,
852,
885,
917,
950,
];
const BASE17_SMALL_INT_POWERS: [u64; 8] = [1, 17, 289, 4913, 83521, 1419857, 24137569, 410338673];
const BASE17_STEP: i32 = 8;
const BASE17_BIAS: i32 = 280;
const BASE18_SMALL_MANTISSA: [u64; 7] = [
9223372036854775808,
10376293541461622784,
11673330234144325632,
13132496513412366336,
14774058577588912128,
16620815899787526144,
9349208943630483456,
];
const BASE18_SMALL_EXPONENT: [i32; 7] = [
-63,
-59,
-55,
-51,
-47,
-43,
-38,
];
const BASE18_LARGE_MANTISSA: [u64; 75] = [
14081888293732326968,
16058262627216485544,
18312018475493194258,
10441042983020688038,
11906429509033078491,
13577481089208229636,
15483062540952967857,
17656089820489710741,
10067049297406417285,
11479946305982273645,
13091141534609253262,
14928465875303384176,
17023656248839843776,
9706451905352742522,
11068739548514628780,
12622222454457155586,
14393734624570008992,
16413876176725623927,
9358770957364699929,
10672262040895386089,
12170099854822007158,
13878157218102970303,
15825938165500818674,
18047087583901234911,
10289986187706530766,
11734172092969064177,
13381047573408163051,
15259059841903798156,
17400648639910404101,
9921403291771844100,
11313859076748534537,
12901744183172431346,
14712486856947913357,
16777364861891103792,
9566022877229980327,
10908601492662859386,
12439609234991117453,
14185491882103974832,
16176406841720334625,
9223372036854775808,
10517860061584293888,
11994027762626592768,
13677373641439044901,
15596974880318657672,
17785989605508530085,
10141114821132365302,
11564406827668344530,
13187455978423603575,
15038297923484984581,
17148903079221976570,
9777864433756263024,
11150174730505647564,
12715086956165281921,
14499632535849309517,
16534636719312342666,
9427625519601420913,
10750780249562856814,
12259637989871837542,
13980261911578014597,
15942373117198559022,
18179864026545065558,
10365691907784965713,
11820503010388934534,
13479494920515287357,
15371324143524666656,
17528669087274082029,
9994397265397337538,
11397097657699641734,
12996665188491343910,
14820729899390519784,
16900799671687597041,
9636402237998480121,
10988858503312433354,
12531130210573617469,
14289857705148955482,
];
const BASE18_LARGE_EXPONENT: [i32; 75] = [
-1202,
-1173,
-1144,
-1114,
-1085,
-1056,
-1027,
-998,
-968,
-939,
-910,
-881,
-852,
-822,
-793,
-764,
-735,
-706,
-676,
-647,
-618,
-589,
-560,
-531,
-501,
-472,
-443,
-414,
-385,
-355,
-326,
-297,
-268,
-239,
-209,
-180,
-151,
-122,
-93,
-63,
-34,
-5,
24,
53,
82,
112,
141,
170,
199,
228,
258,
287,
316,
345,
374,
404,
433,
462,
491,
520,
549,
579,
608,
637,
666,
695,
725,
754,
783,
812,
841,
871,
900,
929,
958,
];
const BASE18_SMALL_INT_POWERS: [u64; 7] = [1, 18, 324, 5832, 104976, 1889568, 34012224];
const BASE18_STEP: i32 = 7;
const BASE18_BIAS: i32 = 273;
const BASE19_SMALL_MANTISSA: [u64; 7] = [
9223372036854775808,
10952754293765046272,
13006395723845992448,
15445094922067116032,
18341050219954700288,
10889998568098103296,
12931873299616497664,
];
const BASE19_SMALL_EXPONENT: [i32; 7] = [
-63,
-59,
-55,
-51,
-47,
-42,
-38,
];
const BASE19_LARGE_MANTISSA: [u64; 74] = [
11480257701232751935,
9557118560717499270,
15912276110980153383,
13246698229359450470,
11027650146079950824,
18360660994723606251,
15284936849533635885,
12724449003299523561,
10592886580523254223,
17636794501472422448,
14682330350779734844,
12222789379976654044,
10175263507767080823,
16941466343535111364,
14103481529006456400,
11740907617180962231,
9774105166278679843,
16273551401031031665,
13547453741119703900,
11278023975525727060,
9388762436329270793,
15631968911773566269,
13013347271048440836,
10833389456740556437,
18037223579289291900,
15015680722474235794,
12500297873901968386,
10406284591707172986,
17326108560931302042,
14423689608892845377,
12007475377523598784,
9996018276276719532,
16643029152771930644,
13855037662215477149,
11534082339177879647,
9601926652984804576,
15986880054797934009,
13308804739049304804,
11079352755197736707,
9223372036854775808,
15356599543294590976,
12784106972526145936,
10642550821503597582,
17719483767102098773,
14751167752856224795,
12280095342105548712,
10222969742988875833,
17020895596425699999,
14169605026128220038,
11795954299763191941,
9819930589845265884,
16349849166729084322,
13610970328610229813,
11330900450341615431,
9432781198977253334,
15705258648723927251,
13074359725955544955,
10884181283927938347,
18121790237456409263,
15086081021789818522,
12558904921302722743,
10455073958207408827,
17407341190420966318,
14491314386248513408,
12063771850272711708,
10042884128822494706,
16721059197198717605,
13919996342176535757,
11588159331358018389,
9646944825844903597,
16061833775630288054,
13371202432132867541,
11131297769520092558,
9266615374542536521,
];
const BASE19_LARGE_EXPONENT: [i32; 74] = [
-1223,
-1193,
-1164,
-1134,
-1104,
-1075,
-1045,
-1015,
-985,
-956,
-926,
-896,
-866,
-837,
-807,
-777,
-747,
-718,
-688,
-658,
-628,
-599,
-569,
-539,
-510,
-480,
-450,
-420,
-391,
-361,
-331,
-301,
-272,
-242,
-212,
-182,
-153,
-123,
-93,
-63,
-34,
-4,
26,
55,
85,
115,
145,
174,
204,
234,
264,
293,
323,
353,
383,
412,
442,
472,
501,
531,
561,
591,
620,
650,
680,
710,
739,
769,
799,
829,
858,
888,
918,
948,
];
const BASE19_SMALL_INT_POWERS: [u64; 7] = [1, 19, 361, 6859, 130321, 2476099, 47045881];
const BASE19_STEP: i32 = 7;
const BASE19_BIAS: i32 = 273;
const BASE20_SMALL_MANTISSA: [u64; 7] = [
9223372036854775808,
11529215046068469760,
14411518807585587200,
18014398509481984000,
11258999068426240000,
14073748835532800000,
17592186044416000000,
];
const BASE20_SMALL_EXPONENT: [i32; 7] = [
-63,
-59,
-55,
-51,
-46,
-42,
-38,
];
const BASE20_LARGE_MANTISSA: [u64; 72] = [
11896135267822264502,
14181298336770849826,
16905424996341287883,
10076418516839318205,
12012026926087520367,
14319451959237480602,
17070116948172426941,
10174582569701926077,
12129047596099288555,
14458951468586073584,
17236413322193710308,
10273702932711667006,
12247208276643356092,
14599809976391024699,
17404329748619824289,
10373788922202482396,
12366520073655226703,
14742040721959145907,
17573882009934360870,
10474849945267653984,
12486994201263968925,
14885657073574029118,
17745086042373215101,
10576895500643977583,
12608641982846233347,
15030672529752532658,
17917957937422433684,
10679935179604550411,
12731474852090538039,
15177100720513508366,
18092513943330655534,
10783978666860255917,
12855504354071922204,
15324955408658888583,
18268770466636286477,
10889035741470030830,
12980742146337069071,
15474250491067253436,
9223372036854775808,
10995116277760000000,
13107200000000000000,
15625000000000000000,
9313225746154785156,
11102230246251565404,
13234889800848442797,
15777218104420236108,
9403954806578300063,
11210387714598536567,
13363823550460978230,
15930919111324522770,
9495567745759798747,
11319598848533390459,
13494013367335069727,
16086117467087590369,
9588073174409622174,
11429873912822749822,
13625471488026082303,
16242827758820155028,
9681479787123295682,
11541223272232169725,
13758210268297397763,
16401064715739962772,
9775796363198734982,
11653657392500323036,
13892242184281734271,
16560843210556190337,
9871031767461413346,
11767186841322676356,
14027579833653779454,
16722178260867332761,
9967194951097567535,
11881822289344748896,
];
const BASE20_LARGE_EXPONENT: [i32; 72] = [
-1213,
-1183,
-1153,
-1122,
-1092,
-1062,
-1032,
-1001,
-971,
-941,
-911,
-880,
-850,
-820,
-790,
-759,
-729,
-699,
-669,
-638,
-608,
-578,
-548,
-517,
-487,
-457,
-427,
-396,
-366,
-336,
-306,
-275,
-245,
-215,
-185,
-154,
-124,
-94,
-63,
-33,
-3,
27,
58,
88,
118,
148,
179,
209,
239,
269,
300,
330,
360,
390,
421,
451,
481,
511,
542,
572,
602,
632,
663,
693,
723,
753,
784,
814,
844,
874,
905,
935,
];
const BASE20_SMALL_INT_POWERS: [u64; 7] = [1, 20, 400, 8000, 160000, 3200000, 64000000];
const BASE20_STEP: i32 = 7;
const BASE20_BIAS: i32 = 266;
const BASE21_SMALL_MANTISSA: [u64; 7] = [
9223372036854775808,
12105675798371893248,
15888699485363109888,
10426959037269540864,
13685383736416272384,
17962066154046357504,
11787605913592922112,
];
const BASE21_SMALL_EXPONENT: [i32; 7] = [
-63,
-59,
-55,
-50,
-46,
-42,
-37,
];
const BASE21_LARGE_MANTISSA: [u64; 72] = [
14408615719666154271,
12084465783258517647,
10135207719324857823,
17000740844691866712,
14258473889848767691,
11958542249702993646,
10029596003240171126,
16823588341749525709,
14109896580142091329,
11833930874797054029,
9925084790952075138,
16648281817731599335,
13962867487806377083,
11710617985478380225,
9821662614901370847,
16474802037018309233,
13817370479981011975,
11588590051161810088,
9719318127024052612,
16303129964430447286,
13673389591914329770,
11467833682254685835,
9618040097506134632,
16133246763140728476,
13530909025211868449,
11348335628687672485,
9517817413551452467,
15965133792606908039,
13389913146102881332,
11230082778460885572,
9418639078162304415,
15798772606526436117,
13250386483724911652,
11113062156205168633,
9320494208932798947,
15634144950812425486,
13112313728426242332,
10997260921758362571,
9223372036854775808,
15471232761590710272,
12975679730086034724,
10882666368756410705,
18254523810272339491,
15310018163217775871,
12840469496451971963,
10769265923239144897,
18064306536063374465,
15150483466319342608,
12706668191495224563,
10657047142270599779,
17876071379371335714,
14992611165849387896,
12574261133782557711,
10545997712573703694,
17689797685974006860,
14836383939169393936,
12443233794865401683,
10436105449179196548,
17505465016871978304,
14681784644147610193,
12313571797685708585,
10327358294088626305,
17323053146045965028,
14528796317278122096,
12185260914998420522,
10219744314951277448,
17142542058237493769,
14377402171819519570,
12058287067810376090,
10113251703754886210,
16963911946752716066,
14227585595952961160,
];
const BASE21_LARGE_EXPONENT: [i32; 72] = [
-1232,
-1201,
-1170,
-1140,
-1109,
-1078,
-1047,
-1017,
-986,
-955,
-924,
-894,
-863,
-832,
-801,
-771,
-740,
-709,
-678,
-648,
-617,
-586,
-555,
-525,
-494,
-463,
-432,
-402,
-371,
-340,
-309,
-279,
-248,
-217,
-186,
-156,
-125,
-94,
-63,
-33,
-2,
29,
59,
90,
121,
152,
182,
213,
244,
275,
305,
336,
367,
398,
428,
459,
490,
521,
551,
582,
613,
644,
674,
705,
736,
767,
797,
828,
859,
890,
920,
951,
];
const BASE21_SMALL_INT_POWERS: [u64; 7] = [1, 21, 441, 9261, 194481, 4084101, 85766121];
const BASE21_STEP: i32 = 7;
const BASE21_BIAS: i32 = 266;
const BASE22_SMALL_MANTISSA: [u64; 7] = [
9223372036854775808,
12682136550675316736,
17437937757178560512,
11988582208060260352,
16484300536082857984,
11332956618556964864,
15582815350515826688,
];
const BASE22_SMALL_EXPONENT: [i32; 7] = [
-63,
-59,
-55,
-50,
-46,
-41,
-37,
];
const BASE22_LARGE_MANTISSA: [u64; 70] = [
9269587019009961312,
10766865452458105492,
12505993140104023937,
14526035001637582317,
16872365953260472216,
9798845067792082715,
11381612386618310709,
13220037629231758864,
15355416173176400877,
17835713669231780592,
10358321731667433590,
12031459025026523680,
13974851334106036811,
16232151844936756579,
9427032431967498649,
10949742378252536811,
12718409426865212084,
14772762021382712235,
17158945778190527545,
9965280013064351107,
11574930887071326019,
13444582075449265201,
15616230364311619568,
18138656108661462534,
10534259477248206780,
12235815274209166465,
14212216411407346527,
16507857531195957209,
9587152080358667750,
11135725497779554116,
12934433638113158426,
15023679738882972932,
17450393207123747022,
10134541882409419905,
11771532933066741091,
13672940444874950532,
15881474526053323426,
9223372036854775808,
10713185553479630848,
12443642546855641088,
14453613172379218947,
16788246122479815273,
9749991386498543747,
11324867570234788254,
13154127055020322136,
15278859333807672616,
17746790917089950882,
10306678691583236909,
11971474296148943805,
13905177517602390611,
16151223902158337584,
9380032480974399852,
10895150717634104284,
12654999798852712250,
14699110095811391320,
17073397158676562691,
9915596544207462992,
11517222250937216925,
13377551999629643946,
15538373194824147716,
18048222989401488392,
10481739271897017716,
12174811695150892652,
14141359174025375600,
16425555014410689631,
9539353827706830891,
11080206589104387250,
12869946987462278079,
14948776823616759120,
17363391530672110525,
];
const BASE22_LARGE_EXPONENT: [i32; 70] = [
-1218,
-1187,
-1156,
-1125,
-1094,
-1062,
-1031,
-1000,
-969,
-938,
-906,
-875,
-844,
-813,
-781,
-750,
-719,
-688,
-657,
-625,
-594,
-563,
-532,
-501,
-469,
-438,
-407,
-376,
-344,
-313,
-282,
-251,
-220,
-188,
-157,
-126,
-95,
-63,
-32,
-1,
30,
61,
93,
124,
155,
186,
217,
249,
280,
311,
342,
374,
405,
436,
467,
498,
530,
561,
592,
623,
654,
686,
717,
748,
779,
811,
842,
873,
904,
935,
];
const BASE22_SMALL_INT_POWERS: [u64; 7] = [1, 22, 484, 10648, 234256, 5153632, 113379904];
const BASE22_STEP: i32 = 7;
const BASE22_BIAS: i32 = 259;
const BASE23_SMALL_MANTISSA: [u64; 7] = [
9223372036854775808,
13258597302978740224,
9529616811515969536,
13698824166554206208,
9846029869710835712,
14153667937709326336,
10172948830228578304,
];
const BASE23_SMALL_EXPONENT: [i32; 7] = [
-63,
-59,
-54,
-50,
-45,
-41,
-36,
];
const BASE23_LARGE_MANTISSA: [u64; 69] = [
9630971713765025029,
15269861356524917016,
12105147475110827234,
9596327823341159083,
15214933627595239789,
12061603644316153100,
9561808551614073801,
15160203481036150549,
12018216446491393101,
9527413450313687580,
15105670206117496642,
11974985318206853149,
9493142072782406120,
15051333094665716613,
11931909698059570948,
9458993973969322090,
14997191441054643808,
11888989026666025574,
9424968710424435661,
14943244542196343052,
11846222746654873270,
9391065840292895827,
14889491697531980297,
11803610302659709381,
9357284923309262442,
14835932209022725101,
11761151141311856318,
9323625520791788901,
14782565381140685845,
11718844711233177467,
9290087195636725377,
14729390520859877547,
11676690463028916948,
9256669512312642559,
14676406937647222172,
11634687849280565129,
9223372036854775808,
14623613943453581312,
11592836324538749809,
18380388673718779295,
14571010852704821123,
11551135345316152959,
18314271962956325083,
14518596982292909406,
11509584370080452960,
18248393082825183718,
14466371651567044709,
11468182859247292218,
18182751177816837937,
14414334182324817337,
11426930275173270071,
18117345395500148774,
14362483898803402166,
11385826082148960918,
18052174886510285819,
14310820127670783127,
11344869746391957446,
17987238804537697299,
14259342198017009262,
11304060736039938888,
17922536306317119829,
14208049441345482237,
11263398521143764220,
17858066551616627705,
14156941191564275184,
11222882573660590193,
17793828703226721580,
14106016784977482782,
11182512367447014130,
];
const BASE23_LARGE_EXPONENT: [i32; 69] = [
-1203,
-1172,
-1140,
-1108,
-1077,
-1045,
-1013,
-982,
-950,
-918,
-887,
-855,
-823,
-792,
-760,
-728,
-697,
-665,
-633,
-602,
-570,
-538,
-507,
-475,
-443,
-412,
-380,
-348,
-317,
-285,
-253,
-222,
-190,
-158,
-127,
-95,
-63,
-32,
0,
31,
63,
95,
126,
158,
190,
221,
253,
285,
316,
348,
380,
411,
443,
475,
506,
538,
570,
601,
633,
665,
696,
728,
760,
791,
823,
855,
886,
918,
950,
];
const BASE23_SMALL_INT_POWERS: [u64; 7] = [1, 23, 529, 12167, 279841, 6436343, 148035889];
const BASE23_STEP: i32 = 7;
const BASE23_BIAS: i32 = 252;
const BASE24_SMALL_MANTISSA: [u64; 7] = [
9223372036854775808,
13835058055282163712,
10376293541461622784,
15564440312192434176,
11673330234144325632,
17509995351216488448,
13132496513412366336,
];
const BASE24_SMALL_EXPONENT: [i32; 7] = [
-63,
-59,
-54,
-50,
-45,
-41,
-36,
];
const BASE24_LARGE_MANTISSA: [u64; 68] = [
13878157218102970303,
14820082927730076197,
15825938165500818674,
16900061898413227754,
18047087583901234911,
9635981578611328308,
10289986187706530766,
10988378804938565813,
11734172092969064177,
12530583187169601247,
13381047573408163051,
14289233907736158492,
15259059841903798156,
16294708922970511019,
17400648639910404101,
9290824847530286564,
9921403291771844100,
10594779784719249534,
11313859076748534537,
12081743066820822770,
12901744183172431346,
13777399672167044607,
14712486856947913357,
15711039431711468023,
16777364861891103792,
17916062965310470700,
9566022877229980327,
10215279312745101062,
10908601492662859386,
11648980207252770253,
12439609234991117453,
13283899119592565366,
14185491882103974832,
15148276731524117655,
16176406841720334625,
17274317267012876867,
9223372036854775808,
9849372385059274752,
10517860061584293888,
11231718727873462272,
11994027762626592768,
12808075545343924992,
13677373641439044901,
14605671950110933202,
15596974880318657672,
16655558624637160317,
17785989605508530085,
9496572086730262523,
10141114821132365302,
10829403375886954548,
11564406827668344530,
12349295767632162835,
13187455978423603575,
14082503039459189950,
15038297923484984581,
16058963651690264296,
17148903079221976570,
18312817887821515019,
9777864433756263024,
10441498787414525016,
11150174730505647564,
11906949284968677354,
12715086956165281921,
13578073815006577911,
14499632535849309517,
15483738455030488239,
16534636719312342666,
17656860598210983110,
];
const BASE24_LARGE_EXPONENT: [i32; 68] = [
-1219,
-1187,
-1155,
-1123,
-1091,
-1058,
-1026,
-994,
-962,
-930,
-898,
-866,
-834,
-802,
-770,
-737,
-705,
-673,
-641,
-609,
-577,
-545,
-513,
-481,
-449,
-417,
-384,
-352,
-320,
-288,
-256,
-224,
-192,
-160,
-128,
-96,
-63,
-31,
1,
33,
65,
97,
129,
161,
193,
225,
257,
290,
322,
354,
386,
418,
450,
482,
514,
546,
578,
610,
643,
675,
707,
739,
771,
803,
835,
867,
899,
931,
];
const BASE24_SMALL_INT_POWERS: [u64; 7] = [1, 24, 576, 13824, 331776, 7962624, 191102976];
const BASE24_STEP: i32 = 7;
const BASE24_BIAS: i32 = 252;
const BASE25_SMALL_MANTISSA: [u64; 7] = [
9223372036854775808,
14411518807585587200,
11258999068426240000,
17592186044416000000,
13743895347200000000,
10737418240000000000,
16777216000000000000,
];
const BASE25_SMALL_EXPONENT: [i32; 7] = [
-63,
-59,
-54,
-50,
-45,
-40,
-36,
];
const BASE25_LARGE_MANTISSA: [u64; 68] = [
15492890949478498119,
11008361120075348168,
15643822052986917253,
11115604119273511155,
15796223521069679172,
11223891875338892399,
15950109677957715915,
11333234566249726012,
16105494987428025427,
11443642469137689536,
16262394054163123565,
11555125961253852697,
16420821625123739831,
11667695520944036383,
16580792590934885855,
11781361728633673532,
16742321987285426889,
11896135267822264502,
16905424996341287883,
12012026926087520367,
17070116948172426941,
12129047596099288555,
17236413322193710308,
12247208276643356092,
17404329748619824289,
12366520073655226703,
17573882009934360870,
12486994201263968925,
17745086042373215101,
12608641982846233347,
17917957937422433684,
12731474852090538039,
18092513943330655534,
12855504354071922204,
18268770466636286477,
12980742146337069071,
9223372036854775808,
13107200000000000000,
9313225746154785156,
13234889800848442797,
9403954806578300063,
13363823550460978230,
9495567745759798747,
13494013367335069727,
9588073174409622174,
13625471488026082303,
9681479787123295682,
13758210268297397763,
9775796363198734982,
13892242184281734271,
9871031767461413346,
14027579833653779454,
9967194951097567535,
14164235936814247246,
10064294952495520794,
14302223338085469768,
10162340898095201970,
14441555006918636608,
10261342003245940623,
14582244039112794984,
10361307573072618726,
14724303658045725350,
10462247003350260393,
14867747215916808149,
10564169781387141817,
15012588195001998509,
10667085486916504429,
15158840208921026870,
];
const BASE25_LARGE_EXPONENT: [i32; 68] = [
-1234,
-1201,
-1169,
-1136,
-1104,
-1071,
-1039,
-1006,
-974,
-941,
-909,
-876,
-844,
-811,
-779,
-746,
-714,
-681,
-649,
-616,
-584,
-551,
-519,
-486,
-454,
-421,
-389,
-356,
-324,
-291,
-259,
-226,
-194,
-161,
-129,
-96,
-63,
-31,
2,
34,
67,
99,
132,
164,
197,
229,
262,
294,
327,
359,
392,
424,
457,
489,
522,
554,
587,
619,
652,
684,
717,
749,
782,
814,
847,
879,
912,
944,
];
const BASE25_SMALL_INT_POWERS: [u64; 7] = [1, 25, 625, 15625, 390625, 9765625, 244140625];
const BASE25_STEP: i32 = 7;
const BASE25_BIAS: i32 = 252;
const BASE26_SMALL_MANTISSA: [u64; 7] = [
9223372036854775808,
14987979559889010688,
12177733392409821184,
9894408381332979712,
16078413619666092032,
13063711065978699776,
10614265241107693568,
];
const BASE26_SMALL_EXPONENT: [i32; 7] = [
-63,
-59,
-54,
-49,
-45,
-40,
-35,
];
const BASE26_LARGE_MANTISSA: [u64; 67] = [
12105269954044049440,
11318739317371282802,
10583312905946974966,
9895670261906581517,
9252706671590202790,
17303038295456506514,
16178786644847745028,
15127582383507515360,
14144679313308326113,
13225639616708097270,
12366313819957994305,
11562822058185475244,
10811536557764206566,
10109065256878566708,
9452236490329416245,
17676169338865748372,
16527673784713390059,
15453800848879553322,
14449701983936623969,
13510843673109724761,
12632986961401522264,
11812168316666510159,
11044681734222321153,
10327062004200202236,
9656069066086567364,
18057346759632441273,
16884084494735168740,
15787054046203585657,
14761302310200400353,
13802198007013635263,
12905410770780760221,
12066891597841972649,
11282854565446737172,
10549759738273355365,
9864297185584324446,
9223372036854775808,
17248181016800002048,
16127493675824287744,
15079622135830712445,
14099835245963182583,
13183709258266090507,
12327107854416477244,
11526163470203963629,
10777259833438283283,
10077015636442889080,
9422269269415772631,
17620129091456925542,
16475274709425560342,
15404806363345084091,
14403890877545881062,
13468009108242878856,
12592935539554553092,
11774719205254957782,
11009665850120294209,
10294321250328313309,
9625455617601982106,
18000098033363922638,
16830555460575262708,
15737003020008648959,
14714503311068774005,
13758439736979533044,
12864495660801764695,
12028634915772762381,
11247083581971537298,
10516312947031287874,
9833023573966516058,
18388260808361729691,
];
const BASE26_LARGE_EXPONENT: [i32; 67] = [
-1215,
-1182,
-1149,
-1116,
-1083,
-1051,
-1018,
-985,
-952,
-919,
-886,
-853,
-820,
-787,
-754,
-722,
-689,
-656,
-623,
-590,
-557,
-524,
-491,
-458,
-425,
-393,
-360,
-327,
-294,
-261,
-228,
-195,
-162,
-129,
-96,
-63,
-31,
2,
35,
68,
101,
134,
167,
200,
233,
266,
298,
331,
364,
397,
430,
463,
496,
529,
562,
595,
627,
660,
693,
726,
759,
792,
825,
858,
891,
924,
956,
];
const BASE26_SMALL_INT_POWERS: [u64; 7] = [1, 26, 676, 17576, 456976, 11881376, 308915776];
const BASE26_STEP: i32 = 7;
const BASE26_BIAS: i32 = 245;
const BASE27_SMALL_MANTISSA: [u64; 6] = [
9223372036854775808,
15564440312192434176,
13132496513412366336,
11080543933191684096,
9349208943630483456,
15776790092376440832,
];
const BASE27_SMALL_EXPONENT: [i32; 6] = [
-63,
-59,
-54,
-49,
-44,
-40,
];
const BASE27_LARGE_MANTISSA: [u64; 76] = [
16362187946641408838,
11807394875954316034,
17041067394086403622,
12297292543386873229,
17748114058878258402,
12807516432401518638,
9242248309993244326,
13338909893173747895,
9625716122873707062,
13892351267110242231,
10025094302862174179,
14468755338661289290,
10441042983020688038,
15069074847369989965,
10874249685827050127,
15694302062657520659,
11325430459582219446,
16345470423947416967,
11795331061968106016,
17023656248839843776,
12284728192712064755,
17729980512159296735,
12794430777395563548,
9232805349408163458,
13325281304529035642,
9615881366772943927,
13878157218102970303,
10014851495355986817,
14453972367916992462,
10430375193750279268,
15053678520084183432,
10863139281980340679,
15678266930207358578,
11313859076748534537,
16328769981827608423,
11783279573783601017,
17006262892853298360,
12272176679245716810,
17711865492790087155,
12781358492223474271,
9223372036854775808,
13311666640442621952,
9606056659007943744,
13863977671394362375,
10004619153098548172,
14439204501182606065,
10419718303939637392,
15038297923484984581,
10852040229820157048,
15662248181121787524,
11302299516591361707,
16312086602830473207,
11771240398807322073,
16988887307951181138,
12259637989871837542,
17693768981840924725,
12768299563225066619,
18427896724951050158,
13298065886687551351,
9596241989312152815,
13849812612167175924,
9994397265397337538,
14424451723026109070,
10409072302452601000,
15022933041500086259,
10840952517748290136,
15646245798661648271,
11290751767031273467,
16295420269522331823,
11759213524458657188,
16971529475976476179,
12247112111487835932,
17675690960401445308,
12755253976754113245,
18409068632845853217,
13284479029051404288,
];
const BASE27_LARGE_EXPONENT: [i32; 76] = [
-1205,
-1176,
-1148,
-1119,
-1091,
-1062,
-1033,
-1005,
-976,
-948,
-919,
-891,
-862,
-834,
-805,
-777,
-748,
-720,
-691,
-663,
-634,
-606,
-577,
-548,
-520,
-491,
-463,
-434,
-406,
-377,
-349,
-320,
-292,
-263,
-235,
-206,
-178,
-149,
-121,
-92,
-63,
-35,
-6,
22,
51,
79,
108,
136,
165,
193,
222,
250,
279,
307,
336,
364,
393,
421,
450,
479,
507,
536,
564,
593,
621,
650,
678,
707,
735,
764,
792,
821,
849,
878,
906,
935,
];
const BASE27_SMALL_INT_POWERS: [u64; 6] = [1, 27, 729, 19683, 531441, 14348907];
const BASE27_STEP: i32 = 6;
const BASE27_BIAS: i32 = 240;
const BASE28_SMALL_MANTISSA: [u64; 6] = [
9223372036854775808,
16140901064495857664,
14123288431433875456,
12357877377504641024,
10813142705316560896,
9461499867151990784,
];
const BASE28_SMALL_EXPONENT: [i32; 6] = [
-63,
-59,
-54,
-49,
-44,
-39,
];
const BASE28_LARGE_MANTISSA: [u64; 76] = [
10853684694473876180,
9742165760957008810,
17488953546307848045,
15697920957714630238,
14090306875260685218,
12647327526607851831,
11352122773573968201,
10189559113984709052,
18292105715960495534,
16418822825447359765,
14737381642082644874,
13228135778880165762,
11873450822826176619,
10657498289906897377,
9566070681070377880,
17172830956378919788,
15414172280784786485,
13835616719528574716,
12418720027433908743,
11146926822720122755,
10005377149705503250,
17961465702601665525,
16122043445170466212,
14470995249030000148,
12989029846596759700,
11658831576707932907,
10464858064026730335,
9393158617970892313,
16862422458582420498,
15135552519453149331,
13585530230416439557,
12194244736314878063,
10945439903127358164,
9824524377159351811,
17636802191900948811,
15830628517722738088,
14209423938610553080,
12754245887402290033,
11448091693168579255,
10275699917675706335,
9223372036854775808,
16557624767515983872,
14861968965709594624,
13339964194082398208,
11973826961285400900,
10747594971986893695,
9646940619348801089,
17318007155239366140,
15544481077627229210,
13952580675520064463,
12523705779222565186,
11241161050565762112,
10089960910324183248,
18113308885783841476,
16258336464718499495,
14593330587292989709,
13098836900821174211,
11757393360479052160,
10553326198326110898,
9472566787009190529,
17004974516675479989,
15263505912112072336,
13700379997665963732,
12297332812083457696,
11037970794744924274,
9907579239127697723,
17785900724855568076,
15964457964924108341,
14329547997401095751,
12862068117875988113,
11544871917724549298,
10362568941103939059,
9301344858947275744,
16697600117649658875,
14987609529429357277,
13452737987730670580,
];
const BASE28_LARGE_EXPONENT: [i32; 76] = [
-1217,
-1188,
-1160,
-1131,
-1102,
-1073,
-1044,
-1015,
-987,
-958,
-929,
-900,
-871,
-842,
-813,
-785,
-756,
-727,
-698,
-669,
-640,
-612,
-583,
-554,
-525,
-496,
-467,
-438,
-410,
-381,
-352,
-323,
-294,
-265,
-237,
-208,
-179,
-150,
-121,
-92,
-63,
-35,
-6,
23,
52,
81,
110,
138,
167,
196,
225,
254,
283,
311,
340,
369,
398,
427,
456,
485,
513,
542,
571,
600,
629,
658,
686,
715,
744,
773,
802,
831,
860,
888,
917,
946,
];
const BASE28_SMALL_INT_POWERS: [u64; 6] = [1, 28, 784, 21952, 614656, 17210368];
const BASE28_STEP: i32 = 6;
const BASE28_BIAS: i32 = 240;
const BASE29_SMALL_MANTISSA: [u64; 6] = [
9223372036854775808,
16717361816799281152,
15150109146474348544,
13729786413992378368,
12442618937680592896,
11276123412273037312,
];
const BASE29_SMALL_EXPONENT: [i32; 6] = [
-63,
-59,
-54,
-49,
-44,
-39,
];
const BASE29_LARGE_MANTISSA: [u64; 76] = [
9780142334064946636,
10835857583212112985,
12005531775819627369,
13301466184228767173,
14737289938837575007,
16328103363438049788,
18090636782853846909,
10021713236516230810,
11103504802015131117,
12302070113036945059,
13630014285094069421,
15101303090037955289,
16731409831799452344,
9268739038298839376,
10269250974512215384,
11377762945074294339,
12605932989231929836,
13966677570638048918,
15474307417689145256,
17144678027117236568,
9497678206828984163,
10522902929736936910,
11658795303156142066,
12917301321555931503,
14311656487072982013,
15856525005124406387,
17568154005459773215,
9732272205284828726,
10782820124222926001,
11946769200332301461,
13236360495839591806,
14665156431661011058,
16248183421166822582,
18002089900515211938,
9972660708767378680,
11049157310268331325,
12241856093602695018,
13563300476969856592,
15027387875005778139,
16649515855621676607,
9223372036854775808,
10218986842372440064,
11322073062575009312,
12544231674979455490,
13898315921993315819,
15398566486364679514,
17060761258115507449,
9451190634016324153,
10471397266405980105,
11601729872662437745,
12854075976092328003,
14241606296013212103,
15778913262056350490,
17482164480364512070,
9684636382831873707,
10730042263704319491,
11888294245613666403,
13171573475377840424,
14593375990949121808,
16168654657039833397,
17913976421956996862,
9923848274745194421,
10995075829111145761,
12181936799210906401,
13496913207916061440,
14953834447230017102,
16568022719743769659,
18356454179736676324,
10168968734308426004,
11266655761164621625,
12482832365519782645,
13830288877980342143,
15323196278493163895,
16977255230225892037,
9404930600437880197,
10420143703980341466,
];
const BASE29_LARGE_EXPONENT: [i32; 76] = [
-1229,
-1200,
-1171,
-1142,
-1113,
-1084,
-1055,
-1025,
-996,
-967,
-938,
-909,
-880,
-850,
-821,
-792,
-763,
-734,
-705,
-676,
-646,
-617,
-588,
-559,
-530,
-501,
-472,
-442,
-413,
-384,
-355,
-326,
-297,
-268,
-238,
-209,
-180,
-151,
-122,
-93,
-63,
-34,
-5,
24,
53,
82,
111,
141,
170,
199,
228,
257,
286,
315,
345,
374,
403,
432,
461,
490,
519,
549,
578,
607,
636,
665,
694,
723,
753,
782,
811,
840,
869,
898,
928,
957,
];
const BASE29_SMALL_INT_POWERS: [u64; 6] = [1, 29, 841, 24389, 707281, 20511149];
const BASE29_STEP: i32 = 6;
const BASE29_BIAS: i32 = 240;
const BASE30_SMALL_MANTISSA: [u64; 6] = [
9223372036854775808,
17293822569102704640,
16212958658533785600,
15199648742375424000,
14249670695976960000,
13359066277478400000,
];
const BASE30_SMALL_EXPONENT: [i32; 6] = [
-63,
-59,
-54,
-49,
-44,
-39,
];
const BASE30_LARGE_MANTISSA: [u64; 74] = [
15921395853562858335,
10809579470425214363,
14677985448278451843,
9965385675239368708,
13531681443098000788,
18374241463874359754,
12474900136854879801,
16939271613521887687,
11500650091336533543,
15616368347004676150,
10602485877430447296,
14396779620362065880,
9774465433549085656,
13272436896445757604,
18022221508452589239,
12235901765210495847,
16614743297618723424,
11280316732790367097,
15317184660964044954,
10399359853791807565,
14120961229157126909,
9587202906660312336,
13018159044823362852,
17676945670836105047,
12001482205502242389,
16296432405358431306,
11064204595523231124,
15023732837543702665,
10200125387468709836,
13850427060322257636,
9403528018831206315,
12768752734601403407,
17338284744926585040,
11771553735296689434,
15984219821228248249,
10852232807944894743,
14735903063773789011,
10004707922685045925,
13585075876931470780,
9223372036854775808,
12524124635136000000,
17006112000000000000,
11546030312776565551,
15677988711770840524,
10644322047830505987,
14453587630518598230,
9813034332029575584,
13324808381590173768,
18093335088676282534,
12284183203843431517,
16680303133282552614,
11324827544542942993,
15377624481863911156,
10440394512637323916,
14176680892170610158,
9625032889090827484,
13069527179276967861,
17746696832949127203,
12048838651943871501,
16360736223435182728,
11107862654034279481,
15083014731837417449,
10240373890390132852,
13905079227116716745,
9440633241616270046,
12819136740897336720,
17406699590597596894,
11818002910861417777,
16047291684929232224,
10895054450550498712,
14794049215412351417,
10044185331124443731,
13638680998961850032,
9259766385185707988,
];
const BASE30_LARGE_EXPONENT: [i32; 74] = [
-1212,
-1182,
-1153,
-1123,
-1094,
-1065,
-1035,
-1006,
-976,
-947,
-917,
-888,
-858,
-829,
-800,
-770,
-741,
-711,
-682,
-652,
-623,
-593,
-564,
-535,
-505,
-476,
-446,
-417,
-387,
-358,
-328,
-299,
-270,
-240,
-211,
-181,
-152,
-122,
-93,
-63,
-34,
-5,
25,
54,
84,
113,
143,
172,
201,
231,
260,
290,
319,
349,
378,
408,
437,
466,
496,
525,
555,
584,
614,
643,
673,
702,
731,
761,
790,
820,
849,
879,
908,
938,
];
const BASE30_SMALL_INT_POWERS: [u64; 6] = [1, 30, 900, 27000, 810000, 24300000];
const BASE30_STEP: i32 = 6;
const BASE30_BIAS: i32 = 234;
const BASE31_SMALL_MANTISSA: [u64; 6] = [
9223372036854775808,
17870283321406128128,
17311836967612186624,
16770842062374305792,
16246753247925108736,
15739042208927449088,
];
const BASE31_SMALL_EXPONENT: [i32; 6] = [
-63,
-59,
-54,
-49,
-44,
-39,
];
const BASE31_LARGE_MANTISSA: [u64; 74] = [
15172192345302428421,
12540609161645107233,
10365468257053156090,
17135201456813756829,
14163138687236953263,
11706573627364173290,
9676094340331131706,
15995594383677739926,
13221193938792609146,
10928007110853986174,
18065136926019727780,
14931778907414090897,
12341894902482781431,
10201220546354171409,
16863682839241173595,
13938714372965575021,
11521075213714088050,
9522770215989197442,
15742133595063495983,
13011695363011784957,
10754845599386459585,
17778882864941161542,
14695174979700806287,
12146329402386737855,
10039575449430160254,
16596466614020050649,
13717846210614220387,
11338516145303865769,
9371875613960541536,
15492689060539222513,
12805516430937677459,
10584427946771654325,
17497164689077279120,
14462320197950402007,
11953862767183809017,
9880491726141866768,
16333484606893641287,
13500477850600094178,
11158849846261135900,
9223372036854775808,
15247197139898466304,
12602604540616796176,
10416710674748495795,
17219910524322248562,
14233155154461633068,
11764445893307051548,
9723928789827359386,
16074669723871456105,
13286553836236866995,
10982030478739077827,
18154443194596327488,
15005595201356001156,
12402907923608447627,
10251650993997756459,
16947049635463054782,
14007621382887632827,
11578030455268066882,
9569846696947249770,
15819955934111728582,
13076019589586139267,
10808012931221917147,
17866774016535005152,
14767821605568725557,
12206375631777172937,
10089206793225315915,
16678512408132988469,
13785661343319529298,
11394568893327831301,
9418206136893990095,
15569278253075119325,
12868821397533098208,
10636752807015729117,
17583663147154342787,
14533815689909759814,
];
const BASE31_LARGE_EXPONENT: [i32; 74] = [
-1223,
-1193,
-1163,
-1134,
-1104,
-1074,
-1044,
-1015,
-985,
-955,
-926,
-896,
-866,
-836,
-807,
-777,
-747,
-717,
-688,
-658,
-628,
-599,
-569,
-539,
-509,
-480,
-450,
-420,
-390,
-361,
-331,
-301,
-272,
-242,
-212,
-182,
-153,
-123,
-93,
-63,
-34,
-4,
26,
55,
85,
115,
145,
174,
204,
234,
263,
293,
323,
353,
382,
412,
442,
472,
501,
531,
561,
590,
620,
650,
680,
709,
739,
769,
799,
828,
858,
888,
917,
947,
];
const BASE31_SMALL_INT_POWERS: [u64; 6] = [1, 31, 961, 29791, 923521, 28629151];
const BASE31_STEP: i32 = 6;
const BASE31_BIAS: i32 = 234;
const BASE33_SMALL_MANTISSA: [u64; 6] = [
9223372036854775808,
9511602413006487552,
9808839988412940288,
10115366238050844672,
10431471432989933568,
10757454915270868992,
];
const BASE33_SMALL_EXPONENT: [i32; 6] = [
-63,
-58,
-53,
-48,
-43,
-38,
];
const BASE33_LARGE_MANTISSA: [u64; 72] = [
16952605037124200569,
10195070131008495069,
12262357879342609130,
14748836332546310936,
17739506162243888511,
10668301952265249182,
12831548466319904021,
15433443558330863109,
9281466718275888268,
11163500111543439891,
13427159577595330562,
16149828684624228128,
9712291160146516482,
11681684235978010467,
14050417593436164695,
16899466768835551431,
10163113486548439647,
12223921281461810852,
14702605819874780450,
17683901337162836029,
10634861953510936381,
12791327729538214791,
15385067131072375518,
9252373781378705800,
11128507904583594948,
13385071886268464065,
16099206734335173177,
9681847795705762071,
11645067770860388376,
14006376287807173243,
16846495063476347823,
10131257010808365886,
12185605163840289543,
14656520217639143557,
17628470806481188820,
10601526773079323099,
12751233065433685927,
15336842340660548274,
9223372036854775808,
11093625381373083648,
13343116119623879688,
16048743459528137878,
9651499856579507665,
11608566080760702539,
13962473030502269494,
16793689398951866695,
10099500389807484117,
12147409148830342864,
14610579071614836924,
17573214023869781748,
10568296082415350040,
12711264078829073096,
15288768711786753433,
18388922397719682024,
11058852198106072831,
13301291864141109889,
15998438362831755651,
9621247043655259795,
11572178805914439916,
13918707388806312258,
16741049254803901004,
10067843310549183526,
12109332859968012500,
14564781929001072895,
17518130444711929011,
10535169553993820096,
12671420375785822681,
15240845770632227134,
18331281964891256972,
11024188012054395372,
13259598707595875029,
15948290948433680084,
];
const BASE33_LARGE_EXPONENT: [i32; 72] = [
-1214,
-1183,
-1153,
-1123,
-1093,
-1062,
-1032,
-1002,
-971,
-941,
-911,
-881,
-850,
-820,
-790,
-760,
-729,
-699,
-669,
-639,
-608,
-578,
-548,
-517,
-487,
-457,
-427,
-396,
-366,
-336,
-306,
-275,
-245,
-215,
-185,
-154,
-124,
-94,
-63,
-33,
-3,
27,
58,
88,
118,
148,
179,
209,
239,
269,
300,
330,
360,
390,
421,
451,
481,
512,
542,
572,
602,
633,
663,
693,
723,
754,
784,
814,
844,
875,
905,
935,
];
const BASE33_SMALL_INT_POWERS: [u64; 6] = [1, 33, 1089, 35937, 1185921, 39135393];
const BASE33_STEP: i32 = 6;
const BASE33_BIAS: i32 = 228;
const BASE34_SMALL_MANTISSA: [u64; 6] = [
9223372036854775808,
9799832789158199296,
10412322338480586752,
11063092484635623424,
11754535764925349888,
12489194250233184256,
];
const BASE34_SMALL_EXPONENT: [i32; 6] = [
-63,
-58,
-53,
-48,
-43,
-38,
];
const BASE34_LARGE_MANTISSA: [u64; 72] = [
9604872659818954289,
13818638119852157632,
9940514895438007254,
14301530372152488549,
10287886147601198282,
14801297292224652053,
10647396286743453217,
15318528565264575918,
11019469506220361724,
15853834483014935870,
11404544822822581011,
16407846663860846991,
11803076594780713339,
16981218798089296108,
12215535057871861844,
17574627419191661979,
12642406880260427750,
18188772702119398880,
13084195736727816960,
9412189644717380884,
13541422902968601381,
9741098573165682574,
14014627870654357169,
10081501222766715924,
14504368983990906269,
10433799241558921201,
15011224098520048145,
10798408313169791102,
15535791262943115320,
11175758647289472494,
16078689424770850259,
11566295487283966163,
16640559160632214299,
11970479635546867736,
17222063432103834911,
12388787997209523031,
17823888367951909878,
12821714142851132552,
9223372036854775808,
13269768890872758272,
9545682734772404224,
13733480910222387686,
9879256578703990224,
14213397344182222761,
10224487159240697338,
14710084455954213119,
10581781820995279550,
15224128296805573036,
10951562143236309252,
15756135397562640779,
11334264437318166304,
16306733484268988021,
11730340261493716029,
16876572218852198941,
12140256953717114113,
17466323965673246884,
12564498183065403345,
18076684584862935827,
13003564520429535778,
9354187126690740272,
13457974029148190318,
9681069157385005207,
13928262876281286641,
10019374079298318020,
14414985965244449544,
10369501065317377529,
14918717590550882042,
10731863237423767546,
15440052115433190547,
11106888154145020298,
15979604673144701925,
11495018315039655259,
];
const BASE34_LARGE_EXPONENT: [i32; 72] = [
-1223,
-1193,
-1162,
-1132,
-1101,
-1071,
-1040,
-1010,
-979,
-949,
-918,
-888,
-857,
-827,
-796,
-766,
-735,
-705,
-674,
-643,
-613,
-582,
-552,
-521,
-491,
-460,
-430,
-399,
-369,
-338,
-308,
-277,
-247,
-216,
-186,
-155,
-125,
-94,
-63,
-33,
-2,
28,
59,
89,
120,
150,
181,
211,
242,
272,
303,
333,
364,
394,
425,
455,
486,
516,
547,
578,
608,
639,
669,
700,
730,
761,
791,
822,
852,
883,
913,
944,
];
const BASE34_SMALL_INT_POWERS: [u64; 6] = [1, 34, 1156, 39304, 1336336, 45435424];
const BASE34_STEP: i32 = 6;
const BASE34_BIAS: i32 = 228;
const BASE35_SMALL_MANTISSA: [u64; 6] = [
9223372036854775808,
10088063165309911040,
11033819087057715200,
12068239626469376000,
13199637091450880000,
14437103068774400000,
];
const BASE35_SMALL_EXPONENT: [i32; 6] = [
-63,
-58,
-53,
-48,
-43,
-38,
];
const BASE35_LARGE_MANTISSA: [u64; 71] = [
11348773864264802781,
9714654125541636184,
16631665395337738380,
14236857547774631404,
12186880148060573338,
10432080762542161338,
17859912908640730010,
15288248642090717076,
13086880531724678972,
11202489314578100722,
9589433214356533221,
16417284907013989533,
14053345890899718904,
12029792492965214691,
10297612294415481616,
17629700433836653197,
15091184660126225295,
12918191962520288360,
11058090357972464737,
9465826388078148767,
16205667761547463659,
13872199680760223069,
11874729681889289960,
10164877111271147984,
17402455374597619654,
14896660812999728329,
12751677771947325078,
10915552689343391453,
9343812841314943660,
15996778339727633381,
13693388426986467236,
11721665614797754707,
10033852871240677221,
17178139481236495112,
14704644358629538426,
12587309932484688516,
10774852316876721446,
9223372036854775808,
15790581481472000000,
13516882032226562500,
11570574528082381959,
9904517520440015906,
16956714997100751955,
14515102976976096155,
12425060777883196253,
10635965558010358334,
18208967404416189641,
15587042479907979542,
13342650787080448100,
11421430990225254489,
9776849289257450184,
16738144652217302890,
14328004764601889967,
12264902998508825496,
10498869035448040891,
17974255652391389054,
15386127075531072702,
13170665365099231511,
11274209897518154234,
9650826688689364000,
16522391657019252092,
14143318229301497845,
12106809636745979660,
10363539673224497244,
17742569311160898016,
15187801450438335382,
13000896817848986534,
11128886469837128365,
9526428506723229038,
16309419696153507876,
13961012284800847178,
];
const BASE35_LARGE_EXPONENT: [i32; 71] = [
-1202,
-1171,
-1141,
-1110,
-1079,
-1048,
-1018,
-987,
-956,
-925,
-894,
-864,
-833,
-802,
-771,
-741,
-710,
-679,
-648,
-617,
-587,
-556,
-525,
-494,
-464,
-433,
-402,
-371,
-340,
-310,
-279,
-248,
-217,
-187,
-156,
-125,
-94,
-63,
-33,
-2,
29,
60,
90,
121,
152,
183,
213,
244,
275,
306,
337,
367,
398,
429,
460,
490,
521,
552,
583,
614,
644,
675,
706,
737,
767,
798,
829,
860,
891,
921,
952,
];
const BASE35_SMALL_INT_POWERS: [u64; 6] = [1, 35, 1225, 42875, 1500625, 52521875];
const BASE35_STEP: i32 = 6;
const BASE35_BIAS: i32 = 222;
const BASE36_SMALL_MANTISSA: [u64; 6] = [
9223372036854775808,
10376293541461622784,
11673330234144325632,
13132496513412366336,
14774058577588912128,
16620815899787526144,
];
const BASE36_SMALL_EXPONENT: [i32; 6] = [
-63,
-58,
-53,
-48,
-43,
-38,
];
const BASE36_LARGE_MANTISSA: [u64; 71] = [
11172994339528645078,
11325430459582219446,
11479946305982273645,
11636570252986002899,
11795331061968106016,
11956257886702331980,
12119380278715084095,
12284728192712064755,
12452331992078957377,
12622222454457155586,
12794430777395563548,
12968988584079505325,
13145927929137795237,
13325281304529035642,
13507081645508223020,
13691362336674758052,
13878157218102970303,
14067500591556283265,
14259427226786160917,
14453972367916992462,
14651171739918087751,
14851061555163971849,
15053678520084183432,
15259059841903798156,
15467243235475914756,
15678266930207358578,
15892169677078874302,
16108990755761097026,
16328769981827608423,
16551547714066402526,
16777364861891103792,
17006262892853298360,
17238283840257358043,
17473470310879155380,
17711865492790087155,
17953513163287843146,
18198457696935376453,
9223372036854775808,
9349208943630483456,
9476762676643233792,
9606056659007943744,
9737114633407288801,
9869960666451650558,
10004619153098548172,
10141114821132365302,
10279472735705195138,
10419718303939637392,
10561877279594392463,
10705975767793509530,
10852040229820157048,
11000097487975795902,
11150174730505647564,
11302299516591361707,
11456499781411800112,
11612803841272866179,
11771240398807322073,
11931838548245548344,
12094627780758213915,
12259637989871837542,
12426899476958235198,
12596442956798861450,
12768299563225066619,
12942500854835305460,
13119078820790347231,
13298065886687551351,
13479494920515287357,
13663399238688592583,
13849812612167175924,
14038769272656891137,
14230303918895818486,
14424451723026109070,
];
const BASE36_LARGE_EXPONENT: [i32; 71] = [
-1211,
-1180,
-1149,
-1118,
-1087,
-1056,
-1025,
-994,
-963,
-932,
-901,
-870,
-839,
-808,
-777,
-746,
-715,
-684,
-653,
-622,
-591,
-560,
-529,
-498,
-467,
-436,
-405,
-374,
-343,
-312,
-281,
-250,
-219,
-188,
-157,
-126,
-95,
-63,
-32,
-1,
30,
61,
92,
123,
154,
185,
216,
247,
278,
309,
340,
371,
402,
433,
464,
495,
526,
557,
588,
619,
650,
681,
712,
743,
774,
805,
836,
867,
898,
929,
960,
];
const BASE36_SMALL_INT_POWERS: [u64; 6] = [1, 36, 1296, 46656, 1679616, 60466176];
const BASE36_STEP: i32 = 6;
const BASE36_BIAS: i32 = 222;
}}
pub(crate) const BASE10_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE10_SMALL_MANTISSA, exp: &BASE10_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE10_LARGE_MANTISSA, exp: &BASE10_LARGE_EXPONENT },
small_int: &BASE10_SMALL_INT_POWERS,
step: BASE10_STEP,
bias: BASE10_BIAS,
};
cfg_if! {
if #[cfg(feature = "radix")] {
pub(crate) const BASE3_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE3_SMALL_MANTISSA, exp: &BASE3_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE3_LARGE_MANTISSA, exp: &BASE3_LARGE_EXPONENT },
small_int: &BASE3_SMALL_INT_POWERS,
step: BASE3_STEP,
bias: BASE3_BIAS,
};
pub(crate) const BASE5_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE5_SMALL_MANTISSA, exp: &BASE5_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE5_LARGE_MANTISSA, exp: &BASE5_LARGE_EXPONENT },
small_int: &BASE5_SMALL_INT_POWERS,
step: BASE5_STEP,
bias: BASE5_BIAS,
};
pub(crate) const BASE6_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE6_SMALL_MANTISSA, exp: &BASE6_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE6_LARGE_MANTISSA, exp: &BASE6_LARGE_EXPONENT },
small_int: &BASE6_SMALL_INT_POWERS,
step: BASE6_STEP,
bias: BASE6_BIAS,
};
pub(crate) const BASE7_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE7_SMALL_MANTISSA, exp: &BASE7_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE7_LARGE_MANTISSA, exp: &BASE7_LARGE_EXPONENT },
small_int: &BASE7_SMALL_INT_POWERS,
step: BASE7_STEP,
bias: BASE7_BIAS,
};
pub(crate) const BASE9_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE9_SMALL_MANTISSA, exp: &BASE9_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE9_LARGE_MANTISSA, exp: &BASE9_LARGE_EXPONENT },
small_int: &BASE9_SMALL_INT_POWERS,
step: BASE9_STEP,
bias: BASE9_BIAS,
};
pub(crate) const BASE11_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE11_SMALL_MANTISSA, exp: &BASE11_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE11_LARGE_MANTISSA, exp: &BASE11_LARGE_EXPONENT },
small_int: &BASE11_SMALL_INT_POWERS,
step: BASE11_STEP,
bias: BASE11_BIAS,
};
pub(crate) const BASE12_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE12_SMALL_MANTISSA, exp: &BASE12_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE12_LARGE_MANTISSA, exp: &BASE12_LARGE_EXPONENT },
small_int: &BASE12_SMALL_INT_POWERS,
step: BASE12_STEP,
bias: BASE12_BIAS,
};
pub(crate) const BASE13_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE13_SMALL_MANTISSA, exp: &BASE13_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE13_LARGE_MANTISSA, exp: &BASE13_LARGE_EXPONENT },
small_int: &BASE13_SMALL_INT_POWERS,
step: BASE13_STEP,
bias: BASE13_BIAS,
};
pub(crate) const BASE14_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE14_SMALL_MANTISSA, exp: &BASE14_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE14_LARGE_MANTISSA, exp: &BASE14_LARGE_EXPONENT },
small_int: &BASE14_SMALL_INT_POWERS,
step: BASE14_STEP,
bias: BASE14_BIAS,
};
pub(crate) const BASE15_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE15_SMALL_MANTISSA, exp: &BASE15_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE15_LARGE_MANTISSA, exp: &BASE15_LARGE_EXPONENT },
small_int: &BASE15_SMALL_INT_POWERS,
step: BASE15_STEP,
bias: BASE15_BIAS,
};
pub(crate) const BASE17_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE17_SMALL_MANTISSA, exp: &BASE17_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE17_LARGE_MANTISSA, exp: &BASE17_LARGE_EXPONENT },
small_int: &BASE17_SMALL_INT_POWERS,
step: BASE17_STEP,
bias: BASE17_BIAS,
};
pub(crate) const BASE18_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE18_SMALL_MANTISSA, exp: &BASE18_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE18_LARGE_MANTISSA, exp: &BASE18_LARGE_EXPONENT },
small_int: &BASE18_SMALL_INT_POWERS,
step: BASE18_STEP,
bias: BASE18_BIAS,
};
pub(crate) const BASE19_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE19_SMALL_MANTISSA, exp: &BASE19_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE19_LARGE_MANTISSA, exp: &BASE19_LARGE_EXPONENT },
small_int: &BASE19_SMALL_INT_POWERS,
step: BASE19_STEP,
bias: BASE19_BIAS,
};
pub(crate) const BASE20_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE20_SMALL_MANTISSA, exp: &BASE20_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE20_LARGE_MANTISSA, exp: &BASE20_LARGE_EXPONENT },
small_int: &BASE20_SMALL_INT_POWERS,
step: BASE20_STEP,
bias: BASE20_BIAS,
};
pub(crate) const BASE21_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE21_SMALL_MANTISSA, exp: &BASE21_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE21_LARGE_MANTISSA, exp: &BASE21_LARGE_EXPONENT },
small_int: &BASE21_SMALL_INT_POWERS,
step: BASE21_STEP,
bias: BASE21_BIAS,
};
pub(crate) const BASE22_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE22_SMALL_MANTISSA, exp: &BASE22_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE22_LARGE_MANTISSA, exp: &BASE22_LARGE_EXPONENT },
small_int: &BASE22_SMALL_INT_POWERS,
step: BASE22_STEP,
bias: BASE22_BIAS,
};
pub(crate) const BASE23_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE23_SMALL_MANTISSA, exp: &BASE23_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE23_LARGE_MANTISSA, exp: &BASE23_LARGE_EXPONENT },
small_int: &BASE23_SMALL_INT_POWERS,
step: BASE23_STEP,
bias: BASE23_BIAS,
};
pub(crate) const BASE24_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE24_SMALL_MANTISSA, exp: &BASE24_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE24_LARGE_MANTISSA, exp: &BASE24_LARGE_EXPONENT },
small_int: &BASE24_SMALL_INT_POWERS,
step: BASE24_STEP,
bias: BASE24_BIAS,
};
pub(crate) const BASE25_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE25_SMALL_MANTISSA, exp: &BASE25_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE25_LARGE_MANTISSA, exp: &BASE25_LARGE_EXPONENT },
small_int: &BASE25_SMALL_INT_POWERS,
step: BASE25_STEP,
bias: BASE25_BIAS,
};
pub(crate) const BASE26_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE26_SMALL_MANTISSA, exp: &BASE26_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE26_LARGE_MANTISSA, exp: &BASE26_LARGE_EXPONENT },
small_int: &BASE26_SMALL_INT_POWERS,
step: BASE26_STEP,
bias: BASE26_BIAS,
};
pub(crate) const BASE27_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE27_SMALL_MANTISSA, exp: &BASE27_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE27_LARGE_MANTISSA, exp: &BASE27_LARGE_EXPONENT },
small_int: &BASE27_SMALL_INT_POWERS,
step: BASE27_STEP,
bias: BASE27_BIAS,
};
pub(crate) const BASE28_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE28_SMALL_MANTISSA, exp: &BASE28_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE28_LARGE_MANTISSA, exp: &BASE28_LARGE_EXPONENT },
small_int: &BASE28_SMALL_INT_POWERS,
step: BASE28_STEP,
bias: BASE28_BIAS,
};
pub(crate) const BASE29_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE29_SMALL_MANTISSA, exp: &BASE29_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE29_LARGE_MANTISSA, exp: &BASE29_LARGE_EXPONENT },
small_int: &BASE29_SMALL_INT_POWERS,
step: BASE29_STEP,
bias: BASE29_BIAS,
};
pub(crate) const BASE30_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE30_SMALL_MANTISSA, exp: &BASE30_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE30_LARGE_MANTISSA, exp: &BASE30_LARGE_EXPONENT },
small_int: &BASE30_SMALL_INT_POWERS,
step: BASE30_STEP,
bias: BASE30_BIAS,
};
pub(crate) const BASE31_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE31_SMALL_MANTISSA, exp: &BASE31_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE31_LARGE_MANTISSA, exp: &BASE31_LARGE_EXPONENT },
small_int: &BASE31_SMALL_INT_POWERS,
step: BASE31_STEP,
bias: BASE31_BIAS,
};
pub(crate) const BASE33_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE33_SMALL_MANTISSA, exp: &BASE33_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE33_LARGE_MANTISSA, exp: &BASE33_LARGE_EXPONENT },
small_int: &BASE33_SMALL_INT_POWERS,
step: BASE33_STEP,
bias: BASE33_BIAS,
};
pub(crate) const BASE34_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE34_SMALL_MANTISSA, exp: &BASE34_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE34_LARGE_MANTISSA, exp: &BASE34_LARGE_EXPONENT },
small_int: &BASE34_SMALL_INT_POWERS,
step: BASE34_STEP,
bias: BASE34_BIAS,
};
pub(crate) const BASE35_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE35_SMALL_MANTISSA, exp: &BASE35_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE35_LARGE_MANTISSA, exp: &BASE35_LARGE_EXPONENT },
small_int: &BASE35_SMALL_INT_POWERS,
step: BASE35_STEP,
bias: BASE35_BIAS,
};
pub(crate) const BASE36_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray { mant: &BASE36_SMALL_MANTISSA, exp: &BASE36_SMALL_EXPONENT },
large: ExtendedFloatArray { mant: &BASE36_LARGE_MANTISSA, exp: &BASE36_LARGE_EXPONENT },
small_int: &BASE36_SMALL_INT_POWERS,
step: BASE36_STEP,
bias: BASE36_BIAS,
};
}}
pub(crate) fn get_powers(radix: u32)
-> &'static ModeratePathPowers<u64>
{
debug_assert_radix!(radix);
#[cfg(not(feature = "radix"))] {
&BASE10_POWERS
}
#[cfg(feature = "radix")] {
match radix {
3 => &BASE3_POWERS,
5 => &BASE5_POWERS,
6 => &BASE6_POWERS,
7 => &BASE7_POWERS,
9 => &BASE9_POWERS,
10 => &BASE10_POWERS,
11 => &BASE11_POWERS,
12 => &BASE12_POWERS,
13 => &BASE13_POWERS,
14 => &BASE14_POWERS,
15 => &BASE15_POWERS,
17 => &BASE17_POWERS,
18 => &BASE18_POWERS,
19 => &BASE19_POWERS,
20 => &BASE20_POWERS,
21 => &BASE21_POWERS,
22 => &BASE22_POWERS,
23 => &BASE23_POWERS,
24 => &BASE24_POWERS,
25 => &BASE25_POWERS,
26 => &BASE26_POWERS,
27 => &BASE27_POWERS,
28 => &BASE28_POWERS,
29 => &BASE29_POWERS,
30 => &BASE30_POWERS,
31 => &BASE31_POWERS,
33 => &BASE33_POWERS,
34 => &BASE34_POWERS,
35 => &BASE35_POWERS,
36 => &BASE36_POWERS,
_ => unreachable!(),
}
}
}
#[cfg(test)]
mod tests {
use util::test::*;
use super::*;
#[test]
fn normalization_test() {
for base in BASE_POWN.iter().cloned() {
let powers = get_powers(base);
for idx in 0..powers.small.len() {
let fp = powers.get_small(idx);
assert_eq!(fp.mant.leading_zeros(), 0);
}
for idx in 0..powers.large.len() {
let fp = powers.get_large(idx);
assert_eq!(fp.mant.leading_zeros(), 0);
}
}
}
#[cfg(feature = "radix")]
#[test]
#[should_panic]
fn pow2_test() {
for base in BASE_POW2.iter().cloned() {
let _ = get_powers(base);
}
}
}