use util::*;
use super::cached::{ExtendedFloatArray, ModeratePathPowers};
const BASE10_SMALL_MANTISSA: [u128; 10] = [
170141183460469231731687303715884105728,
212676479325586539664609129644855132160,
265845599156983174580761412056068915200,
332306998946228968225951765070086144000,
207691874341393105141219853168803840000,
259614842926741381426524816461004800000,
324518553658426726783156020576256000000,
202824096036516704239472512860160000000,
253530120045645880299340641075200000000,
316912650057057350374175801344000000000,
];
const BASE10_SMALL_EXPONENT: [i32; 10] = [
-127,
-124,
-121,
-118,
-114,
-111,
-108,
-104,
-101,
-98,
];
const BASE10_LARGE_MANTISSA: [u128; 66] = [
213154451346726893197828921904416471830,
248144440523729302452212341484167231049,
288878149031346317441449898160257412877,
336298426882534191759128470626028036788,
195751447977110622310503659901458325789,
227884678143438210606695688214919443462,
265292681454958173686982700851419292695,
308841328899094571460716776609676066664,
179769313486231590772930519078902473361,
209279024841067836122739267394531603625,
243632850284999977008834559696879707771,
283625966735416996535885333662014114404,
330184081959790778970212365572822879074,
192192430817400325887261637005036975649,
223741436863085634409521749481834675708,
260469313784369307581244210575049132700,
303226189902482213896285056340332530323,
176500872419263593559319302637789241459,
205474058654233340126601167300005025998,
239203286653190548679094257880939433814,
278469275977917188637766821636980671685,
324180903818827574883781864350871964922,
188698121241077067612077729049413444545,
219673525124179510879420825570604582952,
255733641241886083594780445064656183766,
297713141471480582369003031710926657271,
173291855882550928723650886508942731464,
201738271725539733566868685312735302682,
234854258277383322788948059678933702737,
273406340597876490546562778389702670669,
318286871302263450979444638813965337664,
185267342779705912677713576013900652565,
215679573337205118357336120696157045389,
251084069415467230553431576928306656644,
292300327466180583640736966543256603931,
170141183460469231731687303715884105728,
198070406285660843983859875840000000000,
230584300921369395200000000000000000000,
268435456000000000000000000000000000000,
312500000000000000000000000000000000000,
181898940354585647583007812500000000000,
211758236813575084767080625169910490512,
246519032881566189191165176650870696772,
286985925493722536125179818657774823686,
334095588761524455767567058393935234851,
194469227433160678348252001680628882518,
226391976970667809187727982272194794517,
263554948580763080608714351281750475192,
306818341581107909568485747186642227685,
178591779887855465971216179422709524914,
207908195312897984370608091613638127355,
242036994678082392051126914580396990473,
281768146294730706199918541335962934504,
328021294314799255458543241647960309061,
190933522718725292628248712075851106236,
222275874948507748344271341427056009691,
258763175164940474024358370140027266101,
301239983137860514717593754339063617053,
175344747920672243180215448571289666610,
204128152598478183127259193653345185577,
237636445786894977939384050729387888658,
276645233140903266541874095249674153349,
322057438479856665411351825168442625260,
187462101736953869352205554703508169192,
218234609040610805796698614376955862613,
254058522452380049271391022923583936195,
];
const BASE10_LARGE_EXPONENT: [i32; 66] = [
-1290,
-1257,
-1224,
-1191,
-1157,
-1124,
-1091,
-1058,
-1024,
-991,
-958,
-925,
-892,
-858,
-825,
-792,
-759,
-725,
-692,
-659,
-626,
-593,
-559,
-526,
-493,
-460,
-426,
-393,
-360,
-327,
-294,
-260,
-227,
-194,
-161,
-127,
-94,
-61,
-28,
5,
39,
72,
105,
138,
171,
205,
238,
271,
304,
338,
371,
404,
437,
470,
504,
537,
570,
603,
637,
670,
703,
736,
769,
803,
836,
869,
];
const BASE10_SMALL_INT_POWERS: [u128; 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: [u128; 20] = [
170141183460469231731687303715884105728,
255211775190703847597530955573826158592,
191408831393027885698148216680369618944,
287113247089541828547222325020554428416,
215334935317156371410416743765415821312,
323002402975734557115625115648123731968,
242251802231800917836718836736092798976,
181688851673850688377539127552069599232,
272533277510776032566308691328104398848,
204399958133082024424731518496078299136,
306599937199623036637097277744117448704,
229949952899717277477822958308088086528,
172462464674787958108367218731066064896,
258693697012181937162550828096599097344,
194020272759136452871913121072449323008,
291030409138704679307869681608673984512,
218272806854028509480902261206505488384,
327409210281042764221353391809758232576,
245556907710782073166015043857318674432,
184167680783086554874511282892989005824,
];
const BASE3_SMALL_EXPONENT: [i32; 20] = [
-127,
-126,
-124,
-123,
-121,
-120,
-118,
-116,
-115,
-113,
-112,
-110,
-108,
-107,
-105,
-104,
-102,
-101,
-99,
-97,
];
const BASE3_LARGE_MANTISSA: [u128; 69] = [
301829093537629265639465570217176944359,
245033990385703656345786023933864839340,
198926007233479871031630637668169238011,
322988302900880006728964617948539328448,
262211676747596696167096696967233799204,
212871372756449173771443137071089544143,
172815421118085121562612771428651141606,
280593575260967566098415738074481154338,
227794354139073103116567345878808448350,
184930348919702200346046943747485274024,
300264105147079021545114594266031000970,
243763485459391712918376663011554847091,
197894572893436379626501802082900685163,
321313603691473325606249593990411338331,
260852105259086286749566195634740776863,
211767631486382365261996259087726574961,
171919370559843833352674924374427532806,
279138693352137745884317186629683060895,
226613236986043931067161987739751269180,
183971482278558945643179980616811190964,
298707231244876640116631457791747347925,
242499568120235502703106353919523432682,
196868486555962367745019627988939060464,
319647587822660709450189016904055940251,
259499583169196479959998361450291137700,
210669613131404954481085620515615417585,
171027966037226738058674240289082148799,
277691355027891684120101092281051616669,
225438243943221318560556485110109738278,
183017587375374702561553597022155160742,
297158429757277967604640789526650060843,
241242204211496523037749538228345943134,
195847720491584060106836777189641681162,
317990210271190550439415903835536554761,
258154073926689380540223575440483383976,
209577288018116110386327960504760073299,
170141183460469231731687303715884105728,
276251521174629832311766924339483508736,
224269343257001716702690972139746492416,
182068638431613361423174859113151594496,
295617658828691846632166420412766595202,
239991359753539474232337032335634004651,
194832247114605420104007752175098574688,
316341426247257477645159711999449660471,
256815541169845811576524073480007610450,
208490626626972031635281014538153149532,
338517997729425004575949331160209430911,
274819152881557244028610584245948464515,
223106503338424488684979682521025988628,
181124609802400910077427551154104473922,
294084876820548989626661915132664622178,
238747000942913976797497733353022683918,
193822038982362660063056049982127016523,
314701191193291934781116205950433765545,
255483948725482657093998355855298189652,
207409599591488195571905341445445255582,
336762776818711782198286065086981891498,
273394211439632029990640781047045990695,
221949692762318233808346663450192754968,
180185475975832393914650652957737664335,
292560042310176717160312096633717510967,
237509094151441049982785534773499431992,
192817068794482616882547252154136283242,
313069460782756034010893203297842312622,
254159260607975299744356396919078736707,
206334177697445743564032291193028958152,
335016656754825225194410391893304442626,
271976658340519265432186039827268288213,
220798880266451537830039115389735391778,
];
const BASE3_LARGE_EXPONENT: [i32; 69] = [
-1269,
-1237,
-1205,
-1174,
-1142,
-1110,
-1078,
-1047,
-1015,
-983,
-952,
-920,
-888,
-857,
-825,
-793,
-761,
-730,
-698,
-666,
-635,
-603,
-571,
-540,
-508,
-476,
-444,
-413,
-381,
-349,
-318,
-286,
-254,
-223,
-191,
-159,
-127,
-96,
-64,
-32,
-1,
31,
63,
94,
126,
158,
189,
221,
253,
285,
316,
348,
380,
411,
443,
475,
506,
538,
570,
602,
633,
665,
697,
728,
760,
792,
823,
855,
887,
];
const BASE3_SMALL_INT_POWERS: [u128; 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: [u128; 14] = [
170141183460469231731687303715884105728,
212676479325586539664609129644855132160,
265845599156983174580761412056068915200,
332306998946228968225951765070086144000,
207691874341393105141219853168803840000,
259614842926741381426524816461004800000,
324518553658426726783156020576256000000,
202824096036516704239472512860160000000,
253530120045645880299340641075200000000,
316912650057057350374175801344000000000,
198070406285660843983859875840000000000,
247588007857076054979824844800000000000,
309485009821345068724781056000000000000,
193428131138340667952988160000000000000,
];
const BASE5_SMALL_EXPONENT: [i32; 14] = [
-127,
-125,
-123,
-121,
-118,
-116,
-114,
-111,
-109,
-107,
-104,
-102,
-100,
-97,
];
const BASE5_LARGE_MANTISSA: [u128; 68] = [
285793394306920833441610418092098634655,
203068420253004570555511362849258201390,
288577581746103207017755725657449092679,
205046704412910121830119952091883627559,
291388892624283530821742192659774598780,
207044260935364498850036477975162511299,
294227591176883860910658765384315687611,
209061277570927374050781655074839937648,
297093944213496817569054052050375869453,
211097943899216614887176072592734406508,
299988221142963048588365030287739055137,
213154451346726893197828921904416471830,
302910693998692996157485768413290076965,
215230993204821882725842221200657943544,
305861637464235347360161968596028634045,
217327764647901735884376228537482684576,
308841328899094571460716776609676066664,
219444962751747547330237450047488370802,
311850048364799970571308236412006025948,
221582786512044528543660416923448526878,
314888078651228693933689466069052580904,
223741436863085634409521749481834675708,
317955705303185189918510999237120523316,
225921116696657399755928707376370229068,
321053216647239593947814323906257853121,
228122030881109760932058580285014566244,
324180903818827574883781864350871964922,
230344386280611654799899571593522271174,
327339060789614187001318969682759915221,
232588391774594204975783618524161450993,
330527984395124299475957654016385519914,
234854258277383322788948059678933702737,
333747974362642200374222141588992517906,
237142198758023568227473377297792835283,
336999333339382997433337688587745383420,
239452428260295134118491722992235809940,
170141183460469231731687303715884105728,
241785163922925834941235200000000000000,
171798691840000000000000000000000000000,
244140625000000000000000000000000000000,
173472347597680709441192448139190673828,
246519032881566189191165176650870696772,
175162308040602133865466197911239516410,
248920611114445668285762562151204969623,
176868732008334225927912486150152183216,
251345585423243599518503524095297312920,
178591779887855465971216179422709524914,
253794183731564922327402455583054354682,
180331613628627651967947866455016278082,
256266636183436918326986907537468991453,
182088396757817547443627082897044283139,
258763175164940474024358370140027266101,
183862294395666818064937594201088633455,
261284035326052074402891767876281837538,
185653473271011701515143789632334288014,
263829453602698580304979415177988198613,
187462101736953869352205554703508169192,
266399669239026862544798113253119949479,
189288349786683953755640255602884245064,
268994923809890385876486015494726082500,
191132389069459226417170338759437756337,
271615461243554856334256923502490730495,
192994392906736931318972184714148973580,
274261527844625066050770363850331497104,
194874536308464787773268059716493991903,
276933372317195090450451374005771742621,
196772995989530194869453349330805553038,
279631245788224013707368483964622716141,
];
const BASE5_LARGE_EXPONENT: [i32; 68] = [
-1298,
-1265,
-1233,
-1200,
-1168,
-1135,
-1103,
-1070,
-1038,
-1005,
-973,
-940,
-908,
-875,
-843,
-810,
-778,
-745,
-713,
-680,
-648,
-615,
-583,
-550,
-518,
-485,
-453,
-420,
-388,
-355,
-323,
-290,
-258,
-225,
-193,
-160,
-127,
-95,
-62,
-30,
3,
35,
68,
100,
133,
165,
198,
230,
263,
295,
328,
360,
393,
425,
458,
490,
523,
555,
588,
620,
653,
685,
718,
750,
783,
815,
848,
880,
];
const BASE5_SMALL_INT_POWERS: [u128; 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: [u128; 12] = [
170141183460469231731687303715884105728,
255211775190703847597530955573826158592,
191408831393027885698148216680369618944,
287113247089541828547222325020554428416,
215334935317156371410416743765415821312,
323002402975734557115625115648123731968,
242251802231800917836718836736092798976,
181688851673850688377539127552069599232,
272533277510776032566308691328104398848,
204399958133082024424731518496078299136,
306599937199623036637097277744117448704,
229949952899717277477822958308088086528,
];
const BASE6_SMALL_EXPONENT: [i32; 12] = [
-127,
-125,
-122,
-120,
-117,
-115,
-112,
-109,
-107,
-104,
-102,
-99,
];
const BASE6_LARGE_MANTISSA: [u128; 71] = [
206105367118290399407064648402758144682,
208917317212507950117664039252872831665,
211767631486382365261996259087726574961,
214656833352574406771088703014069554755,
217585453364802351586979201161384846208,
220554029315269330081435801781477974040,
223563106333419891448609016293621894840,
226613236986043931067161987739751269180,
229704981378746362247969882824709232796,
232838907258801165579649662968151663564,
236015590119408703302029793810763336632,
239235613305375443823879271798297650114,
242499568120235502703106353919523432682,
245808053934833671173174941698733239342,
249161678297389871677290466673500998400,
252561057045065251911260457800735557729,
256006814417050404626793229969178591795,
259499583169196479959998361450291137700,
263040004690210240376322725691803307553,
266628729119434395515123988465075762881,
270266415466234845327287688358055741312,
273953731731016754981191818978678705632,
277691355027891684120101092281051616669,
281479971709018296242657937208050445965,
285320277490639481303204301467482637509,
289212977580839036146652597763405686112,
293158786809041363160730749526943361727,
297158429757277967604640789526650060843,
301212640893244858516269504216828222245,
305322164705175286969651759320250334279,
309487755838552588810803796052767101096,
313710179234688236904530296665341569850,
317990210271190550439415903835536554761,
322328634904349856025836233807108654402,
326726249813466247246220462666861782844,
331183862547146446042592332649497399781,
335702291671596630919115661345637412333,
170141183460469231731687303715884105728,
172462464674787958108367218731066064896,
174815415743320440759790006808579407872,
177200468746272961345336076752392290304,
179618061658836457920697688990341398528,
182068638431613361423174859113151594496,
184552649072141716781794491390137475072,
187070549727531559196917812917453861026,
189622802768228720381105803326920695033,
192209876872921446586714266254161951235,
194832247114605420104007752175098574688,
197490395047822988635051696441052554380,
200184808797092622572327630249651738267,
202915983146544838776512848181734408257,
205684419630781050995309380627725821797,
208490626626972031635281014538153149532,
211335119448212897232599978727666183358,
214218420438151760708217936124820030498,
217141059066909427380630585083218539864,
220103572028307748788051030668660629356,
223106503338424488684979682521025988628,
226150404435492799169987273137391228527,
229235834281163651816744244429413474808,
232363359463149818964276081092475750857,
235533554299270254021060647605641184828,
238747000942913976797497733353022683918,
242004289489942830549695955106475311593,
245306018087052741642305313258629505287,
248652793041613380567795520750960012282,
252045228933006394543323172270604972624,
255483948725482657093998355855298189652,
258969583882559258973487053363982248701,
262502774482977247520692697766891651596,
266084169338241408156670471179837543899,
];
const BASE6_LARGE_EXPONENT: [i32; 71] = [
-1275,
-1244,
-1213,
-1182,
-1151,
-1120,
-1089,
-1058,
-1027,
-996,
-965,
-934,
-903,
-872,
-841,
-810,
-779,
-748,
-717,
-686,
-655,
-624,
-593,
-562,
-531,
-500,
-469,
-438,
-407,
-376,
-345,
-314,
-283,
-252,
-221,
-190,
-159,
-127,
-96,
-65,
-34,
-3,
28,
59,
90,
121,
152,
183,
214,
245,
276,
307,
338,
369,
400,
431,
462,
493,
524,
555,
586,
617,
648,
679,
710,
741,
772,
803,
834,
865,
896,
];
const BASE6_SMALL_INT_POWERS: [u128; 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: [u128; 11] = [
170141183460469231731687303715884105728,
297747071055821155530452781502797185024,
260528687173843511089146183814947536896,
227962601277113072203002910838079094784,
199467276117473938177627546983319207936,
174533866602789695905424103610404306944,
305434266554881967834492181318207537152,
267254983235521721855180658653431595008,
233848110331081506623283076321752645632,
204617096539696318295372691781533564928,
179039959472234278508451105308841869312,
];
const BASE7_SMALL_EXPONENT: [i32; 11] = [
-127,
-125,
-122,
-119,
-116,
-113,
-111,
-108,
-105,
-102,
-99,
];
const BASE7_LARGE_MANTISSA: [u128; 71] = [
225523710066019267908218449093892378358,
207654229874777697952558290622819921790,
191200646585071218824745087565327043379,
176050770921424471559828841966017113260,
324202605959679334675793064499391555083,
298514255748300407155832676761118149894,
274861334384351909098688755274300249465,
253082563679127241756740166823033329043,
233029444399168140266755890269514708731,
214565243719567885018434177936373702812,
197564062906901525077828647577582055243,
181909978874749832229630901118123515094,
334992507516972618831705765612473924060,
308449214239576126269380201889590576494,
284009091636748185128341566413187692045,
261505493963360706349361998265286260917,
240784979730461811097321743219099069136,
221706265459654420066135217688280855198,
204139262337252438224351496710052887294,
187964189199610581269006081054389519147,
173070755801490399767170008783447571912,
318714821597104302344272129046782646031,
293461298632634947256039303556899737616,
270208750768480083796084384984407980627,
248798629775241702400557051000361115726,
229084950069124576377435007616984162844,
210933293304638808346189699277966975327,
194219891838880796776419735762035423417,
178830784817964977889863278397948540205,
329322082262710237520775170056072850605,
303228087871569629902816732340606701122,
279201663740542055384000770694089408486,
257078984940548995242906668328695771951,
236709207289964795762477040448859922676,
217953438818817001855782665313698094789,
200683792729517998822275406364627986706,
184782515396710906443711214287193178833,
170141183460469231731687303715884105728,
313319929076409987389789434290473271296,
288493873028852398739253829029106548736,
265634921533798919351224824788236107776,
244587210111081219100242972308429222416,
225207224277966141315155116349116687572,
207362820991138609531788808643065835705,
190932327625202079604864455739987836428,
175803712344053086257499345217280929659,
323747640416561983962207324433251030705,
298095339619934405668456872884344580325,
274475611277932187651307585787198545738,
252727403529513497084111370284014563793,
232702425535702904483240997815950541938,
214264136353838934720254978302625752306,
197286813928859418414994791325492154413,
181654697853512422889189735564216996803,
334522400104752565046325502667785120787,
308016356015425756696586706818979868623,
283610531143243549972387138852602501496,
261138513603233655506120063924465915820,
240447077236577495145565086308268824286,
221395136833224081873557773886454798418,
203852786137945162132478938839041683065,
187700412080445632409314398956810353518,
172827879189879361689316520165778889316,
318267557265350256871483486812089934265,
293049473506426909088112326597996634777,
269829556805234360375792834335085449819,
248449481428986202531286841797890645972,
228763466660872229208763580066607974130,
210637282789652967136592584117374228567,
193947335860149215724544902551342320202,
178579824943969003959847035500732297209,
];
const BASE7_LARGE_EXPONENT: [i32; 71] = [
-1270,
-1239,
-1208,
-1177,
-1147,
-1116,
-1085,
-1054,
-1023,
-992,
-961,
-930,
-900,
-869,
-838,
-807,
-776,
-745,
-714,
-683,
-652,
-622,
-591,
-560,
-529,
-498,
-467,
-436,
-405,
-375,
-344,
-313,
-282,
-251,
-220,
-189,
-158,
-127,
-97,
-66,
-35,
-4,
27,
58,
89,
120,
150,
181,
212,
243,
274,
305,
336,
367,
397,
428,
459,
490,
521,
552,
583,
614,
645,
675,
706,
737,
768,
799,
830,
861,
892,
];
const BASE7_SMALL_INT_POWERS: [u128; 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: [u128; 10] = [
170141183460469231731687303715884105728,
191408831393027885698148216680369618944,
215334935317156371410416743765415821312,
242251802231800917836718836736092798976,
272533277510776032566308691328104398848,
306599937199623036637097277744117448704,
172462464674787958108367218731066064896,
194020272759136452871913121072449323008,
218272806854028509480902261206505488384,
245556907710782073166015043857318674432,
];
const BASE9_SMALL_EXPONENT: [i32; 10] = [
-127,
-124,
-121,
-118,
-115,
-112,
-108,
-105,
-102,
-99,
];
const BASE9_LARGE_MANTISSA: [u128; 69] = [
301829093537629265639465570217176944359,
245033990385703656345786023933864839340,
198926007233479871031630637668169238011,
322988302900880006728964617948539328448,
262211676747596696167096696967233799204,
212871372756449173771443137071089544143,
172815421118085121562612771428651141606,
280593575260967566098415738074481154338,
227794354139073103116567345878808448350,
184930348919702200346046943747485274024,
300264105147079021545114594266031000970,
243763485459391712918376663011554847091,
197894572893436379626501802082900685163,
321313603691473325606249593990411338331,
260852105259086286749566195634740776863,
211767631486382365261996259087726574961,
171919370559843833352674924374427532806,
279138693352137745884317186629683060895,
226613236986043931067161987739751269180,
183971482278558945643179980616811190964,
298707231244876640116631457791747347925,
242499568120235502703106353919523432682,
196868486555962367745019627988939060464,
319647587822660709450189016904055940251,
259499583169196479959998361450291137700,
210669613131404954481085620515615417585,
171027966037226738058674240289082148799,
277691355027891684120101092281051616669,
225438243943221318560556485110109738278,
183017587375374702561553597022155160742,
297158429757277967604640789526650060843,
241242204211496523037749538228345943134,
195847720491584060106836777189641681162,
317990210271190550439415903835536554761,
258154073926689380540223575440483383976,
209577288018116110386327960504760073299,
170141183460469231731687303715884105728,
276251521174629832311766924339483508736,
224269343257001716702690972139746492416,
182068638431613361423174859113151594496,
295617658828691846632166420412766595202,
239991359753539474232337032335634004651,
194832247114605420104007752175098574688,
316341426247257477645159711999449660471,
256815541169845811576524073480007610450,
208490626626972031635281014538153149532,
338517997729425004575949331160209430911,
274819152881557244028610584245948464515,
223106503338424488684979682521025988628,
181124609802400910077427551154104473922,
294084876820548989626661915132664622178,
238747000942913976797497733353022683918,
193822038982362660063056049982127016523,
314701191193291934781116205950433765545,
255483948725482657093998355855298189652,
207409599591488195571905341445445255582,
336762776818711782198286065086981891498,
273394211439632029990640781047045990695,
221949692762318233808346663450192754968,
180185475975832393914650652957737664335,
292560042310176717160312096633717510967,
237509094151441049982785534773499431992,
192817068794482616882547252154136283242,
313069460782756034010893203297842312622,
254159260607975299744356396919078736707,
206334177697445743564032291193028958152,
335016656754825225194410391893304442626,
271976658340519265432186039827268288213,
220798880266451537830039115389735391778,
];
const BASE9_LARGE_EXPONENT: [i32; 69] = [
-1269,
-1237,
-1205,
-1174,
-1142,
-1110,
-1078,
-1047,
-1015,
-983,
-952,
-920,
-888,
-857,
-825,
-793,
-761,
-730,
-698,
-666,
-635,
-603,
-571,
-540,
-508,
-476,
-444,
-413,
-381,
-349,
-318,
-286,
-254,
-223,
-191,
-159,
-127,
-96,
-64,
-32,
-1,
31,
63,
94,
126,
158,
189,
221,
253,
285,
316,
348,
380,
411,
443,
475,
506,
538,
570,
602,
633,
665,
697,
728,
760,
792,
823,
855,
887,
];
const BASE9_SMALL_INT_POWERS: [u128; 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: [u128; 9] = [
170141183460469231731687303715884105728,
233944127258145193631070042609340645376,
321673174979949641242721308587843387392,
221150307798715378354370899654142328832,
304081673223233645237259987024445702144,
209056150340973131100616241079306420224,
287452206718838055263347331484046327808,
197623392119201162993551290395281850368,
271732164163901599116133024293512544256,
];
const BASE11_SMALL_EXPONENT: [i32; 9] = [
-127,
-124,
-121,
-117,
-114,
-110,
-107,
-103,
-100,
];
const BASE11_LARGE_MANTISSA: [u128; 70] = [
171238059048456285069153007806767780751,
188020237695718721716314139814895141308,
206447153042951189194086232691622882083,
226679997440031906769564274339983654138,
248895760886189129917706060109685643694,
273288779277949488106534827711219187027,
300072434393060227248554937081761703289,
329481020481262984343182946079685486146,
180885896895108223589085363619768036079,
198613611477559667549559644399735817047,
218078729968836026458633966547967004969,
239451526564652757041971603611460905574,
262918963175987885652063848834117643272,
288686324907902004950333378158035100892,
316979015823390018300576675081611005238,
174022265350496153683469750680295263035,
191077310017213090920037889613280023761,
209803833606456768694276179860414245615,
230365649338482385703357683130616542302,
252942624941184287338239913752743474826,
277732256071429933018369293137137136134,
304951393939484349279174830456271141999,
334838142249192351062534286575243350001,
183826970023851061892407973678416422311,
201842924352393404728314593418040675821,
221624531513738305774870271734740961947,
243344834238186465986122993315325591576,
267193834301414676708834595107417746247,
293380154594991977782504639045547494542,
322132864088045607402818330486415493575,
176851740822108453297561032060281913714,
194184088111306107232610402385759498575,
213215091354676888577329040601887973466,
234111227256299197427917870802090967668,
257055288062508663991611489278928709768,
282247980565918687696808555402942563478,
309909681819761564465444461107912469729,
170141183460469231731687303715884105728,
186815862862682349392341454201789874176,
205124743505955904636591107127579246592,
225227985212968648451224991661780107264,
247301444262965381085386823495099626888,
271538211722310826714720080747313199115,
298150302539063592923933328180322755271,
327370510177191550022527822209865447333,
179727221507067050840782578187764330990,
197341380157710189331417385894277071911,
216681813672942089280666997109850212851,
237917705546974217796728292841033536358,
261234820095126400184969690376374338338,
286837127456489808703442688252756740915,
314948587854906379895896832699151980516,
172907555363184572545974225978641470455,
189853352925309785288573204303090400331,
208459922652152508348644224820166488004,
228890028448627145607277691781146666326,
251322385889182188596856419989450117198,
275953225560490099471194727985491113834,
302998009619470597652934458975103615488,
332693316582509542060143699364121908613,
182649455416682266091504883729813020363,
200550007476552106538373760555841065584,
220204902374823007850602460837751774656,
241786074406278472344858080843135119733,
265482308278902675848717553283442644763,
291500890537904924029114199837605959154,
320069422837484936971208194402230692262,
175718906461109937023963056381563419957,
192940230367248485471498733602562118815,
211849329385655768374338506351963365331,
];
const BASE11_LARGE_EXPONENT: [i32; 70] = [
-1279,
-1248,
-1217,
-1186,
-1155,
-1124,
-1093,
-1062,
-1030,
-999,
-968,
-937,
-906,
-875,
-844,
-812,
-781,
-750,
-719,
-688,
-657,
-626,
-595,
-563,
-532,
-501,
-470,
-439,
-408,
-377,
-345,
-314,
-283,
-252,
-221,
-190,
-159,
-127,
-96,
-65,
-34,
-3,
28,
59,
90,
122,
153,
184,
215,
246,
277,
308,
340,
371,
402,
433,
464,
495,
526,
557,
589,
620,
651,
682,
713,
744,
775,
807,
838,
869,
];
const BASE11_SMALL_INT_POWERS: [u128; 9] = [1, 11, 121, 1331, 14641, 161051, 1771561, 19487171, 214358881];
const BASE11_STEP: i32 = 9;
const BASE11_BIAS: i32 = 333;
const BASE12_SMALL_MANTISSA: [u128; 9] = [
170141183460469231731687303715884105728,
255211775190703847597530955573826158592,
191408831393027885698148216680369618944,
287113247089541828547222325020554428416,
215334935317156371410416743765415821312,
323002402975734557115625115648123731968,
242251802231800917836718836736092798976,
181688851673850688377539127552069599232,
272533277510776032566308691328104398848,
];
const BASE12_SMALL_EXPONENT: [i32; 9] = [
-127,
-124,
-120,
-117,
-113,
-110,
-106,
-102,
-99,
];
const BASE12_LARGE_MANTISSA: [u128; 68] = [
236015590119408703302029793810763336632,
283538504658222748235708766575760177913,
170315197362908885300398426895467760677,
204609010601448705405745986119597896326,
245808053934833671173174941698733239342,
295302729833943551617529441983408590696,
177381702616012906692133545122052956869,
213098391881773806300126011269370626834,
256006814417050404626793229969178591795,
307555061533862494767405465422567274311,
184741402471039290909022270993420155647,
221940003957364890317522299802459040748,
266628729119434395515123988465075762881,
320315751663685742610118741757695693407,
192406461791880080316008520325217417399,
231148461148045387015380597263260157877,
277691355027891684120101092281051616669,
333605892395873536287594592246578306329,
200389550171752283164939097875653100692,
240738984132727062349578629363188475398,
289212977580839036146652597763405686112,
173723725516468955947099703423373843986,
208703862874796048578293668364396201854,
250727425107703285166415666163110988836,
301212640893244858516269504216828222245,
180931653158622392278312153671259457350,
217363142646555453321168098187951653993,
261130293988778746809115702919522241550,
313710179234688236904530296665341569850,
188438643123668474334468683754392032451,
226381702429392491474935736226666160567,
271964785700545191021799322274747927151,
326726249813466247246220462666861782844,
196257103731642338395610271199702162833,
235774449020380624184618955567855082461,
283248808597909657338003839260381566656,
170141183460469231731687303715884105728,
204399958133082024424731518496078299136,
245556907710782073166015043857318674432,
295001014066853243782145636489477750784,
177200468746272961345336076752392290304,
212880665669732098276382446210774990848,
255745247947835503562868389206950936576,
307240827353347547401607574753443315712,
184552649072141716781794491390137475072,
221713244121518884974124815309574946401,
266356310061270520809673995345359110719,
319988479671385965643116043114178672868,
192209876872921446586714266254161951235,
230912292876569386789935113689005718149,
277407633098725295421526662764935275289,
333265041643201293321649737744276185517,
200184808797092622572327630249651738267,
240493017062571660772163375622796335712,
288917483816076538023589582665008561757,
173546229063471511777292289904643662141,
208490626626972031635281014538153149532,
250471252679363433757155530343900661758,
300904886870600004067510516586852827477,
180746792244690548097558883605316900733,
217141059066909427380630585083218539864,
260863492774290665230282703014708894052,
313389656266867868879861721401276560157,
188246112191795662327951607127115677904,
226150404435492799169987273137391228527,
271686914703601365116141326731156710883,
326392428107359965184387801150473482685,
196056584547032659751107943421776414785,
];
const BASE12_LARGE_EXPONENT: [i32; 68] = [
-1289,
-1257,
-1224,
-1192,
-1160,
-1128,
-1095,
-1063,
-1031,
-999,
-966,
-934,
-902,
-870,
-837,
-805,
-773,
-741,
-708,
-676,
-644,
-611,
-579,
-547,
-515,
-482,
-450,
-418,
-386,
-353,
-321,
-289,
-257,
-224,
-192,
-160,
-127,
-95,
-63,
-31,
2,
34,
66,
98,
131,
163,
195,
227,
260,
292,
324,
356,
389,
421,
453,
486,
518,
550,
582,
615,
647,
679,
711,
744,
776,
808,
840,
873,
];
const BASE12_SMALL_INT_POWERS: [u128; 9] = [1, 12, 144, 1728, 20736, 248832, 2985984, 35831808, 429981696];
const BASE12_STEP: i32 = 9;
const BASE12_BIAS: i32 = 324;
const BASE13_SMALL_MANTISSA: [u128; 8] = [
170141183460469231731687303715884105728,
276479423123262501563991868538311671808,
224639531287650782520743393187378233344,
182519619171216260798104006964744814592,
296594381153226423796919011317710323712,
240982934686996469334996696695639638016,
195798634433184631334684816065207205888,
318172780953925025918862826105961709568,
];
const BASE13_SMALL_EXPONENT: [i32; 8] = [
-127,
-124,
-120,
-116,
-113,
-109,
-105,
-102,
];
const BASE13_LARGE_MANTISSA: [u128; 74] = [
234492264952419818661296823055466035238,
178145751691013993109826848158654507171,
270677660536016922109887166011364690074,
205636101949623162244352604410701629545,
312446962496257587924386799659895562352,
237368592984352411701605597109952160960,
180330922359490147340520816471555077038,
273997845714729128559081401928980460360,
208158474636564731932432542641850208607,
316279498110609430339960234785638219567,
240280202619066059925234911435300433349,
182542896759209079117924981191278218615,
277358756934885281135534847026826478882,
210711787240726612911538723377341283448,
320159044357159213189440578296814412270,
243227526627608078053980201967728671175,
184782003669985976085437039910686134984,
280760893750083272032555777889582843511,
213296419277190995686832685182416132955,
324086177877525444638594829459150002632,
246211003089480177174216643591955743445,
187048575904513609075482455349961378053,
284204761841543230201034707437221523825,
215912754916246372204794564138901211197,
328061482386525623150638173263346085618,
249231075457753005677502945704601914895,
189342950357830398121128390896356453239,
287690873093270135400938070638952191684,
218561183040489207765436578950529361150,
332085548758937481126223466223271077691,
252288192624979397908801362020362227394,
191665468057395263450492571375008762286,
291219745668138391592456499213129019442,
221242097302626033221832363181059870585,
336158975117324458944453423021025623710,
255382808989916127627430380985009698372,
194016474213776704407345321083633835842,
294791904084909668600573533146696407742,
223955896183984548959338021657683010637,
170141183460469231731687303715884105728,
258515384525064083559076046211093889024,
196396318271963640537903969427202768896,
298407879296195459704416306334760173568,
226702983053742437531808354380178063872,
172228168527856562581024588413877561828,
261686384845036905964465455013477410965,
198805353963305641500281734389939339052,
302068208767375943221882620634577632307,
229483766228882688509711411881831930515,
174340752962680465097022527378326959423,
264896281275768246289732905498826672107,
201243939358090266003114541899396801267,
305773436556486878301580275426022079145,
232298659034884347081172590621418853088,
176479250771793883849064971202097683281,
268145550924567936613388404500729180677,
203712436918765324677453955129179600235,
309524113395086409019191949184662333574,
235148079867157707257686510259099274415,
178643979813719299400243488890704650366,
271434676751037481783657313824389119896,
206211213553813977645157972930830162165,
313320796770113796525378889251061848013,
238032452253233081187768481790039531230,
180835261845894060934288352757379708280,
274764147638855414866553566635921015415,
208740640672290674581982064710037218783,
317164051006752246428908041221997358677,
240952204915712388090624317255539471706,
183053422572495239382420468754129441919,
278134458468443185818361944895170594350,
211301094239026043298793364640604498188,
321054447352308147843744474962905446408,
243907771835992919704646129069158162971,
];
const BASE13_LARGE_EXPONENT: [i32; 74] = [
-1282,
-1252,
-1223,
-1193,
-1164,
-1134,
-1104,
-1075,
-1045,
-1016,
-986,
-956,
-927,
-897,
-868,
-838,
-808,
-779,
-749,
-720,
-690,
-660,
-631,
-601,
-572,
-542,
-512,
-483,
-453,
-424,
-394,
-364,
-335,
-305,
-276,
-246,
-216,
-187,
-157,
-127,
-98,
-68,
-39,
-9,
21,
50,
80,
109,
139,
169,
198,
228,
257,
287,
317,
346,
376,
405,
435,
465,
494,
524,
553,
583,
613,
642,
672,
701,
731,
761,
790,
820,
849,
879,
];
const BASE13_SMALL_INT_POWERS: [u128; 8] = [1, 13, 169, 2197, 28561, 371293, 4826809, 62748517];
const BASE13_STEP: i32 = 8;
const BASE13_BIAS: i32 = 312;
const BASE14_SMALL_MANTISSA: [u128; 8] = [
170141183460469231731687303715884105728,
297747071055821155530452781502797185024,
260528687173843511089146183814947536896,
227962601277113072203002910838079094784,
199467276117473938177627546983319207936,
174533866602789695905424103610404306944,
305434266554881967834492181318207537152,
267254983235521721855180658653431595008,
];
const BASE14_SMALL_EXPONENT: [i32; 8] = [
-127,
-124,
-120,
-116,
-112,
-108,
-105,
-101,
];
const BASE14_LARGE_MANTISSA: [u128; 72] = [
251548413169278560512334209582633427955,
172868555043538834443100066630384298338,
237596707101714066585640360644079693184,
326561387705008590881101164026582541311,
224418808746721891131396635947419054595,
308449214239576126269380201889590576494,
211971800172033630882960469392933087940,
291341601754078780972414349774563326428,
200215143815698040798730279921859793515,
275182833977670641254081992250398936156,
189110550462878905579110756278883461660,
259920284847963995399800125815215983072,
178621854545095883446307559621296276382,
245504247117858718392171207907774065824,
337429792711562885676838629607664070711,
231887770468403152813044191455947332680,
318714821597104302344272129046782646031,
219026508600450572879143037057044702127,
301037844611736789461197056572315300910,
206878574807117564156377107253687360168,
284341291171704802743493772571841275116,
195404405556671025581418948604574579552,
268570783748031302676865943988466296381,
184566631641558957302915986868221103411,
253674960769150428442670675281025859157,
174329956473941702727882427159635204541,
239605309345945263344621501916001364416,
329322082262710237520775170056072850605,
226316007274407653805017736090948441653,
311056791556242112413125050076207081650,
213763773801352511153375590062662203372,
293804554217770280277607620947080882230,
201907728667158642949418150287074186439,
277509182960549548157083678768414391770,
190709258966464876623809832149485832940,
262117606830390855604604612394616145902,
180131893393211845729384454981934494079,
247579698363561878555441197267606485702,
170141183460469231731687303715884105728,
233848110331081506623283076321752645632,
321409182616407632938244080939940446208,
220878121537715117784741212850409701376,
303582767467198764972828371186555551744,
208627491173467029036775346642092064768,
286745064197610355009611023687762970225,
197056321243220373650760726805477101625,
270841235580262673674173137819514560921,
186126926626483659918254253754028720893,
255819485841579348845580110620374327715,
175803712344053086257499345217280929659,
241630891972710985114650364591580944199,
332106115263742508816700348007180790592,
228229244396512279339912293302076319311,
313686412889065357315780098042512623701,
215570896471654994597359469530054904893,
296288328063653274657691113306601058431,
203614622343740041422835873088956724196,
279855198502973302491761604313633635665,
192321482680456518790460799730877816261,
264333504599995236391965677440014878764,
181654697853512422889189735564216996803,
249672695121914450880056351845343996855,
171579528154314464133715598246382584383,
235825022574310344970824197408281461914,
324126321306564057111299587260117144567,
222745387696552489161405202381218740358,
306149204668634768979587047598946613225,
210391192582005308252369450519735221250,
289169158312782474283830561810879736710,
198722201944671478335130298919429936059,
273130881427012463325938578210122255044,
187700412080445632409314398956810353518,
];
const BASE14_LARGE_EXPONENT: [i32; 72] = [
-1285,
-1254,
-1224,
-1194,
-1163,
-1133,
-1102,
-1072,
-1041,
-1011,
-980,
-950,
-919,
-889,
-859,
-828,
-798,
-767,
-737,
-706,
-676,
-645,
-615,
-584,
-554,
-523,
-493,
-463,
-432,
-402,
-371,
-341,
-310,
-280,
-249,
-219,
-188,
-158,
-127,
-97,
-67,
-36,
-6,
25,
55,
86,
116,
147,
177,
208,
238,
268,
299,
329,
360,
390,
421,
451,
482,
512,
543,
573,
604,
634,
664,
695,
725,
756,
786,
817,
847,
878,
];
const BASE14_SMALL_INT_POWERS: [u128; 8] = [1, 14, 196, 2744, 38416, 537824, 7529536, 105413504];
const BASE14_STEP: i32 = 8;
const BASE14_BIAS: i32 = 304;
const BASE15_SMALL_MANTISSA: [u128; 8] = [
170141183460469231731687303715884105728,
319014718988379809496913694467282698240,
299076299051606071403356588563077529600,
280384030360880691940646801777885184000,
262860028463325648694356376666767360000,
246431276684367795650959103125094400000,
231029321891594808422774159179776000000,
216589989273370132896350774231040000000,
];
const BASE15_SMALL_EXPONENT: [i32; 8] = [
-127,
-124,
-120,
-116,
-112,
-108,
-104,
-100,
];
const BASE15_LARGE_MANTISSA: [u128; 70] = [
250900630150587280377850342682701393565,
299434584015762656519487081521438784545,
178678447421354466262014715708770369510,
213241818261213966824485132704511196490,
254491091184140684406056053498886823977,
303719580053283976738045342609656736770,
181235388002241613446887230826356048960,
216293370737313530448778168911616746705,
258132932759965856034693127408739651425,
308065895631104646134849028190499821539,
183828919146951883093674448351327494412,
219388591817396682923135459647357436704,
261826890148575264294539329193196343516,
312474408249691315911417866816293319027,
186459564477102023710796186076704586060,
222528106411894691985532295229724475420,
265573709142416387133758214804806317848,
316946007966797681726272939583274683428,
189127855107486501747742000280219617523,
225712548373888955751123878842649157480,
269374146206443663446975509775551676690,
321481597577162915672598741300570427622,
191834329753307055373436045708607941890,
228942560627082928532238637834630336646,
273228968630845173556739192069109710925,
326082092794781635112624979076905003855,
194579534838936734374686465136944546456,
232218795295605362158733969001967701715,
277138954685954882938577351637270128950,
330748422437782207809506145002547658085,
197364024608240385117657735223630441823,
235541913835671069456466721167496749113,
281104893779381725235703590002221275596,
335481528615950719408183659471355674975,
200188361236473853754168248068850933442,
238912587169125791566529710613345919103,
285127586615387248178740525206042107172,
170141183460469231731687303715884105728,
203053114943784499590328850841600000000,
242331495818902131179520000000000000000,
289207845356544000000000000000000000000,
172575953309595678001642227172851562500,
205958864110335933831952325359648803271,
245799330046413899594233809090775284541,
293346493787707294402529081970820087350,
175045565423820113080636775231191731391,
208906195393080226844550976655564036201,
249316789990916616866725045444974174010,
297544367482333459204270734183314844936,
177550518406095745907734479894927853604,
211895703844201159681805788312089434384,
252884585810862301272632571838697691236,
301802313971178147521594347169174498450,
180091317994529147280371081412973024665,
214927993031252433012289596290523334542,
256503437827277086943219190518379691262,
306121192913408770879770801728425641044,
182668477164486370906358954938714362551,
218003675159015088778073023304915283497,
260174076669190616934963528529542450091,
310501876270165601037714752361776484586,
185282516232160242762660936045505469826,
221123371193098747019724833334214306438,
263897243421146573236258451562349376134,
314945248480606581688897076801472259251,
187933962959619728504626775329093970226,
224287710985311612370215929865332425589,
267673689772824125386430153566188172461,
319452206640471392649554807130291119305,
190623352661362587893902772482928415571,
];
const BASE15_LARGE_EXPONENT: [i32; 70] = [
-1284,
-1253,
-1221,
-1190,
-1159,
-1128,
-1096,
-1065,
-1034,
-1003,
-971,
-940,
-909,
-878,
-846,
-815,
-784,
-753,
-721,
-690,
-659,
-628,
-596,
-565,
-534,
-503,
-471,
-440,
-409,
-378,
-346,
-315,
-284,
-253,
-221,
-190,
-159,
-127,
-96,
-65,
-34,
-2,
29,
60,
91,
123,
154,
185,
216,
248,
279,
310,
341,
373,
404,
435,
466,
498,
529,
560,
591,
623,
654,
685,
716,
748,
779,
810,
841,
873,
];
const BASE15_SMALL_INT_POWERS: [u128; 8] = [1, 15, 225, 3375, 50625, 759375, 11390625, 170859375];
const BASE15_STEP: i32 = 8;
const BASE15_BIAS: i32 = 296;
const BASE17_SMALL_MANTISSA: [u128; 8] = [
170141183460469231731687303715884105728,
180775007426748558714917760198126862336,
192073445390920343634600120210509791232,
204078035727852865111762627723666653184,
216832912960843669181247791956395819008,
230384970020896398505075778953670557696,
244784030647202423411643015138274967552,
260083032562652574874870703584417153024,
];
const BASE17_SMALL_EXPONENT: [i32; 8] = [
-127,
-123,
-119,
-115,
-111,
-107,
-103,
-99,
];
const BASE17_LARGE_MANTISSA: [u128; 67] = [
242357519372662728375060373498171096966,
196814917627041423628769027913700117445,
319660903452112403161269325795427500295,
259591839957616255097162958982226744872,
210810651677570156300974624360660789801,
171196178077006380843936555487576333355,
278051712804343163076920967240438328697,
225801638394791143591435147984466155468,
183370134237042583472660416437030762483,
297824288336843871393537735572731133862,
241858651334916724628852435647948831754,
196409794352921881357331916371145369426,
319002914345514633220184430371226516661,
259057496842743054458415989246502258570,
210376719623757394611528557965027181599,
170843788344482468189688357828247614648,
277479371939006412580670873073737346072,
225336848935989032116058614991615739830,
182992685667322765043701960137104341962,
297211247657519026846228781764556419486,
241360810165739638162969982622013142483,
196005504983412884662857445298594989473,
318346279641847361755138868550752397781,
258524253618237975606418771469177669493,
209943680774466452613153056292584472116,
170492123969995067410761994182235561833,
276908209178500704519431941303594138118,
224873016198504574919954139464723650485,
182616014036679619640392724861134514431,
296599468859408121472112670217716316867,
240863993751428088431121063565557553364,
195602047802007523394399179976814437447,
317690996553211397504541477525504659745,
257992108020089771434235624403421929746,
209511533291127649202286079418781645629,
170141183460469231731687303715884105728,
276338222097818360804550122558443225088,
224410138213025296601555690180338253824,
182240117745863932172015090234506084352,
295988949345058405730513287165118905920,
240368199982629535993820184805831872348,
195199421095732140407812372336079928061,
317037062297446153078380490386689107619,
257461057788947429232455063849242347039,
209080275338955809947349984471742343690,
339581930651806711314806824645491109283,
275769408276943332346622203534744539377,
223948213014292349032159641795245781843,
181864995198918377644202761532864575404,
295379686522363719531147616048257012833,
239873426754333326759263874720553852658,
194797623155139058727680168785666503632,
316384474098117832632118586933880356805,
256931100670110578075784008065054807112,
208649905086942477070838417411852870460,
338882936158725697632383782036927673666,
275201765300840924300371814765015192837,
223487238641092167380922055560365365575,
181490644803170745141604509031893001355,
294771677804553486829405243638525556429,
239379671965861754658715697694088165244,
194396652274299323679629299288271234884,
315733229184507643855046849844924656388,
256402234413519915955050497805856036474,
208220420707848135466354215936729966175,
338185380473947645648707735110624890484,
274635290759447542459052551448368297186,
];
const BASE17_LARGE_EXPONENT: [i32; 67] = [
-1272,
-1239,
-1207,
-1174,
-1141,
-1108,
-1076,
-1043,
-1010,
-978,
-945,
-912,
-880,
-847,
-814,
-781,
-749,
-716,
-683,
-651,
-618,
-585,
-553,
-520,
-487,
-454,
-422,
-389,
-356,
-324,
-291,
-258,
-226,
-193,
-160,
-127,
-95,
-62,
-29,
3,
36,
69,
101,
134,
167,
199,
232,
265,
298,
330,
363,
396,
428,
461,
494,
526,
559,
592,
625,
657,
690,
723,
755,
788,
821,
853,
886,
];
const BASE17_SMALL_INT_POWERS: [u128; 8] = [1, 17, 289, 4913, 83521, 1419857, 24137569, 410338673];
const BASE17_STEP: i32 = 8;
const BASE17_BIAS: i32 = 280;
const BASE18_SMALL_MANTISSA: [u128; 7] = [
170141183460469231731687303715884105728,
191408831393027885698148216680369618944,
215334935317156371410416743765415821312,
242251802231800917836718836736092798976,
272533277510776032566308691328104398848,
306599937199623036637097277744117448704,
172462464674787958108367218731066064896,
];
const BASE18_SMALL_EXPONENT: [i32; 7] = [
-127,
-123,
-119,
-115,
-111,
-107,
-102,
];
const BASE18_LARGE_MANTISSA: [u128; 75] = [
259764989429046712145887613713888779974,
296222660952677279411722167462707735076,
337797118290463899238253918549284876092,
192603247770383575639211190527648274245,
219634857984796466920734002291401705412,
250460318818255417964791343261171179660,
285612092170198511649999639102587856294,
325697370261002112643262654266086944683,
185704281966673733437923590446998072591,
211767631486382365261996259087726574961,
241488937521646207617474790890828249100,
275381589414827976227270551469877695982,
314031030021154964119856834958393443507,
179052434161812488744424286609186187994,
204182205669996766442639895844185984708,
232838907258801165579649662968151663564,
265517538884334791214783518037108753711,
302782573089615796089597203369720463425,
172638852694972345186098175788410725025,
196868486555962367745019627988939060464,
224498717373391335032231518045098273537,
256006814417050404626793229969178591795,
291937031065346039954998156631577529912,
332910005936047335476283449703688561122,
189816741726628588213403698819375225722,
216457269515865090355509585365869594574,
246836760024792608106756526472045881483,
281479971709018296242657937208050445965,
320985312176969416466104839150917967197,
183017587375374702561553597022155160742,
208703862874796048578293668364396201854,
237995173051452727716558620615765508935,
271397479737933588417468230506889186025,
309487755838552588810803796052767101096,
176461975819512133258798291874254633040,
201228179937237770199942876645925476060,
229470287934835004924643178169318563534,
261676138308856451194147028266269550444,
298402037041419227483658365640566588740,
170141183460469231731687303715884105728,
194020272759136452871913121072449323008,
221250760550139932836609227367108313088,
252303011164126931290527343657214803968,
287713403941314941508226937857819803648,
328093598350474163167634651360244400128,
187070549727531559196917812917453861026,
213325653114257310428744028742785781912,
243265625417291205836310243227923719532,
277407633098725295421526662764935275289,
316341426247257477645159711999449660471,
180369762796928745579122531717097251784,
205684419630781050995309380627725821797,
234551954955343535589691141355422293223,
267471010551644448060009348077202513313,
305010211912915299914630616083972269987,
173908995182860443486855135343139262701,
198316891856377323275537495574245323224,
226150404435492799169987273137391228527,
257890313566309108293837274983090159159,
294084876820548989626661915132664622178,
335359298992515654651080492391625827617,
191213265769831372286179520084128641258,
218049793855157992570938056229892893589,
248652793041613380567795520750960012282,
283550882549632193861238568804430594202,
323346872605688987884591669129361771279,
184364088525767284952804747951506893851,
210239343674659878049714940191476577896,
239746156543789930881397013133212694240,
273394211439632029990640781047045990695,
311764726184655516350818907233192566650,
177760245875679923341865534533290364422,
202708660472811443153981984577454872377,
231158551948781603682221903513060749406,
263601347936609267755115798860540547258,
];
const BASE18_LARGE_EXPONENT: [i32; 75] = [
-1266,
-1237,
-1208,
-1178,
-1149,
-1120,
-1091,
-1062,
-1032,
-1003,
-974,
-945,
-916,
-886,
-857,
-828,
-799,
-770,
-740,
-711,
-682,
-653,
-624,
-595,
-565,
-536,
-507,
-478,
-449,
-419,
-390,
-361,
-332,
-303,
-273,
-244,
-215,
-186,
-157,
-127,
-98,
-69,
-40,
-11,
18,
48,
77,
106,
135,
164,
194,
223,
252,
281,
310,
340,
369,
398,
427,
456,
485,
515,
544,
573,
602,
631,
661,
690,
719,
748,
777,
807,
836,
865,
894,
];
const BASE18_SMALL_INT_POWERS: [u128; 7] = [1, 18, 324, 5832, 104976, 1889568, 34012224];
const BASE18_STEP: i32 = 7;
const BASE18_BIAS: i32 = 273;
const BASE19_SMALL_MANTISSA: [u128; 7] = [
170141183460469231731687303715884105728,
202042655359307212681378673162612375552,
239925653239177315059137174380602195968,
284911713221523061632725394576965107712,
338332659450558635688861406060146065408,
200885016548769189940261459848211726336,
238550957151663413054060483569751425024,
];
const BASE19_SMALL_EXPONENT: [i32; 7] = [
-127,
-123,
-119,
-115,
-111,
-106,
-102,
];
const BASE19_LARGE_MANTISSA: [u128; 74] = [
211773375714873706954526795446522416463,
176297720171655089222657736919708805072,
293529685049453215881543661471874663538,
244358452058655253685245151337508023797,
203424239979142604035433607238695466107,
338694414393807804581041366088196084612,
281957318246159342222500231430112814088,
234724654242834897063227749239967575385,
195404267752744776874588226122954622761,
325341434449269614607198466720898964379,
270841190386491955899443752473167688523,
225470667559284387835624717321131334248,
187700481810335462307725392489901825033,
312514893872556142260088491662230499613,
260163314313871975296322899252180920269,
216581518007204247993872678149555585108,
180300416551865148993646942230063074210,
300194037865176954165930472692882676095,
249906412012854191998973084780461202007,
208042821933683442841807340743863291908,
173192097831823827445985218112992713522,
288358929883670982310136287441393538062,
240053886651337192078493312543483732688,
199840762759316398351061941853830886312,
332728047167428932050765437002481330484,
276990419380016367557580152018464109110,
230589795725005243268941857960660823918,
191962068621409314298003076822671000161,
319610290416807823632571053703933063036,
266070110813870135824430347248350305665,
221498825260546806854707890357129976717,
184393990898599943457278294759382590034,
307009699392470911375170613720126268120,
255580333886495993526502175170654921405,
212766265035907553834903279232863277537,
177124283582141234157272719875613305569,
294905884907949220984741236292709278206,
245504114948215358970059027289947453449,
204377984777481442195434041001194890061,
170141183460469231731687303715884105728,
283279261617600303001696824239079817216,
235825149533115640143913831779140632576,
196320411295724208786653789764804673536,
326866782169983241283381922259938632192,
272111016325296008481488740678554545334,
226527775976573799542251126784141726274,
188580506522192103284103254483314456872,
313980104972594785419533005246072709649,
261383077542535819285819131850454151532,
217596950072905364683647533344696965413,
181145746412467300065049161663171614429,
301601483222404786925353682146130769038,
251078086246727305139312855014591629283,
209018220732132084019166621358085321302,
174004100680832526758226172220060851297,
289710886904423785696066284771374024143,
241179367792317286239104434314982328918,
200777706596478115292553836948931709029,
334288026667806625723834320874258952107,
278289075684203471850125042859239363909,
231670904929322723497179168675130067798,
192862073578757583112120353708241916963,
321108767943438131876044073228689471164,
267317567774791732969648063348207624890,
222537311885602256946640972609673172416,
185258513286308067365753274779077551187,
308449099652072036761706748552096805527,
256778610031103646805005837172547824357,
213763809470930565948441961387708938512,
177954722295557497937779873950595261616,
296288537013515928119667265056482304979,
246655149223317717362685108852956230915,
205336201162591117777390249036062770913,
170938882243688352586356584716130516258,
];
const BASE19_LARGE_EXPONENT: [i32; 74] = [
-1287,
-1257,
-1228,
-1198,
-1168,
-1139,
-1109,
-1079,
-1049,
-1020,
-990,
-960,
-930,
-901,
-871,
-841,
-811,
-782,
-752,
-722,
-692,
-663,
-633,
-603,
-574,
-544,
-514,
-484,
-455,
-425,
-395,
-365,
-336,
-306,
-276,
-246,
-217,
-187,
-157,
-127,
-98,
-68,
-38,
-9,
21,
51,
81,
110,
140,
170,
200,
229,
259,
289,
319,
348,
378,
408,
437,
467,
497,
527,
556,
586,
616,
646,
675,
705,
735,
765,
794,
824,
854,
884,
];
const BASE19_SMALL_INT_POWERS: [u128; 7] = [1, 19, 361, 6859, 130321, 2476099, 47045881];
const BASE19_STEP: i32 = 7;
const BASE19_BIAS: i32 = 273;
const BASE20_SMALL_MANTISSA: [u128; 7] = [
170141183460469231731687303715884105728,
212676479325586539664609129644855132160,
265845599156983174580761412056068915200,
332306998946228968225951765070086144000,
207691874341393105141219853168803840000,
259614842926741381426524816461004800000,
324518553658426726783156020576256000000,
];
const BASE20_SMALL_EXPONENT: [i32; 7] = [
-127,
-123,
-119,
-115,
-110,
-106,
-102,
];
const BASE20_LARGE_MANTISSA: [u128; 72] = [
219444962751747547330237450047488370802,
261598781051334795153424084243164504531,
311850048364799970571308236412006025948,
185877113559722882849757812268737570016,
221582786512044528543660416923448526878,
264147265567832623176169892458258303259,
314888078651228693933689466069052580904,
187687920720117505749278942387731421532,
223741436863085634409521749481834675708,
266720577315194170963194071628850311885,
317955705303185189918510999237120523316,
189516368689051383685178160212707831452,
225921116696657399755928707376370229068,
269318958159276723570738682003462587676,
321053216647239593947814323906257853121,
191362629322552438943275406304751547051,
228122030881109760932058580285014566244,
271942652322184754529069161754863937192,
324180903818827574883781864350871964922,
193226876150862917234767594546599367214,
230344386280611654799899571593522271174,
274591906405224388599276031963255728690,
327339060789614187001318969682759915221,
195109284394749514461349826862072894109,
232588391774594204975783618524161450993,
277266969412081485957841418414308370343,
330527984395124299475957654016385519914,
197010030981972396061395200500718069025,
234854258277383322788948059678933702737,
279968092772225526319680285071055534765,
333747974362642200374222141588992517906,
198929294563914656862152899258728336040,
237142198758023568227473377297792835283,
282695530364541492733327600118866962532,
336999333339382997433337688587745383420,
200867255532373784442745261542645325315,
239452428260295134118491722992235809940,
285449538541191976211657193889899027276,
170141183460469231731687303715884105728,
202824096036516704239472512860160000000,
241785163922925834941235200000000000000,
288230376151711744000000000000000000000,
171798691840000000000000000000000000000,
204800000000000000000000000000000000000,
244140625000000000000000000000000000000,
291038304567337036132812500000000000000,
173472347597680709441192448139190673828,
206795153138256918717852173017490713391,
246519032881566189191165176650870696772,
293873587705571876992184134305561419454,
175162308040602133865466197911239516410,
208809742975952784854729411496209521782,
248920611114445668285762562151204969623,
296736492054993710858538820923811161069,
176868732008334225927912486150152183216,
210843958864610464486971481025400380154,
251345585423243599518503524095297312920,
299627286700300692937974362486955300474,
178591779887855465971216179422709524914,
212897992000407535995502685812365442412,
253794183731564922327402455583054354682,
302546243347602990063908643225496238091,
180331613628627651967947866455016278082,
214972035442146840057310898846407268146,
256266636183436918326986907537468991453,
305493636349960468205197939321361769978,
182088396757817547443627082897044283139,
217066284129402097992452481862359384464,
258763175164940474024358370140027266101,
308469742733169167070816004443201143863,
183862294395666818064937594201088633455,
219180934900840303975269310714112083263,
];
const BASE20_LARGE_EXPONENT: [i32; 72] = [
-1277,
-1247,
-1217,
-1186,
-1156,
-1126,
-1096,
-1065,
-1035,
-1005,
-975,
-944,
-914,
-884,
-854,
-823,
-793,
-763,
-733,
-702,
-672,
-642,
-612,
-581,
-551,
-521,
-491,
-460,
-430,
-400,
-370,
-339,
-309,
-279,
-249,
-218,
-188,
-158,
-127,
-97,
-67,
-37,
-6,
24,
54,
84,
115,
145,
175,
205,
236,
266,
296,
326,
357,
387,
417,
447,
478,
508,
538,
568,
599,
629,
659,
689,
720,
750,
780,
810,
841,
871,
];
const BASE20_SMALL_INT_POWERS: [u128; 7] = [1, 20, 400, 8000, 160000, 3200000, 64000000];
const BASE20_STEP: i32 = 7;
const BASE20_BIAS: i32 = 266;
const BASE21_SMALL_MANTISSA: [u128; 7] = [
170141183460469231731687303715884105728,
223310303291865866647839586127097888768,
293094773070573949975289456791815979008,
192343444827564154671283706019629236224,
252450771336177953006059864150763372544,
331341637378733563320453571697876926464,
217442949529793900929047656426731732992,
];
const BASE21_SMALL_EXPONENT: [i32; 7] = [
-127,
-123,
-119,
-114,
-110,
-106,
-101,
];
const BASE21_LARGE_MANTISSA: [u128; 72] = [
265792046637109917415346664544311644566,
222919047571269915259553685343512655124,
186961582932271121624867982904669033286,
313608315425491608924946770674906010971,
263022418727710133477288744271513099136,
220596168374913987040298637494305910349,
185013390634471631571140317809259206000,
310340428541697166126551714455108139315,
260281651120390792657949798157903984485,
218297494233351046265168261721480533031,
183085499048559996047315841365348324923,
307106593958686861611740529249331599561,
257569443082684061423017949935163592863,
216022772923099798407562907443165238977,
181177696635406520735133253192775193924,
303906456841905544859103298218510174905,
254885497015839035366704878377106222377,
213771754848918589809660748287013123679,
179289774060178761532557823153782969422,
300739666054273966520895709937608788747,
252229518422167527105381200194678741672,
211544193016418411141172507362190098875,
177421524169372127003871154186445625381,
297605874117660039208334869188863219128,
249601215872730120248972738434931034589,
209339843004961281067680970866486691183,
175572741968079828414917198043029764862,
294504737174751578579986057113044461622,
247000300975358943781849899984000214119,
207158462940841036386486635842909509778,
173743224597499683284324187350601048284,
291435914951326341195521446658582144907,
244426488343013658131803347774089798564,
204999813470743585875109991683322467328,
171932771312675304370424739613867083896,
288399070718915219190771894363169343679,
241879495562467180767563428674995339169,
202863657735483715761934442388454879916,
170141183460469231731687303715884105728,
285393871257854494969375049060085399552,
239359043163317715346200180609446313984,
200749761344015565073276401119215484928,
336736528915531181897146582027467512352,
282419986820723101796180638245767114566,
236864854587323684235605162154192799609,
198657892347713919139770232958888414539,
333227639539799771559276379603105082665,
279477091096160878422591085338554667498,
234396656158058199668034426556911280906,
196587821214923499260650393397155679946,
329755313778627116894330266634709348105,
276564861173063847678827937275753188756,
231954177050879743842271364358265802922,
194539320805773455930561882331086488568,
326319170628861950820780822968026849107,
273682977505152590337309001442167333935,
229537149263215762988196018745023784859,
192512166347254302133159603748230049238,
322918833057513041780316846850363342758,
270831123875909826489436864951365328546,
227145307585155914742230901032159391581,
190506135408554552002160365053046193282,
319553927960379009120613001977483142041,
268008987363883357189628558586004761583,
224778389570351742159039695242233732277,
188521007876654358646847770858984158583,
316224086121109227441755855330741121363,
265216258308350559209803685525363124313,
222436135507219581307712678266362793773,
186556565932173473138426942632517671964,
312928942170691327838033505846831903751,
262452630275340665419193194878653363790,
];
const BASE21_LARGE_EXPONENT: [i32; 72] = [
-1296,
-1265,
-1234,
-1204,
-1173,
-1142,
-1111,
-1081,
-1050,
-1019,
-988,
-958,
-927,
-896,
-865,
-835,
-804,
-773,
-742,
-712,
-681,
-650,
-619,
-589,
-558,
-527,
-496,
-466,
-435,
-404,
-373,
-343,
-312,
-281,
-250,
-220,
-189,
-158,
-127,
-97,
-66,
-35,
-5,
26,
57,
88,
118,
149,
180,
211,
241,
272,
303,
334,
364,
395,
426,
457,
487,
518,
549,
580,
610,
641,
672,
703,
733,
764,
795,
826,
856,
887,
];
const BASE21_SMALL_INT_POWERS: [u128; 7] = [1, 21, 441, 9261, 194481, 4084101, 85766121];
const BASE21_STEP: i32 = 7;
const BASE21_BIAS: i32 = 266;
const BASE22_SMALL_MANTISSA: [u128; 7] = [
170141183460469231731687303715884105728,
233944127258145193631070042609340645376,
321673174979949641242721308587843387392,
221150307798715378354370899654142328832,
304081673223233645237259987024445702144,
209056150340973131100616241079306420224,
287452206718838055263347331484046327808,
];
const BASE22_SMALL_EXPONENT: [i32; 7] = [
-127,
-123,
-119,
-114,
-110,
-105,
-101,
];
const BASE22_LARGE_MANTISSA: [u128; 70] = [
170993699408656992611557257796811971606,
198613611477559667549559644399735817047,
230694854843066209807480559654047740794,
267958050080955588510051414081700394572,
311240216657766425412953324616068813788,
180756787183491671385793896073455879749,
209953690842110549054787911387661891558,
243866650791248218437107825156701479612,
283257432291885574825362738029166670391,
329010845428281790557809997379933231677,
191077310017213090920037889613280023761,
221941245467987325560887198530024987097,
257790506028392555656294807759853932728,
299430350849140679073407301022315056449,
173898054647064197545039940705011138943,
201987095324676314922450395008827008097,
234613243722037545951821958217296505941,
272509360270263083361596599896866808472,
316526681344939644363801942778159729297,
183826970023851061892407973678416422311,
213519787744680626489456759979414929795,
248008764723795396613310192753363562635,
288068604926548520494484698905215058937,
334599147077506390730919115808572688418,
194322788582847037606425160078121997271,
225710952896522753756036626884027523975,
262169118861406100263284327408804984594,
304516223083230613247976703037939646270,
176851740822108453297561032060281913714,
205417878332621336576645714920472857997,
238598187060653380400994399373084663429,
277137975188549744820727493204211809261,
321902937477411396463387072352875080544,
186949300409097210175717446748311788922,
217146455371525722164937611369356262209,
252221233121680633945860233133208134270,
292961496095243353908740467141073506540,
170141183460469231731687303715884105728,
197623392119201162993551290395281850368,
229544689406569328704727047276706398208,
266622103131276669014944105065242165248,
309688479667831891620434363534947647488,
179855595827611186243917689814617910464,
208906933736774069538597567757512183241,
242650815297018604365857953016443636978,
281845207868958552685905724295461354592,
327370510177191550022527822209865447333,
190124664073591590972067520727552350138,
220834722526051754798575401303998056567,
256505250966711193359488809204377717494,
297937493800295372760917121026044042670,
173031058579617612943075122066206208260,
200980056932689281584830175015332323410,
233443542542281837469979323535186565406,
271150722048713022289973166238934106646,
314948587854906379895896832699151980516,
182910471789153927982518189465009158829,
212455251303071888680280266327561854998,
246772278069909496307705991140052073087,
286632393646709698979385809127728921005,
332930950470730393610585733499849696474,
193353961796034982060992467369794830962,
224585635486054469192295827945894724481,
260862033537650797156363766298784568546,
302998009619470597652934458975103615488,
175970018688269509849993361647138860754,
204393735233038880379975139336743154541,
237408618319925875163860351801153447367,
275756260280259146490263920764281465178,
320298039817924375055421761218548035863,
];
const BASE22_LARGE_EXPONENT: [i32; 70] = [
-1282,
-1251,
-1220,
-1189,
-1158,
-1126,
-1095,
-1064,
-1033,
-1002,
-970,
-939,
-908,
-877,
-845,
-814,
-783,
-752,
-721,
-689,
-658,
-627,
-596,
-565,
-533,
-502,
-471,
-440,
-408,
-377,
-346,
-315,
-284,
-252,
-221,
-190,
-159,
-127,
-96,
-65,
-34,
-3,
29,
60,
91,
122,
153,
185,
216,
247,
278,
310,
341,
372,
403,
434,
466,
497,
528,
559,
590,
622,
653,
684,
715,
747,
778,
809,
840,
871,
];
const BASE22_SMALL_INT_POWERS: [u128; 7] = [1, 22, 484, 10648, 234256, 5153632, 113379904];
const BASE22_STEP: i32 = 7;
const BASE22_BIAS: i32 = 259;
const BASE23_SMALL_MANTISSA: [u128; 7] = [
170141183460469231731687303715884105728,
244577951224424520614300499091583401984,
175790402442555124191528483722075570176,
252698703511172991025322195350483632128,
181627193148655587299450327908160110592,
261089090151192406742959846367980158976,
187657783546169542346502389576985739264,
];
const BASE23_SMALL_EXPONENT: [i32; 7] = [
-127,
-123,
-118,
-114,
-109,
-105,
-100,
];
const BASE23_LARGE_MANTISSA: [u128; 69] = [
177660070384959299518117426820409879479,
281679224484842507661590842703493245235,
223300557447880794264720046366338636067,
177021003404592607294928857171705382014,
280665986726726659567026238400885338462,
222497315545222527698408099502330410230,
176384235233432227183413281705333529169,
279656393720034524921314175179274359595,
221696963010873772243653930801015609536,
175749757602354687973874432000535316950,
278650432354108872233513992865613552171,
220899489451391157505367921930602163472,
175117562271981659025201047697761937562,
277648089565453253577594524944387660343,
220104884510717915806439152820624263438,
174487641032572953025011241897191693675,
276649352337562360960754521131809259049,
219313137870049397588841701361789229875,
173859985703919913633146478806481352851,
275654207700752992922523689325318624601,
218524239247699070573788964393354746146,
173234588135239186624038395745277208596,
274662642731995629169562809047557585825,
217738178398965000940790150805824878955,
172611440205066873148451849294509762826,
273674644554746611058977369746265857416,
216954945115996814791722634413562231827,
171990533821153063740069798803230423676,
272690200338780925750826785583705218666,
216174529227663138172270874689475697712,
171371860920356751697330024074687407971,
271709297300025591858350535820526217684,
215396920599419513929297198496715326537,
170755413468541124475850272054650469150,
270731922700393644432243678371210997948,
214622109133176793688901966303396671549,
170141183460469231731687303715884105728,
269758063847618717123097185016917000192,
213850084767170003246100602438595641344,
339058325839400057321133061640411938816,
268787708095090219373873551177395072962,
213080837475827679663192730864754774513,
337838687796969586566185112723027994705,
267820842841689106502015241773782572538,
212314357269641678380024305538561269739,
336623436955327832661614051077606366471,
266857455531624240538482847903341038248,
211550634195037448645447237257455979321,
335412557533128124785597638278283462337,
265897533654269339698691446779528819034,
210789658334244775585362676204225495858,
334206033805791401974785682123232789907,
264941064744000514367957679290425962065,
210031419805168987228793890184514974036,
333003850105302012456495057986285588216,
263988036380034387491686584861354377998,
209275908761262624819472661494385533289,
331805990820004247517955628678622148639,
263038436186266797268116360982380732098,
208523115391397574746439388866966551936,
330612440394399607270379273154482344971,
262092251831112080049001043331284413642,
207773029919737660433151703156509162570,
329423183328944795675128680336602321085,
261149471027342931361145730086041639640,
207025642605611692530569464171386341133,
328238204179850442208732821518504518810,
260210081531930842969216498623209392426,
206280943743386975765635578931435897048,
];
const BASE23_LARGE_EXPONENT: [i32; 69] = [
-1267,
-1236,
-1204,
-1172,
-1141,
-1109,
-1077,
-1046,
-1014,
-982,
-951,
-919,
-887,
-856,
-824,
-792,
-761,
-729,
-697,
-666,
-634,
-602,
-571,
-539,
-507,
-476,
-444,
-412,
-381,
-349,
-317,
-286,
-254,
-222,
-191,
-159,
-127,
-96,
-64,
-33,
-1,
31,
62,
94,
126,
157,
189,
221,
252,
284,
316,
347,
379,
411,
442,
474,
506,
537,
569,
601,
632,
664,
696,
727,
759,
791,
822,
854,
886,
];
const BASE23_SMALL_INT_POWERS: [u128; 7] = [1, 23, 529, 12167, 279841, 6436343, 148035889];
const BASE23_STEP: i32 = 7;
const BASE23_BIAS: i32 = 252;
const BASE24_SMALL_MANTISSA: [u128; 7] = [
170141183460469231731687303715884105728,
255211775190703847597530955573826158592,
191408831393027885698148216680369618944,
287113247089541828547222325020554428416,
215334935317156371410416743765415821312,
323002402975734557115625115648123731968,
242251802231800917836718836736092798976,
];
const BASE24_SMALL_EXPONENT: [i32; 7] = [
-127,
-123,
-118,
-114,
-109,
-105,
-100,
];
const BASE24_LARGE_MANTISSA: [u128; 68] = [
256006814417050404626793229969178591795,
273382276918988884237693747042282021609,
291937031065346039954998156631577529912,
311751116669878803408975082301396512655,
332910005936047335476283449703688561122,
177752486079622930343415992310050508587,
189816741726628588213403698819375225722,
202699811599676133995465766268541805984,
216457269515865090355509585365869594574,
231148461148045387015380597263260157877,
246836760024792608106756526472045881483,
263589840905381559535877208688654464260,
281479971709018296242657937208050445965,
300584325257628424747408646813479651038,
320985312176969416466104839150917967197,
171385468196052762160979317193129295473,
183017587375374702561553597022155160742,
195439191206027575440487166351295574484,
208703862874796048578293668364396201854,
222868822317958475703480592144987545632,
237995173051452727716558620615765508935,
254148165753675349373102394182948812519,
271397479737933588417468230506889186025,
289817523528740604428224130917268871991,
309487755838552588810803796052767101096,
330493028329548101430287061507520336961,
176461975819512133258798291874254633040,
188438643123668474334468683754392032451,
201228179937237770199942876645925476060,
214885756602899904017224155871405769601,
229470287934835004924643178169318563534,
245044687360099685434665347000146337133,
261676138308856451194147028266269550444,
279436384024154813848437280673013431065,
298402037041419227483658365640566588740,
318654909672648364505254319167929262488,
170141183460469231731687303715884105728,
181688851673850688377539127552069599232,
194020272759136452871913121072449323008,
207188640880972374233825193254612631552,
221250760550139932836609227367108313088,
236267291661697281793781435669856387072,
252303011164126931290527343657214803968,
269427092488254686881046533485512097792,
287713403941314941508226937857819803648,
307240827353347547401607574753443315712,
328093598350474163167634651360244400128,
175180834861447020226468989874232056416,
187070549727531559196917812917453861026,
199767232545952890607255496509019333039,
213325653114257310428744028742785781912,
227804298516055047806476167412340090352,
243265625417291205836310243227923719532,
259776329486140560138677002900131432918,
277407633098725295421526662764935275289,
296235592571734482952577544661578831571,
316341426247257477645159711999449660471,
337811864845093800590802876046287308325,
180369762796928745579122531717097251784,
192611655877384358682393055110005707838,
205684419630781050995309380627725821797,
219644446158456132093135554410564634898,
234551954955343535589691141355422293223,
250471252679363433757155530343900661758,
267471010551644448060009348077202513313,
285624560584202347610957248166426707331,
305010211912915299914630616083972269987,
325711588600364141070945877624827809796,
];
const BASE24_LARGE_EXPONENT: [i32; 68] = [
-1283,
-1251,
-1219,
-1187,
-1155,
-1122,
-1090,
-1058,
-1026,
-994,
-962,
-930,
-898,
-866,
-834,
-801,
-769,
-737,
-705,
-673,
-641,
-609,
-577,
-545,
-513,
-481,
-448,
-416,
-384,
-352,
-320,
-288,
-256,
-224,
-192,
-160,
-127,
-95,
-63,
-31,
1,
33,
65,
97,
129,
161,
193,
226,
258,
290,
322,
354,
386,
418,
450,
482,
514,
546,
579,
611,
643,
675,
707,
739,
771,
803,
835,
867,
];
const BASE24_SMALL_INT_POWERS: [u128; 7] = [1, 24, 576, 13824, 331776, 7962624, 191102976];
const BASE24_STEP: i32 = 7;
const BASE24_BIAS: i32 = 252;
const BASE25_SMALL_MANTISSA: [u128; 7] = [
170141183460469231731687303715884105728,
265845599156983174580761412056068915200,
207691874341393105141219853168803840000,
324518553658426726783156020576256000000,
253530120045645880299340641075200000000,
198070406285660843983859875840000000000,
309485009821345068724781056000000000000,
];
const BASE25_SMALL_EXPONENT: [i32; 7] = [
-127,
-123,
-118,
-114,
-109,
-104,
-100,
];
const BASE25_LARGE_MANTISSA: [u128; 68] = [
285793394306920833441610418092098634655,
203068420253004570555511362849258201390,
288577581746103207017755725657449092679,
205046704412910121830119952091883627559,
291388892624283530821742192659774598780,
207044260935364498850036477975162511299,
294227591176883860910658765384315687611,
209061277570927374050781655074839937648,
297093944213496817569054052050375869453,
211097943899216614887176072592734406508,
299988221142963048588365030287739055137,
213154451346726893197828921904416471830,
302910693998692996157485768413290076965,
215230993204821882725842221200657943544,
305861637464235347360161968596028634045,
217327764647901735884376228537482684576,
308841328899094571460716776609676066664,
219444962751747547330237450047488370802,
311850048364799970571308236412006025948,
221582786512044528543660416923448526878,
314888078651228693933689466069052580904,
223741436863085634409521749481834675708,
317955705303185189918510999237120523316,
225921116696657399755928707376370229068,
321053216647239593947814323906257853121,
228122030881109760932058580285014566244,
324180903818827574883781864350871964922,
230344386280611654799899571593522271174,
327339060789614187001318969682759915221,
232588391774594204975783618524161450993,
330527984395124299475957654016385519914,
234854258277383322788948059678933702737,
333747974362642200374222141588992517906,
237142198758023568227473377297792835283,
336999333339382997433337688587745383420,
239452428260295134118491722992235809940,
170141183460469231731687303715884105728,
241785163922925834941235200000000000000,
171798691840000000000000000000000000000,
244140625000000000000000000000000000000,
173472347597680709441192448139190673828,
246519032881566189191165176650870696772,
175162308040602133865466197911239516410,
248920611114445668285762562151204969623,
176868732008334225927912486150152183216,
251345585423243599518503524095297312920,
178591779887855465971216179422709524914,
253794183731564922327402455583054354682,
180331613628627651967947866455016278082,
256266636183436918326986907537468991453,
182088396757817547443627082897044283139,
258763175164940474024358370140027266101,
183862294395666818064937594201088633455,
261284035326052074402891767876281837538,
185653473271011701515143789632334288014,
263829453602698580304979415177988198613,
187462101736953869352205554703508169192,
266399669239026862544798113253119949479,
189288349786683953755640255602884245064,
268994923809890385876486015494726082500,
191132389069459226417170338759437756337,
271615461243554856334256923502490730495,
192994392906736931318972184714148973580,
274261527844625066050770363850331497104,
194874536308464787773268059716493991903,
276933372317195090450451374005771742621,
196772995989530194869453349330805553038,
279631245788224013707368483964622716141,
];
const BASE25_LARGE_EXPONENT: [i32; 68] = [
-1298,
-1265,
-1233,
-1200,
-1168,
-1135,
-1103,
-1070,
-1038,
-1005,
-973,
-940,
-908,
-875,
-843,
-810,
-778,
-745,
-713,
-680,
-648,
-615,
-583,
-550,
-518,
-485,
-453,
-420,
-388,
-355,
-323,
-290,
-258,
-225,
-193,
-160,
-127,
-95,
-62,
-30,
3,
35,
68,
100,
133,
165,
198,
230,
263,
295,
328,
360,
393,
425,
458,
490,
523,
555,
588,
620,
653,
685,
718,
750,
783,
815,
848,
880,
];
const BASE25_SMALL_INT_POWERS: [u128; 7] = [1, 25, 625, 15625, 390625, 9765625, 244140625];
const BASE25_STEP: i32 = 7;
const BASE25_BIAS: i32 = 252;
const BASE26_SMALL_MANTISSA: [u128; 7] = [
170141183460469231731687303715884105728,
276479423123262501563991868538311671808,
224639531287650782520743393187378233344,
182519619171216260798104006964744814592,
296594381153226423796919011317710323712,
240982934686996469334996696695639638016,
195798634433184631334684816065207205888,
];
const BASE26_SMALL_EXPONENT: [i32; 7] = [
-127,
-123,
-118,
-113,
-109,
-104,
-99,
];
const BASE26_LARGE_MANTISSA: [u128; 67] = [
223302816785416365261501121183664506010,
208793887424582006747864373745206480886,
195227664627991173689253365541181602096,
182542896759209079117924981191278218615,
170682311959929403775713752016508602388,
319184719133881733167774634228398630548,
298445936660656380797439373851559361096,
279054640682520272457995982566385389064,
260923279297292454826462160021044868443,
243969989220528359050303591757077787596,
228118226171942658526451569535286060353,
213296419277190995686832685182416132955,
199437647924631042854519895051784617004,
186479339618067826498814972661362929947,
174362987461285330626576271532417342855,
326067771997608226855765039505019953527,
304881768440366443726402955195105316329,
285072309225356538301642822964643005408,
266549954439052068809893515776468694564,
249231075457753005677502945704601914895,
233037477363483566918311865718592557833,
217896045893127676516686822732460831572,
203738417326773735777703283427712394918,
190500669824811165252338688092226229364,
178123034820162511238845936350714491622,
333099254325168111301464298292509503356,
311456385593267303107050428484389238716,
291219745668138391592456499213129019442,
272297965910924348580716754684381379181,
254605614290044560620651113294031241626,
238062809654687405271268739306918462570,
222594861070586991002412082254420837256,
208131930589681357218231284385128680344,
194608717931053648412097371491373800423,
181964165649487446029462142596867446143,
170141183460469231731687303715884105728,
318172780953925025918862826105961709568,
297499748388299952530789444812804194304,
278169930267914565987548746187341299712,
260096052263752396381159488684908609536,
243196510629429753543644020787720315589,
227395003759435617782759026890197718352,
212620187686592486096128182198450396409,
198805353963305641500281734389939339052,
185888128472231349675004689621278542958,
173810189806491030350550655153103473999,
325034011895830307254166714675296871096,
303915176108832810280521264920190203131,
284168520489679119677023043643028417295,
265704888683728554332237168601547339173,
248440917202145588620033973783642939305,
232298659034884347081172590621418853088,
217205231719130933968079964556427917884,
203092488274228969742684708734280089507,
189896709517356115129460946793154219973,
177558316370753675479515454481338457101,
332043201723146894831623394706398020929,
310468949199606660363664220576467010752,
290296467197293861525395669447395056845,
271434676751037481783657313824389119896,
253798416681617203255579043607175584203,
237308059092157195001470401326248026898,
221889149847346996027560241559399617642,
207472072412249451654170398205728730819,
193991733532924439390933354984357040572,
181387269339713144970498252974494732833,
339203541092472346195720855153810480522,
];
const BASE26_LARGE_EXPONENT: [i32; 67] = [
-1279,
-1246,
-1213,
-1180,
-1147,
-1115,
-1082,
-1049,
-1016,
-983,
-950,
-917,
-884,
-851,
-818,
-786,
-753,
-720,
-687,
-654,
-621,
-588,
-555,
-522,
-489,
-457,
-424,
-391,
-358,
-325,
-292,
-259,
-226,
-193,
-160,
-127,
-95,
-62,
-29,
4,
37,
70,
103,
136,
169,
202,
234,
267,
300,
333,
366,
399,
432,
465,
498,
531,
563,
596,
629,
662,
695,
728,
761,
794,
827,
860,
892,
];
const BASE26_SMALL_INT_POWERS: [u128; 7] = [1, 26, 676, 17576, 456976, 11881376, 308915776];
const BASE26_STEP: i32 = 7;
const BASE26_BIAS: i32 = 245;
const BASE27_SMALL_MANTISSA: [u128; 6] = [
170141183460469231731687303715884105728,
287113247089541828547222325020554428416,
242251802231800917836718836736092798976,
204399958133082024424731518496078299136,
172462464674787958108367218731066064896,
291030409138704679307869681608673984512,
];
const BASE27_SMALL_EXPONENT: [i32; 6] = [
-127,
-123,
-118,
-113,
-108,
-104,
];
const BASE27_LARGE_MANTISSA: [u128; 76] = [
301829093537629265639465570217176944359,
217807991453958805640698687941213190524,
314352208961548438173441007673156326734,
226845008347394462887832488874694288292,
327394917835133689224334116987590197085,
236256977848340413085493360278597848651,
170489389240119998671196096475026672256,
246059457021648542224892012444309926233,
177563121844831037921653709250257605479,
256268648406457241006138264113659504394,
184930348919702200346046943747485274024,
266901426797403574706768528236472000862,
192603247770383575639211190527648274245,
277975367137008028446553971650055283412,
200594500948068090486693848039128919647,
289508773565335211238455692680966173052,
208917317212507950117664039252872831665,
301520709674946766164053267333891939739,
217585453364802351586979201161384846208,
314031030021154964119856834958393443507,
226613236986043931067161987739751269180,
327060412939660347810097743318775450603,
236015590119408703302029793810763336632,
170315197362908885300398426895467760677,
245808053934833671173174941698733239342,
177381702616012906692133545122052956869,
256006814417050404626793229969178591795,
184741402471039290909022270993420155647,
266628729119434395515123988465075762881,
192406461791880080316008520325217417399,
277691355027891684120101092281051616669,
200389550171752283164939097875653100692,
289212977580839036146652597763405686112,
208703862874796048578293668364396201854,
301212640893244858516269504216828222245,
217363142646555453321168098187951653993,
313710179234688236904530296665341569850,
226381702429392491474935736226666160567,
326726249813466247246220462666861782844,
235774449020380624184618955567855082461,
170141183460469231731687303715884105728,
245556907710782073166015043857318674432,
177200468746272961345336076752392290304,
255745247947835503562868389206950936576,
184552649072141716781794491390137475072,
266356310061270520809673995345359110719,
192209876872921446586714266254161951235,
277407633098725295421526662764935275289,
200184808797092622572327630249651738267,
288917483816076538023589582665008561757,
208490626626972031635281014538153149532,
300904886870600004067510516586852827477,
217141059066909427380630585083218539864,
313389656266867868879861721401276560157,
226150404435492799169987273137391228527,
326392428107359965184387801150473482685,
235533554299270254021060647605641184828,
339934694701922439619874702371784251126,
245306018087052741642305313258629505287,
177019420046226713314377865847118993119,
255483948725482657093998355855298189652,
184364088525767284952804747951506893851,
266084169338241408156670471179837543899,
192013492808081754945415747456910215687,
277124201053027125645172361985060059244,
199980276610139913759598726349951659975,
288622291962264730584478255384696488209,
208277608246209791806511248482402407710,
300597447285417578884462942447710218615,
216919202393792943992865658673403318648,
313069460782756034010893203297842312622,
225919342762644710883872352816958877073,
326058947472506854027112756453181563499,
235292905704349129354647627776916151748,
339587377705461640362820917278613293254,
245055384801472810432512717678228228007,
];
const BASE27_LARGE_EXPONENT: [i32; 76] = [
-1269,
-1240,
-1212,
-1183,
-1155,
-1126,
-1097,
-1069,
-1040,
-1012,
-983,
-955,
-926,
-898,
-869,
-841,
-812,
-784,
-755,
-727,
-698,
-670,
-641,
-612,
-584,
-555,
-527,
-498,
-470,
-441,
-413,
-384,
-356,
-327,
-299,
-270,
-242,
-213,
-185,
-156,
-127,
-99,
-70,
-42,
-13,
15,
44,
72,
101,
129,
158,
186,
215,
243,
272,
300,
329,
357,
386,
415,
443,
472,
500,
529,
557,
586,
614,
643,
671,
700,
728,
757,
785,
814,
842,
871,
];
const BASE27_SMALL_INT_POWERS: [u128; 6] = [1, 27, 729, 19683, 531441, 14348907];
const BASE27_STEP: i32 = 6;
const BASE27_BIAS: i32 = 240;
const BASE28_SMALL_MANTISSA: [u128; 6] = [
170141183460469231731687303715884105728,
297747071055821155530452781502797185024,
260528687173843511089146183814947536896,
227962601277113072203002910838079094784,
199467276117473938177627546983319207936,
174533866602789695905424103610404306944,
];
const BASE28_SMALL_EXPONENT: [i32; 6] = [
-127,
-123,
-118,
-113,
-108,
-103,
];
const BASE28_LARGE_MANTISSA: [u128; 76] = [
200215143815698040798730279921859793515,
179711238516029806533278035755362570551,
322614250185735942212427179391214768413,
289575530396283324168013345552040300667,
259920284847963995399800125815215983072,
233302014099717072256401710525774728336,
209409703497448836012980688794302909957,
187964189199610581269006081054389519147,
337429792711562885676838629607664070711,
302873822652608199592547515371033250847,
271856707468083969679745656096547629768,
244016035285282981482333348801442963368,
219026508600450572879143037057044702127,
196596143419909740056291955312532441411,
176462857644721687377034700397980722042,
316782817673398770114452445482208770257,
284341291171704802743493772571841275116,
255222080727080523208383932871281083497,
229084950069124576377435007616984162844,
205624506307086466111975488366169508167,
184566631641558957302915986868221103411,
331330561004604641231243330979299081348,
297399209378286220063892720385616742108,
266942745850723232302069966588191406954,
239605309345945263344621501916001364416,
215067482294014848993159294730496555497,
193042558474796699288911421705232156812,
173273193069468359944466704194632400641,
311056791556242112413125050076207081650,
279201663740542055384000770694089408486,
250608799266136415663698628779517553855,
224944111822980370837543334787608800457,
201907728667158642949418150287074186439,
181230486831379296755646484093658378299,
325341576312636457580643512071759255196,
292023552792399342330208805478900181690,
262117606830390855604604612394616145902,
235274309738072614830216430996812400431,
211180017596241035935669959185363632952,
189553206559602063269009666658011215615,
170141183460469231731687303715884105728,
305434266554881967834492181318207537152,
274154937941858738966065755004164112384,
246078905440687093968343124469641904128,
220878121537715117784741212850409701376,
198258133856129805696540977101424033792,
177954644699400447924746318168681611264,
319460845859371388212562249545703474176,
286745064197610355009611023687762970225,
257379684889104161503034418684704785797,
231021595363755916570056887236303965333,
207362820991138609531788808643065835705,
186126926626483659918254253754028720893,
334131573344103639308512797544978713750,
299913371828921883094842698046640019943,
269199434526831288331795872363961423540,
241630891972710985114650364591580944199,
216885626294688985349681859923056842835,
194674507506895938395726937393857685110,
174738015241079713869620349559402181972,
313686412889065357315780098042512623701,
281561987228284074576142980610683957411,
252727403529513497084111370284014563793,
226845751173734538409794758625366435361,
203614622343740041422835873088956724196,
182762578614186646525232068123189313087,
328091958791815868790390435525895683218,
294492270354449044397893099587906656150,
264333504599995236391965677440014878764,
237263278829077450304247817879793628477,
212965297630021155936008083539885258459,
191155657202715751455043144381591497592,
171579528154314464133715598246382584383,
308016356015425756696586706818979868623,
276472597266073797985814891590470600613,
248159214750338106225838746496027188809,
];
const BASE28_LARGE_EXPONENT: [i32; 76] = [
-1281,
-1252,
-1224,
-1195,
-1166,
-1137,
-1108,
-1079,
-1051,
-1022,
-993,
-964,
-935,
-906,
-877,
-849,
-820,
-791,
-762,
-733,
-704,
-676,
-647,
-618,
-589,
-560,
-531,
-502,
-474,
-445,
-416,
-387,
-358,
-329,
-301,
-272,
-243,
-214,
-185,
-156,
-127,
-99,
-70,
-41,
-12,
17,
46,
74,
103,
132,
161,
190,
219,
247,
276,
305,
334,
363,
392,
421,
449,
478,
507,
536,
565,
594,
622,
651,
680,
709,
738,
767,
796,
824,
853,
882,
];
const BASE28_SMALL_INT_POWERS: [u128; 6] = [1, 28, 784, 21952, 614656, 17210368];
const BASE28_STEP: i32 = 6;
const BASE28_BIAS: i32 = 240;
const BASE29_SMALL_MANTISSA: [u128; 6] = [
170141183460469231731687303715884105728,
308380895022100482513683237985039941632,
279470186113778562278025434423942447104,
253269856165611822064460549946697842688,
229525807150085713745917373389194919936,
208007762729765178082237619633957896192,
];
const BASE29_SMALL_EXPONENT: [i32; 6] = [
-127,
-123,
-118,
-113,
-108,
-103,
];
const BASE29_LARGE_MANTISSA: [u128; 76] = [
180411782640948456163108621039484300353,
199886291656678749778798199538954577713,
221462972137332420374365077239613292335,
245368742505570013761609603669658845854,
271855015841791437163383377269432435982,
301200343954417841961395964144914808415,
333713346863741229059418106803065448261,
184867979254122350694373980738345610830,
204823511403978168182734748793342650457,
226933138952023660037574950865203175761,
251429385238135556008900174982942596722,
278569873281449391084528542386060643447,
308640035159552273337407148073177516540,
170978056925499484035797671737173759761,
189434244555519246827735852425496159000,
209882681179121373738148351480252166035,
232538419662693834656863635067192575556,
257639726705579546348788818074016917383,
285450588652016995453946272087193218261,
316263487792383250937533050996202736450,
175201239175822924661859658491633525197,
194113297257345719179697640426306620561,
215066813165088318898530949380694999931,
238282151601732438626757341123945812037,
264003464487880391063907148518553600721,
292501258667905961095191488633763572010,
324075240786231793266420435905585066661,
179528734626566103050967344518404222838,
198907923224385351394870557131224024014,
220378993946205681004466278772642662300,
244167754534112212293116837315364018708,
270524387495766270724774864712621178351,
299726081232954872012689080099923610541,
332079945186715557451765374774991672241,
183963119828570739334286542177638201257,
203820977132676910337518249049241331980,
225822386345870676314424417535913775896,
250198732693485636863600410972168425001,
277206378226597610088077970727216566225,
307129357939822377568583266911848900855,
170141183460469231731687303715884105728,
188507034973849692637027842793274343424,
208855384169162106382075974754544648192,
231400231309666912826787170353923751936,
256378676868573301455838684793773426688,
284053415075970164879962990673826094314,
314715496631115750914098978917481871688,
174343694817539847357322592625772163155,
193163185467532912371523116182520814756,
214014141773314894388674508400179209532,
237115849834993471687725998227739696222,
262711266541086358656385267533109039869,
291069574706415032602452081981147446763,
322489014023779685975823216414806216349,
178650008801035774670984867305268298071,
197934343538640677425270715935647505996,
219300321421789265371466533424126863110,
242972644948356100526463281459541324974,
269200272076455967884065094333741996545,
298259034474605889482552078350958780837,
330454538398307869859357548505383554011,
183062689350548673356118481539553806163,
202823349890643162760568057855283073783,
224717070457148091679782830215989826885,
248974103731497779640892318688061490897,
275849556968674066644388728598920812956,
305626074918518590345961283073160340970,
338616812354378462414859289927404969896,
187584363735341677353233362159059264795,
207833115392789061354400140358968381064,
230267613961761833964469003400183663813,
255123799397575000468261630468177681638,
282663080140582027146793786682106989268,
313175082306023963280707662359655742783,
173490347817277081445057491729890113081,
192217724118601260264099717636971309833,
];
const BASE29_LARGE_EXPONENT: [i32; 76] = [
-1293,
-1264,
-1235,
-1206,
-1177,
-1148,
-1119,
-1089,
-1060,
-1031,
-1002,
-973,
-944,
-914,
-885,
-856,
-827,
-798,
-769,
-740,
-710,
-681,
-652,
-623,
-594,
-565,
-536,
-506,
-477,
-448,
-419,
-390,
-361,
-332,
-302,
-273,
-244,
-215,
-186,
-157,
-127,
-98,
-69,
-40,
-11,
18,
47,
77,
106,
135,
164,
193,
222,
251,
281,
310,
339,
368,
397,
426,
455,
485,
514,
543,
572,
601,
630,
659,
689,
718,
747,
776,
805,
834,
864,
893,
];
const BASE29_SMALL_INT_POWERS: [u128; 6] = [1, 29, 841, 24389, 707281, 20511149];
const BASE29_STEP: i32 = 6;
const BASE29_BIAS: i32 = 240;
const BASE30_SMALL_MANTISSA: [u128; 6] = [
170141183460469231731687303715884105728,
319014718988379809496913694467282698240,
299076299051606071403356588563077529600,
280384030360880691940646801777885184000,
262860028463325648694356376666767360000,
246431276684367795650959103125094400000,
];
const BASE30_SMALL_EXPONENT: [i32; 6] = [
-127,
-123,
-118,
-113,
-108,
-103,
];
const BASE30_LARGE_MANTISSA: [u128; 74] = [
293697914606894485088361958296166003399,
199401546035358756435491021348075025228,
270761041082025567891957153683056483774,
183828919146951883093674448351327494412,
249615464467793559236989678532104461317,
338944929832632662139396137837142035924,
230121290169646228383872457298707723793,
312474408249691315911417866816293319027,
212149548916169413644283660602828329029,
288071150257973936473359891361485890787,
195581343526079319127909243854250027224,
265573709142416387133758214804806317848,
180307062310000458937613050074040708794,
244833246663194772909432488501026624276,
332451307806128616353452734867573546427,
225712548373888955751123878842649157480,
306487917461553679299669913344627685478,
208085115840167395965624010961720331305,
282552185370553343852869987471204477403,
191834329753307055373436045708607941890,
260485757869036576463347072380734960806,
176852678401887104140389725347567150767,
240142648210703765821352805529490956868,
326082092794781635112624979076905003855,
221388270750079128888532155889145795079,
300616117896153936087600778123712697276,
204098550552778150334824777443135675335,
277138954685954882938577351637270128950,
188159102542382767109407940268116001044,
255495283293346012426090218975127795266,
173464474753336275982316368848893943009,
235541913835671069456466721167496749113,
319834901366763207379289417958082873567,
217146839104937741700096042539405091508,
294856812260112936979848919457246198708,
200188361236473853754168248068850933442,
271829432512427567293473804075629134624,
184554286581985369843377175900278276895,
250600417923680198594596164731872945757,
170141183460469231731687303715884105728,
231029321891594808422774159179776000000,
313707395752840890251476992000000000000,
212986666247081951232000000000000000000,
289207845356544000000000000000000000000,
196353084654473304748535156250000000000,
266621631967110632288608940143603831529,
181018532909474941844489348460628831000,
245799330046413899594233809090775284541,
333763121820680299409099755486799743829,
226603183715861233202026897808422346833,
307697282971558792524556831461079215336,
208906195393080226844550976655564036201,
283667103278554017412807162817392837984,
192591285603182277357146536646298485706,
261513604232519641878753574965804062932,
177550518406095745907734479894927853604,
241090223040513319460187919146199534233,
327368774631124380764508606973252185538,
222261842997828194477899721342605392688,
301802313971178147521594347169174498450,
204903899584886496461222208185427085841,
278232512618195742220116760148063945729,
188901556375124208702207652989717774500,
256503437827277086943219190518379691262,
174148945301850322989380722761059920238,
236471334705220322048773145103478211637,
321096932515698698858834100478208840422,
218003675159015088778073023304915283497,
296020282788056879712669614682501632104,
200978281118435287206001718625001320433,
272902039690575235287053981567967613406,
185282516232160242762660936045505469826,
251589257890814574386886921482483833102,
170812540689859376035668482781137073721,
];
const BASE30_LARGE_EXPONENT: [i32; 74] = [
-1276,
-1246,
-1217,
-1187,
-1158,
-1129,
-1099,
-1070,
-1040,
-1011,
-981,
-952,
-922,
-893,
-864,
-834,
-805,
-775,
-746,
-716,
-687,
-657,
-628,
-599,
-569,
-540,
-510,
-481,
-451,
-422,
-392,
-363,
-334,
-304,
-275,
-245,
-216,
-186,
-157,
-127,
-98,
-69,
-39,
-10,
20,
49,
79,
108,
137,
167,
196,
226,
255,
285,
314,
344,
373,
402,
432,
461,
491,
520,
550,
579,
609,
638,
667,
697,
726,
756,
785,
815,
844,
874,
];
const BASE30_SMALL_INT_POWERS: [u128; 6] = [1, 30, 900, 27000, 810000, 24300000];
const BASE30_STEP: i32 = 6;
const BASE30_BIAS: i32 = 234;
const BASE31_SMALL_MANTISSA: [u128; 6] = [
170141183460469231731687303715884105728,
329648542954659136480144150949525454848,
319347025987326038465139646232352784384,
309367431425222099763104032287591759872,
299699699193183909145507031278604517376,
290334083593396911984709936551148126208,
];
const BASE31_SMALL_EXPONENT: [i32; 6] = [
-127,
-123,
-118,
-113,
-108,
-103,
];
const BASE31_LARGE_MANTISSA: [u128; 74] = [
279877549230888994466722529922465951128,
231333407733284590292354000091386191754,
191209140142019782313183919746595976478,
316088675925298444140273004034743674741,
261263794643914746305034655542823358647,
215948167684024592485185159022754788335,
178492435929157837038046463019461592108,
295066635902569136770934561228011804883,
243887980937787207068127465341221873783,
201586150409601608540557644579125879351,
333242957530806000015262416296943861408,
275442704070282164877682412643443854572,
227667776650720372831068985136241988697,
188179304658062925738530341045324738580,
311080041475689584245114254221154550706,
257123896754632869764136622554477725012,
212526325921342359594316086083656739425,
175664105047096554749814041961690625344,
290391109602281582919653498207198252857,
240023414326551697067636257878891518439,
198391884324143423870507706735824676989,
327962502126029666246881442269148110223,
271078131968920728852328597367236335349,
224060229920801636254083864004341099802,
185197478924335716894196793983277050828,
306150772156692797734166574102932652557,
253049598289706899575201136976026000492,
209158705508044155113481306826330986049,
172880590941369685133685946960988620150,
285789670113326703641484035227164931190,
236220084333189890382264913587684321799,
195248233500715771863466694882341429463,
322765719034956327944217102842371688313,
266782719403631527651786656524762917448,
220509847158485190531810693342620280466,
182262902194543738831736462131829646508,
301299610375241462753468658335350302125,
249039859782804352657429715423616325073,
205844447270932349829274233837837318735,
170141183460469231731687303715884105728,
281261143481103258485187751033924747264,
232477020622927971041480650211423420416,
192154395906963839472434931204572053504,
317651282414350176352409831205456445952,
262555370495753687560337482407159416999,
217015722562838525119352550468059930336,
179374825776921533841673613411506136043,
296525318465664137401900073705767585881,
245093658238625334625948305994309525378,
202582705650977753904076181059390370572,
334890367411416504232175148268475073388,
276804374353098300220638069068074602530,
228793268236589371413606590094648720070,
189109582219266748069833984779993889354,
312617887429839722873414506299686714932,
258395006731549634868442333657079980382,
213576964685944914612871149421565862652,
176532512843220607081571440296564925357,
291826678373921783044839874892818001863,
241209986871908117885122799335937441435,
199372648487594099824157002892036768477,
329583807705824908665978895106558273752,
272418225684124763666228455375305707749,
225167887346958248891898253497228074938,
186113015621359245893427982047443315204,
307664249923018427479642383336104189758,
254300566687046383525258086411660098107,
210192696205470376085866529648531617961,
173735238240724141814430167095519087450,
287202491346848457988114640516635531033,
237387854850570349221700427782261535085,
196213456806330839063706448987155946803,
324361333953874416226256763524449662322,
268101578446229760174200876130811505774,
];
const BASE31_LARGE_EXPONENT: [i32; 74] = [
-1287,
-1257,
-1227,
-1198,
-1168,
-1138,
-1108,
-1079,
-1049,
-1019,
-990,
-960,
-930,
-900,
-871,
-841,
-811,
-781,
-752,
-722,
-692,
-663,
-633,
-603,
-573,
-544,
-514,
-484,
-454,
-425,
-395,
-365,
-336,
-306,
-276,
-246,
-217,
-187,
-157,
-127,
-98,
-68,
-38,
-9,
21,
51,
81,
110,
140,
170,
199,
229,
259,
289,
318,
348,
378,
408,
437,
467,
497,
526,
556,
586,
616,
645,
675,
705,
735,
764,
794,
824,
853,
883,
];
const BASE31_SMALL_INT_POWERS: [u128; 6] = [1, 31, 961, 29791, 923521, 28629151];
const BASE31_STEP: i32 = 6;
const BASE31_BIAS: i32 = 234;
const BASE33_SMALL_MANTISSA: [u128; 6] = [
170141183460469231731687303715884105728,
175458095443608895223302531957005484032,
180941160926221673199030736080661905408,
186595572205166100486500446583182589952,
192426683836577541126703585538907045888,
198440017706470589286913072586997891072,
];
const BASE33_SMALL_EXPONENT: [i32; 6] = [
-127,
-122,
-117,
-112,
-107,
-102,
];
const BASE33_LARGE_MANTISSA: [u128; 72] = [
312720366502509540124188550868577470271,
188065849520234218420139418711557486770,
226200577540468899968415353242546081790,
272068009211510778916881923005514361559,
327236130168906522048072439540872358087,
196795435814493025178219114364462772750,
236700290627603575579431376108202583063,
284696783496570703658001718555889571262,
171212841180688182412693440011648609110,
205930229524469868245369490973155168397,
247687376364759110421449812279701734754,
297911756579516503503766398038992340964,
179160149400574418614614090847719005026,
215489039450973655880961058312920063458,
259184457474862991304220337185522020620,
311740138466868713435648102307209093287,
187476353478425047886734580102095167043,
225491547456297727220699982909970598320,
271215206775862669602998925081523543654,
326210402191372960931717472229356291097,
196178576715647050727159488732861667611,
235958348989735718000162987087766864735,
283804395923732956473182174007605293342,
170676171219393275768862099029406252664,
205284737238107330416766226733647440005,
246910995494199118965634147066154669324,
296977946418022259559609845940558313794,
178598568447993152099773363289076713958,
214813584890064968045989415466080479007,
258372038781252962127704032685119793391,
310762982974959535779710715380461212334,
186888705223357570139042022172334279947,
224784739840635370899218738060963824868,
270365077465939099085308357449561310080,
325187889378018709806160016110270251585,
195563651173574149793648095659417101115,
235218732982278125085778976978720276897,
282914805556997697053159518336509943216,
170141183460469231731687303715884105728,
204641268259797795202129106105341575168,
246137048204490191229033862368809975808,
296047063302535604636168085099824283648,
178038747781766620403928207609098977344,
214140247554538205717741625292909706188,
257562166629747183314707096744136073023,
309788890395834268833431845588643035745,
186302898963108514077454910111746951397,
224080147727111315915564635257325506176,
269517612902775795573733407057825442248,
324168581650849479410768181980047458277,
194950653127503229444535496044715069916,
234481435315497306894208542281087212757,
282028003628468309677795696968404883305,
339215745262040382698593524434347927396,
203999816247443047277506123370388146319,
245365526867526093228395853689144006062,
295119098058174229856749108333084701428,
177480681884243207276442522127875068624,
213469020807909470054649976638820369879,
256754833038160188521579955085771893751,
308817851128733566186038756059234075639,
185718928923909504089695656878457160369,
223377764171191270264346565880758640128,
268672804733672512805858396506074869210,
323152468963460648455199258995519212913,
194339576535660800930047023345366203227,
233746448722509584063702393615930970798,
281143981397731320107155010945727058593,
338152466949356579395454697640846384307,
203360374878824300807265157901557614739,
244596423879111037469845073222731160599,
294194041538814672349638971928150296782,
];
const BASE33_LARGE_EXPONENT: [i32; 72] = [
-1278,
-1247,
-1217,
-1187,
-1157,
-1126,
-1096,
-1066,
-1035,
-1005,
-975,
-945,
-914,
-884,
-854,
-824,
-793,
-763,
-733,
-703,
-672,
-642,
-612,
-581,
-551,
-521,
-491,
-460,
-430,
-400,
-370,
-339,
-309,
-279,
-249,
-218,
-188,
-158,
-127,
-97,
-67,
-37,
-6,
24,
54,
84,
115,
145,
175,
205,
236,
266,
296,
326,
357,
387,
417,
448,
478,
508,
538,
569,
599,
629,
659,
690,
720,
750,
780,
811,
841,
871,
];
const BASE33_SMALL_INT_POWERS: [u128; 6] = [1, 33, 1089, 35937, 1185921, 39135393];
const BASE33_STEP: i32 = 6;
const BASE33_BIAS: i32 = 228;
const BASE34_SMALL_MANTISSA: [u128; 6] = [
170141183460469231731687303715884105728,
180775007426748558714917760198126862336,
192073445390920343634600120210509791232,
204078035727852865111762627723666653184,
216832912960843669181247791956395819008,
230384970020896398505075778953670557696,
];
const BASE34_SMALL_EXPONENT: [i32; 6] = [
-127,
-122,
-117,
-112,
-107,
-102,
];
const BASE34_LARGE_MANTISSA: [u128; 72] = [
177178627816250193201809052313908765038,
254908880844119689445018585029338745822,
183370134237042583472660416437030762483,
263816670637481076390123392064426194701,
189778002824260993825223275854263893366,
273035743108558333663040444930692235847,
196409794352921881357331916371145369426,
282576976029244796208883094031259474966,
203273333809293576669182005378991774735,
292451627295127901322196175360309190338,
210376719623757394611528557965027181599,
302671348208910116654395983418902348443,
217728333226311038599715596529740433091,
313248197228018957952397977805898800839,
225336848935989032116058614991615739830,
324194654192627182361160566056046446660,
233211244195868906543198111154344051285,
335523635050871088900625460663893770435,
241360810165739638162969982622013142483,
173624253549320755964330470575918052959,
249795162684930840147804514904540284970,
179691552375964624115693619162436412029,
258524253618237975606418771469177669493,
185970872935167515117533503151908736546,
267558382598330880564928534158522761469,
192469624325502244069180532494789364726,
276908209178500704519431941303594138118,
199195474556460799929094324231727524305,
286584765410084542875511011996966308779,
206156359596095351859662099550265135432,
296599468859408121472112670217716316867,
213360492734829033350750838314127106094,
306964136079605489713373754120772284157,
220816374276485055706958449270700673524,
317690996553211397504541477525504659745,
228532801567968794073232940648013889325,
328792707121977505492535302517672775182,
236518879379437072732268269343858967136,
170141183460469231731687303715884105728,
244784030647202423411643015138274967552,
176086766417174433233313223161344425984,
253338007592048088741599978367647481856,
182240117745863932172015090234506084352,
262190903226072497809728032921351003168,
188608497911442742195268251474898499613,
271353163261640374618023568003458637143,
195199421095732140407812372336079928061,
280835598436492094076350884217966821974,
202020664063606263361049018383687293681,
290649397269553933781951224423558743337,
209080275338955809947349984471742343690,
300806139262500062617960370620227418603,
216386584701305758176605078134277823932,
311317808562643058781928971959145202656,
223948213014292349032159641795245781843,
322196808103274080809106622508050735664,
231774082397596158130210248504430880773,
333455974238137167751959613429477643393,
239873426754333326759263874720553852658,
172554295943652591814138834633669982456,
248255802666326436218178945574152405546,
178584205106164167247426311765412935775,
256931100670110578075784008065054807112,
184824829419575343010846487395966556532,
265909556926979410208640982981191461086,
191283532323968216046404126970062690800,
275201765300840924300371814765015192837,
197967934574808286676526111499839216564,
284818689858133833493377548255268489047,
204885923234829474007514465274285458561,
294771677804553486829405243638525556429,
212045660980140516237478265085420658486,
];
const BASE34_LARGE_EXPONENT: [i32; 72] = [
-1287,
-1257,
-1226,
-1196,
-1165,
-1135,
-1104,
-1074,
-1043,
-1013,
-982,
-952,
-921,
-891,
-860,
-830,
-799,
-769,
-738,
-707,
-677,
-646,
-616,
-585,
-555,
-524,
-494,
-463,
-433,
-402,
-372,
-341,
-311,
-280,
-250,
-219,
-189,
-158,
-127,
-97,
-66,
-36,
-5,
25,
56,
86,
117,
147,
178,
208,
239,
269,
300,
330,
361,
391,
422,
452,
483,
514,
544,
575,
605,
636,
666,
697,
727,
758,
788,
819,
849,
880,
];
const BASE34_SMALL_INT_POWERS: [u128; 6] = [1, 34, 1156, 39304, 1336336, 45435424];
const BASE34_STEP: i32 = 6;
const BASE34_BIAS: i32 = 228;
const BASE35_SMALL_MANTISSA: [u128; 6] = [
170141183460469231731687303715884105728,
186091919409888222206532988439248240640,
203538036854565243038395456105427763200,
222619727809680734573245030115311616000,
243490327291838303439486751688622080000,
266317545475448144386938634659430400000,
];
const BASE35_SMALL_EXPONENT: [i32; 6] = [
-127,
-122,
-117,
-112,
-107,
-102,
];
const BASE35_LARGE_MANTISSA: [u128; 71] = [
209347927024496598038547144935237941328,
179203738418473223738234323205585013488,
306800075067366652359189609572260396844,
262623667597658781475957209306702595701,
224808259148244964176155115402974869951,
192437923982884034851744022831878031683,
329457242604437106875016361913696434196,
282018410035885035080273518999343445370,
241410335891937127541744115564170038883,
206649453374488156391879990784284316065,
176893820317164915550880607303262990177,
302845453064861578599747045789577351117,
259238475028744868618971960605253012775,
221910503377561727015952290044860359194,
189957418565367403947310019950147953923,
325210571999150993462493010696415973233,
278383221194439940371876875109029372360,
238298581027663491439386725539968731964,
203985762777473298078638682440591083627,
174613676827044081042213382537397413381,
298941805740831610317914779329181594758,
255896917250379178747915691007066092001,
219050099386294168656703063834650082992,
187508886612326915552639247886565481996,
321018640549353575448221161417409055741,
274794889570264049674062490664049677426,
235226936369523138128743288428339150410,
201356406883409564599485887013038683702,
172362924156377643998457025163202983813,
295088476036816041433113722500648405442,
252598431814515573631538400793788490787,
216226565713775509518577464877951003673,
185091915989032531210622402180350455682,
316880742672855387564028424008808371736,
271252811178556028546302550648486766486,
232194884901007304160476988045002650981,
198760943121441293094365080225590768425,
170141183460469231731687303715884105728,
291284815363771407923214131658752000000,
249342463523006462279286784000000000000,
213439427105318371328000000000000000000,
182706099873129286194801330566406250000,
312796181882350172840701732490664710439,
267756389819817671992755772413469185401,
229201916269897841937750664282591869365,
196198934625406481835921498002300001382,
335896161555784742544555459149306885413,
287530183492901554386658282699185698307,
246128464334152340394473578644658105769,
210688214432220328999897334535237907298,
180351036686161310983217274120661055754,
308764270668182755993104788402294107778,
264305036979502132888830858069861274896,
226247526702365186299998179464172492810,
193669950160303864708173829536684422103,
331566493935091266452974274160244175815,
283823948447894890028153679891537227671,
242955893270455896832007072848205740580,
207972464612800582882401068589523181243,
178026330025978501184229413909552478799,
304784330382628027085206214062708598478,
260898171728955674614898641290082042559,
223331218918173589647399860035052277272,
191173564049707817673529979461919468076,
327292635293038256953486831534470016773,
280165486398550695538293601153410149006,
239824216327565160313568077123618791086,
205291720534454460326603808102056989101,
175731588600014458664842906141703880790,
300855691125661557416025651977765954086,
257535220627636274500677259708261311842,
];
const BASE35_LARGE_EXPONENT: [i32; 71] = [
-1266,
-1235,
-1205,
-1174,
-1143,
-1112,
-1082,
-1051,
-1020,
-989,
-958,
-928,
-897,
-866,
-835,
-805,
-774,
-743,
-712,
-681,
-651,
-620,
-589,
-558,
-528,
-497,
-466,
-435,
-404,
-374,
-343,
-312,
-281,
-251,
-220,
-189,
-158,
-127,
-97,
-66,
-35,
-4,
26,
57,
88,
119,
149,
180,
211,
242,
273,
303,
334,
365,
396,
426,
457,
488,
519,
550,
580,
611,
642,
673,
703,
734,
765,
796,
827,
857,
888,
];
const BASE35_SMALL_INT_POWERS: [u128; 6] = [1, 35, 1225, 42875, 1500625, 52521875];
const BASE35_STEP: i32 = 6;
const BASE35_BIAS: i32 = 222;
const BASE36_SMALL_MANTISSA: [u128; 6] = [
170141183460469231731687303715884105728,
191408831393027885698148216680369618944,
215334935317156371410416743765415821312,
242251802231800917836718836736092798976,
272533277510776032566308691328104398848,
306599937199623036637097277744117448704,
];
const BASE36_SMALL_EXPONENT: [i32; 6] = [
-127,
-122,
-117,
-112,
-107,
-102,
];
const BASE36_LARGE_MANTISSA: [u128; 71] = [
206105367118290399407064648402758144682,
208917317212507950117664039252872831665,
211767631486382365261996259087726574961,
214656833352574406771088703014069554755,
217585453364802351586979201161384846208,
220554029315269330081435801781477974040,
223563106333419891448609016293621894840,
226613236986043931067161987739751269180,
229704981378746362247969882824709232796,
232838907258801165579649662968151663564,
236015590119408703302029793810763336632,
239235613305375443823879271798297650114,
242499568120235502703106353919523432682,
245808053934833671173174941698733239342,
249161678297389871677290466673500998400,
252561057045065251911260457800735557729,
256006814417050404626793229969178591795,
259499583169196479959998361450291137700,
263040004690210240376322725691803307553,
266628729119434395515123988465075762881,
270266415466234845327287688358055741312,
273953731731016754981191818978678705632,
277691355027891684120101092281051616669,
281479971709018296242657937208050445965,
285320277490639481303204301467482637509,
289212977580839036146652597763405686112,
293158786809041363160730749526943361727,
297158429757277967604640789526650060843,
301212640893244858516269504216828222245,
305322164705175286969651759320250334279,
309487755838552588810803796052767101096,
313710179234688236904530296665341569850,
317990210271190550439415903835536554761,
322328634904349856025836233807108654402,
326726249813466247246220462666861782844,
331183862547146446042592332649497399781,
335702291671596630919115661345637412333,
170141183460469231731687303715884105728,
172462464674787958108367218731066064896,
174815415743320440759790006808579407872,
177200468746272961345336076752392290304,
179618061658836457920697688990341398528,
182068638431613361423174859113151594496,
184552649072141716781794491390137475072,
187070549727531559196917812917453861026,
189622802768228720381105803326920695033,
192209876872921446586714266254161951235,
194832247114605420104007752175098574688,
197490395047822988635051696441052554380,
200184808797092622572327630249651738267,
202915983146544838776512848181734408257,
205684419630781050995309380627725821797,
208490626626972031635281014538153149532,
211335119448212897232599978727666183358,
214218420438151760708217936124820030498,
217141059066909427380630585083218539864,
220103572028307748788051030668660629356,
223106503338424488684979682521025988628,
226150404435492799169987273137391228527,
229235834281163651816744244429413474808,
232363359463149818964276081092475750857,
235533554299270254021060647605641184828,
238747000942913976797497733353022683918,
242004289489942830549695955106475311593,
245306018087052741642305313258629505287,
248652793041613380567795520750960012282,
252045228933006394543323172270604972624,
255483948725482657093998355855298189652,
258969583882559258973487053363982248701,
262502774482977247520692697766891651596,
266084169338241408156670471179837543899,
];
const BASE36_LARGE_EXPONENT: [i32; 71] = [
-1275,
-1244,
-1213,
-1182,
-1151,
-1120,
-1089,
-1058,
-1027,
-996,
-965,
-934,
-903,
-872,
-841,
-810,
-779,
-748,
-717,
-686,
-655,
-624,
-593,
-562,
-531,
-500,
-469,
-438,
-407,
-376,
-345,
-314,
-283,
-252,
-221,
-190,
-159,
-127,
-96,
-65,
-34,
-3,
28,
59,
90,
121,
152,
183,
214,
245,
276,
307,
338,
369,
400,
431,
462,
493,
524,
555,
586,
617,
648,
679,
710,
741,
772,
803,
834,
865,
896,
];
const BASE36_SMALL_INT_POWERS: [u128; 6] = [1, 36, 1296, 46656, 1679616, 60466176];
const BASE36_STEP: i32 = 6;
const BASE36_BIAS: i32 = 222;
}}
pub(crate) const BASE10_POWERS: ModeratePathPowers<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128> = 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<u128>
{
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);
}
}
}