lexical_parse_float/
table_radix.rs

1//! Pre-computed tables for writing non-decimal strings.
2
3#![cfg(feature = "radix")]
4#![cfg(not(feature = "compact"))]
5#![doc(hidden)]
6#![allow(clippy::excessive_precision)] // reason = "auto-generated values that need to be exact"
7
8use lexical_util::assert::debug_assert_radix;
9use static_assertions::const_assert;
10
11use crate::bigint::Limb;
12use crate::limits::{f32_exponent_limit, f64_exponent_limit, f64_mantissa_limit, u64_power_limit};
13use crate::table_binary::*;
14use crate::table_decimal::*;
15
16// HELPERS
17// -------
18
19/// Get lookup table for 2 digit radix conversions.
20#[inline(always)]
21pub const fn get_small_int_power(exponent: usize, radix: u32) -> u64 {
22    match radix {
23        2 => get_small_int_power2(exponent),
24        3 => get_small_int_power3(exponent),
25        4 => get_small_int_power4(exponent),
26        5 => get_small_int_power5(exponent),
27        6 => get_small_int_power6(exponent),
28        7 => get_small_int_power7(exponent),
29        8 => get_small_int_power8(exponent),
30        9 => get_small_int_power9(exponent),
31        10 => get_small_int_power10(exponent),
32        11 => get_small_int_power11(exponent),
33        12 => get_small_int_power12(exponent),
34        13 => get_small_int_power13(exponent),
35        14 => get_small_int_power14(exponent),
36        15 => get_small_int_power15(exponent),
37        16 => get_small_int_power16(exponent),
38        17 => get_small_int_power17(exponent),
39        18 => get_small_int_power18(exponent),
40        19 => get_small_int_power19(exponent),
41        20 => get_small_int_power20(exponent),
42        21 => get_small_int_power21(exponent),
43        22 => get_small_int_power22(exponent),
44        23 => get_small_int_power23(exponent),
45        24 => get_small_int_power24(exponent),
46        25 => get_small_int_power25(exponent),
47        26 => get_small_int_power26(exponent),
48        27 => get_small_int_power27(exponent),
49        28 => get_small_int_power28(exponent),
50        29 => get_small_int_power29(exponent),
51        30 => get_small_int_power30(exponent),
52        31 => get_small_int_power31(exponent),
53        32 => get_small_int_power32(exponent),
54        33 => get_small_int_power33(exponent),
55        34 => get_small_int_power34(exponent),
56        35 => get_small_int_power35(exponent),
57        36 => get_small_int_power36(exponent),
58        _ => unreachable!(),
59    }
60}
61
62/// Get lookup table for small f32 powers.
63#[inline(always)]
64pub fn get_small_f32_power(exponent: usize, radix: u32) -> f32 {
65    debug_assert_radix(radix);
66    match radix {
67        2 => get_small_f32_power2(exponent),
68        3 => get_small_f32_power3(exponent),
69        4 => get_small_f32_power4(exponent),
70        5 => get_small_f32_power5(exponent),
71        6 => get_small_f32_power6(exponent),
72        7 => get_small_f32_power7(exponent),
73        8 => get_small_f32_power8(exponent),
74        9 => get_small_f32_power9(exponent),
75        10 => get_small_f32_power10(exponent),
76        11 => get_small_f32_power11(exponent),
77        12 => get_small_f32_power12(exponent),
78        13 => get_small_f32_power13(exponent),
79        14 => get_small_f32_power14(exponent),
80        15 => get_small_f32_power15(exponent),
81        16 => get_small_f32_power16(exponent),
82        17 => get_small_f32_power17(exponent),
83        18 => get_small_f32_power18(exponent),
84        19 => get_small_f32_power19(exponent),
85        20 => get_small_f32_power20(exponent),
86        21 => get_small_f32_power21(exponent),
87        22 => get_small_f32_power22(exponent),
88        23 => get_small_f32_power23(exponent),
89        24 => get_small_f32_power24(exponent),
90        25 => get_small_f32_power25(exponent),
91        26 => get_small_f32_power26(exponent),
92        27 => get_small_f32_power27(exponent),
93        28 => get_small_f32_power28(exponent),
94        29 => get_small_f32_power29(exponent),
95        30 => get_small_f32_power30(exponent),
96        31 => get_small_f32_power31(exponent),
97        32 => get_small_f32_power32(exponent),
98        33 => get_small_f32_power33(exponent),
99        34 => get_small_f32_power34(exponent),
100        35 => get_small_f32_power35(exponent),
101        36 => get_small_f32_power36(exponent),
102        _ => unreachable!(),
103    }
104}
105
106/// Get lookup table for small f64 powers.
107#[inline(always)]
108pub fn get_small_f64_power(exponent: usize, radix: u32) -> f64 {
109    debug_assert_radix(radix);
110    match radix {
111        2 => get_small_f64_power2(exponent),
112        3 => get_small_f64_power3(exponent),
113        4 => get_small_f64_power4(exponent),
114        5 => get_small_f64_power5(exponent),
115        6 => get_small_f64_power6(exponent),
116        7 => get_small_f64_power7(exponent),
117        8 => get_small_f64_power8(exponent),
118        9 => get_small_f64_power9(exponent),
119        10 => get_small_f64_power10(exponent),
120        11 => get_small_f64_power11(exponent),
121        12 => get_small_f64_power12(exponent),
122        13 => get_small_f64_power13(exponent),
123        14 => get_small_f64_power14(exponent),
124        15 => get_small_f64_power15(exponent),
125        16 => get_small_f64_power16(exponent),
126        17 => get_small_f64_power17(exponent),
127        18 => get_small_f64_power18(exponent),
128        19 => get_small_f64_power19(exponent),
129        20 => get_small_f64_power20(exponent),
130        21 => get_small_f64_power21(exponent),
131        22 => get_small_f64_power22(exponent),
132        23 => get_small_f64_power23(exponent),
133        24 => get_small_f64_power24(exponent),
134        25 => get_small_f64_power25(exponent),
135        26 => get_small_f64_power26(exponent),
136        27 => get_small_f64_power27(exponent),
137        28 => get_small_f64_power28(exponent),
138        29 => get_small_f64_power29(exponent),
139        30 => get_small_f64_power30(exponent),
140        31 => get_small_f64_power31(exponent),
141        32 => get_small_f64_power32(exponent),
142        33 => get_small_f64_power33(exponent),
143        34 => get_small_f64_power34(exponent),
144        35 => get_small_f64_power35(exponent),
145        36 => get_small_f64_power36(exponent),
146        _ => unreachable!(),
147    }
148}
149
150/// Get pre-computed power for a large power of radix.
151pub const fn get_large_int_power(radix: u32) -> (&'static [Limb], u32) {
152    match radix {
153        3 => (&LARGE_POW3, LARGE_POW3_STEP),
154        5 => (&LARGE_POW5, LARGE_POW5_STEP),
155        7 => (&LARGE_POW7, LARGE_POW7_STEP),
156        9 => (&LARGE_POW9, LARGE_POW9_STEP),
157        11 => (&LARGE_POW11, LARGE_POW11_STEP),
158        13 => (&LARGE_POW13, LARGE_POW13_STEP),
159        15 => (&LARGE_POW15, LARGE_POW15_STEP),
160        17 => (&LARGE_POW17, LARGE_POW17_STEP),
161        19 => (&LARGE_POW19, LARGE_POW19_STEP),
162        21 => (&LARGE_POW21, LARGE_POW21_STEP),
163        23 => (&LARGE_POW23, LARGE_POW23_STEP),
164        25 => (&LARGE_POW25, LARGE_POW25_STEP),
165        27 => (&LARGE_POW27, LARGE_POW27_STEP),
166        29 => (&LARGE_POW29, LARGE_POW29_STEP),
167        31 => (&LARGE_POW31, LARGE_POW31_STEP),
168        33 => (&LARGE_POW33, LARGE_POW33_STEP),
169        // Remaining radix: must be 35.
170        _ => (&LARGE_POW35, LARGE_POW35_STEP),
171    }
172}
173
174/// Get pre-computed int power of 3.
175#[inline(always)]
176pub const fn get_small_int_power3(exponent: usize) -> u64 {
177    SMALL_INT_POW3[exponent]
178}
179
180/// Get pre-computed f32 power of 3.
181#[inline(always)]
182pub fn get_small_f32_power3(exponent: usize) -> f32 {
183    SMALL_F32_POW3[exponent]
184}
185
186/// Get pre-computed f64 power of 3.
187#[inline(always)]
188pub fn get_small_f64_power3(exponent: usize) -> f64 {
189    SMALL_F64_POW3[exponent]
190}
191
192/// Get pre-computed f32 power of 5.
193#[inline(always)]
194pub fn get_small_f32_power5(exponent: usize) -> f32 {
195    SMALL_F32_POW5[exponent]
196}
197
198/// Get pre-computed f64 power of 5.
199#[inline(always)]
200pub fn get_small_f64_power5(exponent: usize) -> f64 {
201    SMALL_F64_POW5[exponent]
202}
203
204/// Get pre-computed int power of 6.
205#[inline(always)]
206pub const fn get_small_int_power6(exponent: usize) -> u64 {
207    SMALL_INT_POW6[exponent]
208}
209
210/// Get pre-computed f32 power of 6.
211#[inline(always)]
212pub fn get_small_f32_power6(exponent: usize) -> f32 {
213    SMALL_F32_POW6[exponent]
214}
215
216/// Get pre-computed f64 power of 6.
217#[inline(always)]
218pub fn get_small_f64_power6(exponent: usize) -> f64 {
219    SMALL_F64_POW6[exponent]
220}
221
222/// Get pre-computed int power of 7.
223#[inline(always)]
224pub const fn get_small_int_power7(exponent: usize) -> u64 {
225    SMALL_INT_POW7[exponent]
226}
227
228/// Get pre-computed f32 power of 7.
229#[inline(always)]
230pub fn get_small_f32_power7(exponent: usize) -> f32 {
231    SMALL_F32_POW7[exponent]
232}
233
234/// Get pre-computed f64 power of 7.
235#[inline(always)]
236pub fn get_small_f64_power7(exponent: usize) -> f64 {
237    SMALL_F64_POW7[exponent]
238}
239
240/// Get pre-computed int power of 9.
241#[inline(always)]
242pub const fn get_small_int_power9(exponent: usize) -> u64 {
243    SMALL_INT_POW9[exponent]
244}
245
246/// Get pre-computed f32 power of 9.
247#[inline(always)]
248pub fn get_small_f32_power9(exponent: usize) -> f32 {
249    SMALL_F32_POW9[exponent]
250}
251
252/// Get pre-computed f64 power of 9.
253#[inline(always)]
254pub fn get_small_f64_power9(exponent: usize) -> f64 {
255    SMALL_F64_POW9[exponent]
256}
257
258/// Get pre-computed int power of 11.
259#[inline(always)]
260pub const fn get_small_int_power11(exponent: usize) -> u64 {
261    SMALL_INT_POW11[exponent]
262}
263
264/// Get pre-computed f32 power of 11.
265#[inline(always)]
266pub fn get_small_f32_power11(exponent: usize) -> f32 {
267    SMALL_F32_POW11[exponent]
268}
269
270/// Get pre-computed f64 power of 11.
271#[inline(always)]
272pub fn get_small_f64_power11(exponent: usize) -> f64 {
273    SMALL_F64_POW11[exponent]
274}
275
276/// Get pre-computed int power of 12.
277#[inline(always)]
278pub const fn get_small_int_power12(exponent: usize) -> u64 {
279    SMALL_INT_POW12[exponent]
280}
281
282/// Get pre-computed f32 power of 12.
283#[inline(always)]
284pub fn get_small_f32_power12(exponent: usize) -> f32 {
285    SMALL_F32_POW12[exponent]
286}
287
288/// Get pre-computed f64 power of 12.
289#[inline(always)]
290pub fn get_small_f64_power12(exponent: usize) -> f64 {
291    SMALL_F64_POW12[exponent]
292}
293
294/// Get pre-computed int power of 13.
295#[inline(always)]
296pub const fn get_small_int_power13(exponent: usize) -> u64 {
297    SMALL_INT_POW13[exponent]
298}
299
300/// Get pre-computed f32 power of 13.
301#[inline(always)]
302pub fn get_small_f32_power13(exponent: usize) -> f32 {
303    SMALL_F32_POW13[exponent]
304}
305
306/// Get pre-computed f64 power of 13.
307#[inline(always)]
308pub fn get_small_f64_power13(exponent: usize) -> f64 {
309    SMALL_F64_POW13[exponent]
310}
311
312/// Get pre-computed int power of 14.
313#[inline(always)]
314pub const fn get_small_int_power14(exponent: usize) -> u64 {
315    SMALL_INT_POW14[exponent]
316}
317
318/// Get pre-computed f32 power of 14.
319#[inline(always)]
320pub fn get_small_f32_power14(exponent: usize) -> f32 {
321    SMALL_F32_POW14[exponent]
322}
323
324/// Get pre-computed f64 power of 14.
325#[inline(always)]
326pub fn get_small_f64_power14(exponent: usize) -> f64 {
327    SMALL_F64_POW14[exponent]
328}
329
330/// Get pre-computed int power of 15.
331#[inline(always)]
332pub const fn get_small_int_power15(exponent: usize) -> u64 {
333    SMALL_INT_POW15[exponent]
334}
335
336/// Get pre-computed f32 power of 15.
337#[inline(always)]
338pub fn get_small_f32_power15(exponent: usize) -> f32 {
339    SMALL_F32_POW15[exponent]
340}
341
342/// Get pre-computed f64 power of 15.
343#[inline(always)]
344pub fn get_small_f64_power15(exponent: usize) -> f64 {
345    SMALL_F64_POW15[exponent]
346}
347
348/// Get pre-computed int power of 17.
349#[inline(always)]
350pub const fn get_small_int_power17(exponent: usize) -> u64 {
351    SMALL_INT_POW17[exponent]
352}
353
354/// Get pre-computed f32 power of 17.
355#[inline(always)]
356pub fn get_small_f32_power17(exponent: usize) -> f32 {
357    SMALL_F32_POW17[exponent]
358}
359
360/// Get pre-computed f64 power of 17.
361#[inline(always)]
362pub fn get_small_f64_power17(exponent: usize) -> f64 {
363    SMALL_F64_POW17[exponent]
364}
365
366/// Get pre-computed int power of 18.
367#[inline(always)]
368pub const fn get_small_int_power18(exponent: usize) -> u64 {
369    SMALL_INT_POW18[exponent]
370}
371
372/// Get pre-computed f32 power of 18.
373#[inline(always)]
374pub fn get_small_f32_power18(exponent: usize) -> f32 {
375    SMALL_F32_POW18[exponent]
376}
377
378/// Get pre-computed f64 power of 18.
379#[inline(always)]
380pub fn get_small_f64_power18(exponent: usize) -> f64 {
381    SMALL_F64_POW18[exponent]
382}
383
384/// Get pre-computed int power of 19.
385#[inline(always)]
386pub const fn get_small_int_power19(exponent: usize) -> u64 {
387    SMALL_INT_POW19[exponent]
388}
389
390/// Get pre-computed f32 power of 19.
391#[inline(always)]
392pub fn get_small_f32_power19(exponent: usize) -> f32 {
393    SMALL_F32_POW19[exponent]
394}
395
396/// Get pre-computed f64 power of 19.
397#[inline(always)]
398pub fn get_small_f64_power19(exponent: usize) -> f64 {
399    SMALL_F64_POW19[exponent]
400}
401
402/// Get pre-computed int power of 20.
403#[inline(always)]
404pub const fn get_small_int_power20(exponent: usize) -> u64 {
405    SMALL_INT_POW20[exponent]
406}
407
408/// Get pre-computed f32 power of 20.
409#[inline(always)]
410pub fn get_small_f32_power20(exponent: usize) -> f32 {
411    SMALL_F32_POW20[exponent]
412}
413
414/// Get pre-computed f64 power of 20.
415#[inline(always)]
416pub fn get_small_f64_power20(exponent: usize) -> f64 {
417    SMALL_F64_POW20[exponent]
418}
419
420/// Get pre-computed int power of 21.
421#[inline(always)]
422pub const fn get_small_int_power21(exponent: usize) -> u64 {
423    SMALL_INT_POW21[exponent]
424}
425
426/// Get pre-computed f32 power of 21.
427#[inline(always)]
428pub fn get_small_f32_power21(exponent: usize) -> f32 {
429    SMALL_F32_POW21[exponent]
430}
431
432/// Get pre-computed f64 power of 21.
433#[inline(always)]
434pub fn get_small_f64_power21(exponent: usize) -> f64 {
435    SMALL_F64_POW21[exponent]
436}
437
438/// Get pre-computed int power of 22.
439#[inline(always)]
440pub const fn get_small_int_power22(exponent: usize) -> u64 {
441    SMALL_INT_POW22[exponent]
442}
443
444/// Get pre-computed f32 power of 22.
445#[inline(always)]
446pub fn get_small_f32_power22(exponent: usize) -> f32 {
447    SMALL_F32_POW22[exponent]
448}
449
450/// Get pre-computed f64 power of 22.
451#[inline(always)]
452pub fn get_small_f64_power22(exponent: usize) -> f64 {
453    SMALL_F64_POW22[exponent]
454}
455
456/// Get pre-computed int power of 23.
457#[inline(always)]
458pub const fn get_small_int_power23(exponent: usize) -> u64 {
459    SMALL_INT_POW23[exponent]
460}
461
462/// Get pre-computed f32 power of 23.
463#[inline(always)]
464pub fn get_small_f32_power23(exponent: usize) -> f32 {
465    SMALL_F32_POW23[exponent]
466}
467
468/// Get pre-computed f64 power of 23.
469#[inline(always)]
470pub fn get_small_f64_power23(exponent: usize) -> f64 {
471    SMALL_F64_POW23[exponent]
472}
473
474/// Get pre-computed int power of 24.
475#[inline(always)]
476pub const fn get_small_int_power24(exponent: usize) -> u64 {
477    SMALL_INT_POW24[exponent]
478}
479
480/// Get pre-computed f32 power of 24.
481#[inline(always)]
482pub fn get_small_f32_power24(exponent: usize) -> f32 {
483    SMALL_F32_POW24[exponent]
484}
485
486/// Get pre-computed f64 power of 24.
487#[inline(always)]
488pub fn get_small_f64_power24(exponent: usize) -> f64 {
489    SMALL_F64_POW24[exponent]
490}
491
492/// Get pre-computed int power of 25.
493#[inline(always)]
494pub const fn get_small_int_power25(exponent: usize) -> u64 {
495    SMALL_INT_POW25[exponent]
496}
497
498/// Get pre-computed f32 power of 25.
499#[inline(always)]
500pub fn get_small_f32_power25(exponent: usize) -> f32 {
501    SMALL_F32_POW25[exponent]
502}
503
504/// Get pre-computed f64 power of 25.
505#[inline(always)]
506pub fn get_small_f64_power25(exponent: usize) -> f64 {
507    SMALL_F64_POW25[exponent]
508}
509
510/// Get pre-computed int power of 26.
511#[inline(always)]
512pub const fn get_small_int_power26(exponent: usize) -> u64 {
513    SMALL_INT_POW26[exponent]
514}
515
516/// Get pre-computed f32 power of 26.
517#[inline(always)]
518pub fn get_small_f32_power26(exponent: usize) -> f32 {
519    SMALL_F32_POW26[exponent]
520}
521
522/// Get pre-computed f64 power of 26.
523#[inline(always)]
524pub fn get_small_f64_power26(exponent: usize) -> f64 {
525    SMALL_F64_POW26[exponent]
526}
527
528/// Get pre-computed int power of 27.
529#[inline(always)]
530pub const fn get_small_int_power27(exponent: usize) -> u64 {
531    SMALL_INT_POW27[exponent]
532}
533
534/// Get pre-computed f32 power of 27.
535#[inline(always)]
536pub fn get_small_f32_power27(exponent: usize) -> f32 {
537    SMALL_F32_POW27[exponent]
538}
539
540/// Get pre-computed f64 power of 27.
541#[inline(always)]
542pub fn get_small_f64_power27(exponent: usize) -> f64 {
543    SMALL_F64_POW27[exponent]
544}
545
546/// Get pre-computed int power of 28.
547#[inline(always)]
548pub const fn get_small_int_power28(exponent: usize) -> u64 {
549    SMALL_INT_POW28[exponent]
550}
551
552/// Get pre-computed f32 power of 28.
553#[inline(always)]
554pub fn get_small_f32_power28(exponent: usize) -> f32 {
555    SMALL_F32_POW28[exponent]
556}
557
558/// Get pre-computed f64 power of 28.
559#[inline(always)]
560pub fn get_small_f64_power28(exponent: usize) -> f64 {
561    SMALL_F64_POW28[exponent]
562}
563
564/// Get pre-computed int power of 29.
565#[inline(always)]
566pub const fn get_small_int_power29(exponent: usize) -> u64 {
567    SMALL_INT_POW29[exponent]
568}
569
570/// Get pre-computed f32 power of 29.
571#[inline(always)]
572pub fn get_small_f32_power29(exponent: usize) -> f32 {
573    SMALL_F32_POW29[exponent]
574}
575
576/// Get pre-computed f64 power of 29.
577#[inline(always)]
578pub fn get_small_f64_power29(exponent: usize) -> f64 {
579    SMALL_F64_POW29[exponent]
580}
581
582/// Get pre-computed int power of 30.
583#[inline(always)]
584pub const fn get_small_int_power30(exponent: usize) -> u64 {
585    SMALL_INT_POW30[exponent]
586}
587
588/// Get pre-computed f32 power of 30.
589#[inline(always)]
590pub fn get_small_f32_power30(exponent: usize) -> f32 {
591    SMALL_F32_POW30[exponent]
592}
593
594/// Get pre-computed f64 power of 30.
595#[inline(always)]
596pub fn get_small_f64_power30(exponent: usize) -> f64 {
597    SMALL_F64_POW30[exponent]
598}
599
600/// Get pre-computed int power of 31.
601#[inline(always)]
602pub const fn get_small_int_power31(exponent: usize) -> u64 {
603    SMALL_INT_POW31[exponent]
604}
605
606/// Get pre-computed f32 power of 31.
607#[inline(always)]
608pub fn get_small_f32_power31(exponent: usize) -> f32 {
609    SMALL_F32_POW31[exponent]
610}
611
612/// Get pre-computed f64 power of 31.
613#[inline(always)]
614pub fn get_small_f64_power31(exponent: usize) -> f64 {
615    SMALL_F64_POW31[exponent]
616}
617
618/// Get pre-computed int power of 33.
619#[inline(always)]
620pub const fn get_small_int_power33(exponent: usize) -> u64 {
621    SMALL_INT_POW33[exponent]
622}
623
624/// Get pre-computed f32 power of 33.
625#[inline(always)]
626pub fn get_small_f32_power33(exponent: usize) -> f32 {
627    SMALL_F32_POW33[exponent]
628}
629
630/// Get pre-computed f64 power of 33.
631#[inline(always)]
632pub fn get_small_f64_power33(exponent: usize) -> f64 {
633    SMALL_F64_POW33[exponent]
634}
635
636/// Get pre-computed int power of 34.
637#[inline(always)]
638pub const fn get_small_int_power34(exponent: usize) -> u64 {
639    SMALL_INT_POW34[exponent]
640}
641
642/// Get pre-computed f32 power of 34.
643#[inline(always)]
644pub fn get_small_f32_power34(exponent: usize) -> f32 {
645    SMALL_F32_POW34[exponent]
646}
647
648/// Get pre-computed f64 power of 34.
649#[inline(always)]
650pub fn get_small_f64_power34(exponent: usize) -> f64 {
651    SMALL_F64_POW34[exponent]
652}
653
654/// Get pre-computed int power of 35.
655#[inline(always)]
656pub const fn get_small_int_power35(exponent: usize) -> u64 {
657    SMALL_INT_POW35[exponent]
658}
659
660/// Get pre-computed f32 power of 35.
661#[inline(always)]
662pub fn get_small_f32_power35(exponent: usize) -> f32 {
663    SMALL_F32_POW35[exponent]
664}
665
666/// Get pre-computed f64 power of 35.
667#[inline(always)]
668pub fn get_small_f64_power35(exponent: usize) -> f64 {
669    SMALL_F64_POW35[exponent]
670}
671
672/// Get pre-computed int power of 36.
673#[inline(always)]
674pub const fn get_small_int_power36(exponent: usize) -> u64 {
675    SMALL_INT_POW36[exponent]
676}
677
678/// Get pre-computed f32 power of 36.
679#[inline(always)]
680pub fn get_small_f32_power36(exponent: usize) -> f32 {
681    SMALL_F32_POW36[exponent]
682}
683
684/// Get pre-computed f64 power of 36.
685#[inline(always)]
686pub fn get_small_f64_power36(exponent: usize) -> f64 {
687    SMALL_F64_POW36[exponent]
688}
689
690// TABLES
691// ------
692
693//  NOTE:
694//      These tables were automatically generated using `etc/powers_table.py`.
695//      Do not modify them unless you have a very good reason to.
696
697/// Pre-computed, small powers-of-3.
698pub const SMALL_INT_POW3: [u64; 41] = [
699    1,
700    3,
701    9,
702    27,
703    81,
704    243,
705    729,
706    2187,
707    6561,
708    19683,
709    59049,
710    177147,
711    531441,
712    1594323,
713    4782969,
714    14348907,
715    43046721,
716    129140163,
717    387420489,
718    1162261467,
719    3486784401,
720    10460353203,
721    31381059609,
722    94143178827,
723    282429536481,
724    847288609443,
725    2541865828329,
726    7625597484987,
727    22876792454961,
728    68630377364883,
729    205891132094649,
730    617673396283947,
731    1853020188851841,
732    5559060566555523,
733    16677181699666569,
734    50031545098999707,
735    150094635296999121,
736    450283905890997363,
737    1350851717672992089,
738    4052555153018976267,
739    12157665459056928801,
740];
741const_assert!(SMALL_INT_POW3.len() > f64_mantissa_limit(3) as usize);
742const_assert!(SMALL_INT_POW3.len() == u64_power_limit(3) as usize + 1);
743
744/// Pre-computed, small powers-of-3.
745pub const SMALL_F32_POW3: [f32; 16] = [
746    1.0, 3.0, 9.0, 27.0, 81.0, 243.0, 729.0, 2187.0, 6561.0, 19683.0, 59049.0, 177147.0, 531441.0,
747    1594323.0, 4782969.0, 14348907.0,
748];
749const_assert!(SMALL_F32_POW3.len() > f32_exponent_limit(3).1 as usize);
750
751/// Pre-computed, small powers-of-3.
752pub const SMALL_F64_POW3: [f64; 34] = [
753    1.0,
754    3.0,
755    9.0,
756    27.0,
757    81.0,
758    243.0,
759    729.0,
760    2187.0,
761    6561.0,
762    19683.0,
763    59049.0,
764    177147.0,
765    531441.0,
766    1594323.0,
767    4782969.0,
768    14348907.0,
769    43046721.0,
770    129140163.0,
771    387420489.0,
772    1162261467.0,
773    3486784401.0,
774    10460353203.0,
775    31381059609.0,
776    94143178827.0,
777    282429536481.0,
778    847288609443.0,
779    2541865828329.0,
780    7625597484987.0,
781    22876792454961.0,
782    68630377364883.0,
783    205891132094649.0,
784    617673396283947.0,
785    1853020188851841.0,
786    5559060566555523.0,
787];
788const_assert!(SMALL_F64_POW3.len() > f64_exponent_limit(3).1 as usize);
789
790/// Pre-computed large power-of-3 for 32-bit limbs.
791#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
792pub const LARGE_POW3: [u32; 10] = [
793    2868424865, 1543175966, 3836194338, 2213345014, 1148585654, 4252227966, 1995653935, 3256521594,
794    1051739806, 534087228,
795];
796
797/// Pre-computed large power-of-3 for 64-bit limbs.
798#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
799pub const LARGE_POW3: [u64; 5] = [
800    6627890308811632801,
801    9506244453730856482,
802    18263180050255185590,
803    13986653746943443759,
804    2293887178523035294,
805];
806
807/// Step for large power-of-3 for 32-bit limbs.
808pub const LARGE_POW3_STEP: u32 = 200;
809
810/// Pre-computed, small powers-of-5.
811pub const SMALL_F32_POW5: [f32; 11] =
812    [1.0, 5.0, 25.0, 125.0, 625.0, 3125.0, 15625.0, 78125.0, 390625.0, 1953125.0, 9765625.0];
813const_assert!(SMALL_F32_POW5.len() > f32_exponent_limit(5).1 as usize);
814
815/// Pre-computed, small powers-of-5.
816pub const SMALL_F64_POW5: [f64; 23] = [
817    1.0,
818    5.0,
819    25.0,
820    125.0,
821    625.0,
822    3125.0,
823    15625.0,
824    78125.0,
825    390625.0,
826    1953125.0,
827    9765625.0,
828    48828125.0,
829    244140625.0,
830    1220703125.0,
831    6103515625.0,
832    30517578125.0,
833    152587890625.0,
834    762939453125.0,
835    3814697265625.0,
836    19073486328125.0,
837    95367431640625.0,
838    476837158203125.0,
839    2384185791015625.0,
840];
841const_assert!(SMALL_F64_POW5.len() > f64_exponent_limit(5).1 as usize);
842
843/// Pre-computed, small powers-of-6.
844pub const SMALL_INT_POW6: [u64; 25] = [
845    1,
846    6,
847    36,
848    216,
849    1296,
850    7776,
851    46656,
852    279936,
853    1679616,
854    10077696,
855    60466176,
856    362797056,
857    2176782336,
858    13060694016,
859    78364164096,
860    470184984576,
861    2821109907456,
862    16926659444736,
863    101559956668416,
864    609359740010496,
865    3656158440062976,
866    21936950640377856,
867    131621703842267136,
868    789730223053602816,
869    4738381338321616896,
870];
871const_assert!(SMALL_INT_POW6.len() > f64_mantissa_limit(6) as usize);
872const_assert!(SMALL_INT_POW6.len() == u64_power_limit(6) as usize + 1);
873
874/// Pre-computed, small powers-of-6.
875pub const SMALL_F32_POW6: [f32; 16] = [
876    1.0,
877    6.0,
878    36.0,
879    216.0,
880    1296.0,
881    7776.0,
882    46656.0,
883    279936.0,
884    1679616.0,
885    10077696.0,
886    60466176.0,
887    362797056.0,
888    2176782336.0,
889    13060694016.0,
890    78364164096.0,
891    470184984576.0,
892];
893const_assert!(SMALL_F32_POW6.len() > f32_exponent_limit(6).1 as usize);
894
895/// Pre-computed, small powers-of-6.
896pub const SMALL_F64_POW6: [f64; 34] = [
897    1.0,
898    6.0,
899    36.0,
900    216.0,
901    1296.0,
902    7776.0,
903    46656.0,
904    279936.0,
905    1679616.0,
906    10077696.0,
907    60466176.0,
908    362797056.0,
909    2176782336.0,
910    13060694016.0,
911    78364164096.0,
912    470184984576.0,
913    2821109907456.0,
914    16926659444736.0,
915    101559956668416.0,
916    609359740010496.0,
917    3656158440062976.0,
918    2.1936950640377856e+16,
919    1.3162170384226714e+17,
920    7.897302230536028e+17,
921    4.738381338321617e+18,
922    2.84302880299297e+19,
923    1.705817281795782e+20,
924    1.0234903690774692e+21,
925    6.140942214464815e+21,
926    3.6845653286788893e+22,
927    2.2107391972073336e+23,
928    1.3264435183244001e+24,
929    7.958661109946401e+24,
930    4.7751966659678405e+25,
931];
932const_assert!(SMALL_F64_POW6.len() > f64_exponent_limit(6).1 as usize);
933
934/// Pre-computed, small powers-of-7.
935pub const SMALL_INT_POW7: [u64; 23] = [
936    1,
937    7,
938    49,
939    343,
940    2401,
941    16807,
942    117649,
943    823543,
944    5764801,
945    40353607,
946    282475249,
947    1977326743,
948    13841287201,
949    96889010407,
950    678223072849,
951    4747561509943,
952    33232930569601,
953    232630513987207,
954    1628413597910449,
955    11398895185373143,
956    79792266297612001,
957    558545864083284007,
958    3909821048582988049,
959];
960const_assert!(SMALL_INT_POW7.len() > f64_mantissa_limit(7) as usize);
961const_assert!(SMALL_INT_POW7.len() == u64_power_limit(7) as usize + 1);
962
963/// Pre-computed, small powers-of-7.
964pub const SMALL_F32_POW7: [f32; 9] =
965    [1.0, 7.0, 49.0, 343.0, 2401.0, 16807.0, 117649.0, 823543.0, 5764801.0];
966const_assert!(SMALL_F32_POW7.len() > f32_exponent_limit(7).1 as usize);
967
968/// Pre-computed, small powers-of-7.
969pub const SMALL_F64_POW7: [f64; 19] = [
970    1.0,
971    7.0,
972    49.0,
973    343.0,
974    2401.0,
975    16807.0,
976    117649.0,
977    823543.0,
978    5764801.0,
979    40353607.0,
980    282475249.0,
981    1977326743.0,
982    13841287201.0,
983    96889010407.0,
984    678223072849.0,
985    4747561509943.0,
986    33232930569601.0,
987    232630513987207.0,
988    1628413597910449.0,
989];
990const_assert!(SMALL_F64_POW7.len() > f64_exponent_limit(7).1 as usize);
991
992/// Pre-computed large power-of-7 for 32-bit limbs.
993#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
994pub const LARGE_POW7: [u32; 10] = [
995    3938635601, 4013708425, 513691597, 1762742544, 3619207677, 480247883, 3793395133, 740892944,
996    1592317061, 1837154,
997];
998
999/// Pre-computed large power-of-7 for 64-bit limbs.
1000#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1001pub const LARGE_POW7: [u64; 5] = [
1002    17238746424993304401,
1003    7570921578261532621,
1004    2062648955077442045,
1005    3182110968110554557,
1006    7890517940032645,
1007];
1008
1009/// Step for large power-of-7 for 32-bit limbs.
1010pub const LARGE_POW7_STEP: u32 = 110;
1011
1012/// Pre-computed, small powers-of-9.
1013pub const SMALL_INT_POW9: [u64; 21] = [
1014    1,
1015    9,
1016    81,
1017    729,
1018    6561,
1019    59049,
1020    531441,
1021    4782969,
1022    43046721,
1023    387420489,
1024    3486784401,
1025    31381059609,
1026    282429536481,
1027    2541865828329,
1028    22876792454961,
1029    205891132094649,
1030    1853020188851841,
1031    16677181699666569,
1032    150094635296999121,
1033    1350851717672992089,
1034    12157665459056928801,
1035];
1036const_assert!(SMALL_INT_POW9.len() > f64_mantissa_limit(9) as usize);
1037const_assert!(SMALL_INT_POW9.len() == u64_power_limit(9) as usize + 1);
1038
1039/// Pre-computed, small powers-of-9.
1040pub const SMALL_F32_POW9: [f32; 8] = [1.0, 9.0, 81.0, 729.0, 6561.0, 59049.0, 531441.0, 4782969.0];
1041const_assert!(SMALL_F32_POW9.len() > f32_exponent_limit(9).1 as usize);
1042
1043/// Pre-computed, small powers-of-9.
1044pub const SMALL_F64_POW9: [f64; 17] = [
1045    1.0,
1046    9.0,
1047    81.0,
1048    729.0,
1049    6561.0,
1050    59049.0,
1051    531441.0,
1052    4782969.0,
1053    43046721.0,
1054    387420489.0,
1055    3486784401.0,
1056    31381059609.0,
1057    282429536481.0,
1058    2541865828329.0,
1059    22876792454961.0,
1060    205891132094649.0,
1061    1853020188851841.0,
1062];
1063const_assert!(SMALL_F64_POW9.len() > f64_exponent_limit(9).1 as usize);
1064
1065/// Pre-computed large power-of-9 for 32-bit limbs.
1066#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
1067pub const LARGE_POW9: [u32; 10] = [
1068    2868424865, 1543175966, 3836194338, 2213345014, 1148585654, 4252227966, 1995653935, 3256521594,
1069    1051739806, 534087228,
1070];
1071
1072/// Pre-computed large power-of-9 for 64-bit limbs.
1073#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1074pub const LARGE_POW9: [u64; 5] = [
1075    6627890308811632801,
1076    9506244453730856482,
1077    18263180050255185590,
1078    13986653746943443759,
1079    2293887178523035294,
1080];
1081
1082/// Step for large power-of-9 for 32-bit limbs.
1083pub const LARGE_POW9_STEP: u32 = 100;
1084
1085/// Pre-computed, small powers-of-11.
1086pub const SMALL_INT_POW11: [u64; 19] = [
1087    1,
1088    11,
1089    121,
1090    1331,
1091    14641,
1092    161051,
1093    1771561,
1094    19487171,
1095    214358881,
1096    2357947691,
1097    25937424601,
1098    285311670611,
1099    3138428376721,
1100    34522712143931,
1101    379749833583241,
1102    4177248169415651,
1103    45949729863572161,
1104    505447028499293771,
1105    5559917313492231481,
1106];
1107const_assert!(SMALL_INT_POW11.len() > f64_mantissa_limit(11) as usize);
1108const_assert!(SMALL_INT_POW11.len() == u64_power_limit(11) as usize + 1);
1109
1110/// Pre-computed, small powers-of-11.
1111pub const SMALL_F32_POW11: [f32; 7] = [1.0, 11.0, 121.0, 1331.0, 14641.0, 161051.0, 1771561.0];
1112const_assert!(SMALL_F32_POW11.len() > f32_exponent_limit(11).1 as usize);
1113
1114/// Pre-computed, small powers-of-11.
1115pub const SMALL_F64_POW11: [f64; 16] = [
1116    1.0,
1117    11.0,
1118    121.0,
1119    1331.0,
1120    14641.0,
1121    161051.0,
1122    1771561.0,
1123    19487171.0,
1124    214358881.0,
1125    2357947691.0,
1126    25937424601.0,
1127    285311670611.0,
1128    3138428376721.0,
1129    34522712143931.0,
1130    379749833583241.0,
1131    4177248169415651.0,
1132];
1133const_assert!(SMALL_F64_POW11.len() > f64_exponent_limit(11).1 as usize);
1134
1135/// Pre-computed large power-of-11 for 32-bit limbs.
1136#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
1137pub const LARGE_POW11: [u32; 10] = [
1138    2172432537, 2346616081, 1851665372, 2301834192, 1763429507, 4086589879, 4002403721, 2932076170,
1139    987565374, 10683238,
1140];
1141
1142/// Pre-computed large power-of-11 for 64-bit limbs.
1143#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1144pub const LARGE_POW11: [u64; 5] = [
1145    10078639326335119513,
1146    9886302577306250204,
1147    17551769884233026691,
1148    12593171263533340041,
1149    45884158812949822,
1150];
1151
1152/// Step for large power-of-11 for 32-bit limbs.
1153pub const LARGE_POW11_STEP: u32 = 90;
1154
1155/// Pre-computed, small powers-of-12.
1156pub const SMALL_INT_POW12: [u64; 18] = [
1157    1,
1158    12,
1159    144,
1160    1728,
1161    20736,
1162    248832,
1163    2985984,
1164    35831808,
1165    429981696,
1166    5159780352,
1167    61917364224,
1168    743008370688,
1169    8916100448256,
1170    106993205379072,
1171    1283918464548864,
1172    15407021574586368,
1173    184884258895036416,
1174    2218611106740436992,
1175];
1176const_assert!(SMALL_INT_POW12.len() > f64_mantissa_limit(12) as usize);
1177const_assert!(SMALL_INT_POW12.len() == u64_power_limit(12) as usize + 1);
1178
1179/// Pre-computed, small powers-of-12.
1180pub const SMALL_F32_POW12: [f32; 16] = [
1181    1.0,
1182    12.0,
1183    144.0,
1184    1728.0,
1185    20736.0,
1186    248832.0,
1187    2985984.0,
1188    35831808.0,
1189    429981696.0,
1190    5159780352.0,
1191    61917364224.0,
1192    743008370688.0,
1193    8916100448256.0,
1194    106993205379072.0,
1195    1283918464548864.0,
1196    1.5407021574586368e+16,
1197];
1198const_assert!(SMALL_F32_POW12.len() > f32_exponent_limit(12).1 as usize);
1199
1200/// Pre-computed, small powers-of-12.
1201pub const SMALL_F64_POW12: [f64; 34] = [
1202    1.0,
1203    12.0,
1204    144.0,
1205    1728.0,
1206    20736.0,
1207    248832.0,
1208    2985984.0,
1209    35831808.0,
1210    429981696.0,
1211    5159780352.0,
1212    61917364224.0,
1213    743008370688.0,
1214    8916100448256.0,
1215    106993205379072.0,
1216    1283918464548864.0,
1217    1.5407021574586368e+16,
1218    1.848842588950364e+17,
1219    2.218611106740437e+18,
1220    2.6623333280885244e+19,
1221    3.194799993706229e+20,
1222    3.833759992447475e+21,
1223    4.60051199093697e+22,
1224    5.520614389124364e+23,
1225    6.624737266949237e+24,
1226    7.949684720339084e+25,
1227    9.539621664406901e+26,
1228    1.1447545997288282e+28,
1229    1.3737055196745938e+29,
1230    1.6484466236095125e+30,
1231    1.978135948331415e+31,
1232    2.373763137997698e+32,
1233    2.8485157655972377e+33,
1234    3.418218918716685e+34,
1235    4.101862702460022e+35,
1236];
1237const_assert!(SMALL_F64_POW12.len() > f64_exponent_limit(12).1 as usize);
1238
1239/// Pre-computed, small powers-of-13.
1240pub const SMALL_INT_POW13: [u64; 18] = [
1241    1,
1242    13,
1243    169,
1244    2197,
1245    28561,
1246    371293,
1247    4826809,
1248    62748517,
1249    815730721,
1250    10604499373,
1251    137858491849,
1252    1792160394037,
1253    23298085122481,
1254    302875106592253,
1255    3937376385699289,
1256    51185893014090757,
1257    665416609183179841,
1258    8650415919381337933,
1259];
1260const_assert!(SMALL_INT_POW13.len() > f64_mantissa_limit(13) as usize);
1261const_assert!(SMALL_INT_POW13.len() == u64_power_limit(13) as usize + 1);
1262
1263/// Pre-computed, small powers-of-13.
1264pub const SMALL_F32_POW13: [f32; 7] = [1.0, 13.0, 169.0, 2197.0, 28561.0, 371293.0, 4826809.0];
1265const_assert!(SMALL_F32_POW13.len() > f32_exponent_limit(13).1 as usize);
1266
1267/// Pre-computed, small powers-of-13.
1268pub const SMALL_F64_POW13: [f64; 15] = [
1269    1.0,
1270    13.0,
1271    169.0,
1272    2197.0,
1273    28561.0,
1274    371293.0,
1275    4826809.0,
1276    62748517.0,
1277    815730721.0,
1278    10604499373.0,
1279    137858491849.0,
1280    1792160394037.0,
1281    23298085122481.0,
1282    302875106592253.0,
1283    3937376385699289.0,
1284];
1285const_assert!(SMALL_F64_POW13.len() > f64_exponent_limit(13).1 as usize);
1286
1287/// Pre-computed large power-of-13 for 32-bit limbs.
1288#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
1289pub const LARGE_POW13: [u32; 10] = [
1290    3146523293, 4222426932, 2977536293, 1295813598, 1909522258, 1606005718, 3366933208, 327990755,
1291    3779976816, 97397137,
1292];
1293
1294/// Pre-computed large power-of-13 for 64-bit limbs.
1295#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1296pub const LARGE_POW13: [u64; 5] = [
1297    18135185585836139165,
1298    5565477028099627301,
1299    6897742037908520786,
1300    1408709569482281688,
1301    418317521919008368,
1302];
1303
1304/// Step for large power-of-13 for 32-bit limbs.
1305pub const LARGE_POW13_STEP: u32 = 85;
1306
1307/// Pre-computed, small powers-of-14.
1308pub const SMALL_INT_POW14: [u64; 17] = [
1309    1,
1310    14,
1311    196,
1312    2744,
1313    38416,
1314    537824,
1315    7529536,
1316    105413504,
1317    1475789056,
1318    20661046784,
1319    289254654976,
1320    4049565169664,
1321    56693912375296,
1322    793714773254144,
1323    11112006825558016,
1324    155568095557812224,
1325    2177953337809371136,
1326];
1327const_assert!(SMALL_INT_POW14.len() > f64_mantissa_limit(14) as usize);
1328const_assert!(SMALL_INT_POW14.len() == u64_power_limit(14) as usize + 1);
1329
1330/// Pre-computed, small powers-of-14.
1331pub const SMALL_F32_POW14: [f32; 9] =
1332    [1.0, 14.0, 196.0, 2744.0, 38416.0, 537824.0, 7529536.0, 105413504.0, 1475789056.0];
1333const_assert!(SMALL_F32_POW14.len() > f32_exponent_limit(14).1 as usize);
1334
1335/// Pre-computed, small powers-of-14.
1336pub const SMALL_F64_POW14: [f64; 19] = [
1337    1.0,
1338    14.0,
1339    196.0,
1340    2744.0,
1341    38416.0,
1342    537824.0,
1343    7529536.0,
1344    105413504.0,
1345    1475789056.0,
1346    20661046784.0,
1347    289254654976.0,
1348    4049565169664.0,
1349    56693912375296.0,
1350    793714773254144.0,
1351    1.1112006825558016e+16,
1352    1.5556809555781222e+17,
1353    2.1779533378093711e+18,
1354    3.0491346729331196e+19,
1355    4.2687885421063674e+20,
1356];
1357const_assert!(SMALL_F64_POW14.len() > f64_exponent_limit(14).1 as usize);
1358
1359/// Pre-computed, small powers-of-15.
1360pub const SMALL_INT_POW15: [u64; 17] = [
1361    1,
1362    15,
1363    225,
1364    3375,
1365    50625,
1366    759375,
1367    11390625,
1368    170859375,
1369    2562890625,
1370    38443359375,
1371    576650390625,
1372    8649755859375,
1373    129746337890625,
1374    1946195068359375,
1375    29192926025390625,
1376    437893890380859375,
1377    6568408355712890625,
1378];
1379const_assert!(SMALL_INT_POW15.len() > f64_mantissa_limit(15) as usize);
1380const_assert!(SMALL_INT_POW15.len() == u64_power_limit(15) as usize + 1);
1381
1382/// Pre-computed, small powers-of-15.
1383pub const SMALL_F32_POW15: [f32; 7] = [1.0, 15.0, 225.0, 3375.0, 50625.0, 759375.0, 11390625.0];
1384const_assert!(SMALL_F32_POW15.len() > f32_exponent_limit(15).1 as usize);
1385
1386/// Pre-computed, small powers-of-15.
1387pub const SMALL_F64_POW15: [f64; 14] = [
1388    1.0,
1389    15.0,
1390    225.0,
1391    3375.0,
1392    50625.0,
1393    759375.0,
1394    11390625.0,
1395    170859375.0,
1396    2562890625.0,
1397    38443359375.0,
1398    576650390625.0,
1399    8649755859375.0,
1400    129746337890625.0,
1401    1946195068359375.0,
1402];
1403const_assert!(SMALL_F64_POW15.len() > f64_exponent_limit(15).1 as usize);
1404
1405/// Pre-computed large power-of-15 for 32-bit limbs.
1406#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
1407pub const LARGE_POW15: [u32; 10] = [
1408    3507049217, 2300028134, 3886839708, 4190270956, 1622122702, 1947334599, 204338878, 3105278257,
1409    2490561006, 24584533,
1410];
1411
1412/// Pre-computed large power-of-15 for 64-bit limbs.
1413#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1414pub const LARGE_POW15: [u64; 5] = [
1415    9878545618916954881,
1416    17997076721285494684,
1417    8363738418696397006,
1418    13337068558999221950,
1419    105589767712993774,
1420];
1421
1422/// Step for large power-of-15 for 32-bit limbs.
1423pub const LARGE_POW15_STEP: u32 = 80;
1424
1425/// Pre-computed, small powers-of-17.
1426pub const SMALL_INT_POW17: [u64; 16] = [
1427    1,
1428    17,
1429    289,
1430    4913,
1431    83521,
1432    1419857,
1433    24137569,
1434    410338673,
1435    6975757441,
1436    118587876497,
1437    2015993900449,
1438    34271896307633,
1439    582622237229761,
1440    9904578032905937,
1441    168377826559400929,
1442    2862423051509815793,
1443];
1444const_assert!(SMALL_INT_POW17.len() > f64_mantissa_limit(17) as usize);
1445const_assert!(SMALL_INT_POW17.len() == u64_power_limit(17) as usize + 1);
1446
1447/// Pre-computed, small powers-of-17.
1448pub const SMALL_F32_POW17: [f32; 6] = [1.0, 17.0, 289.0, 4913.0, 83521.0, 1419857.0];
1449const_assert!(SMALL_F32_POW17.len() > f32_exponent_limit(17).1 as usize);
1450
1451/// Pre-computed, small powers-of-17.
1452pub const SMALL_F64_POW17: [f64; 13] = [
1453    1.0,
1454    17.0,
1455    289.0,
1456    4913.0,
1457    83521.0,
1458    1419857.0,
1459    24137569.0,
1460    410338673.0,
1461    6975757441.0,
1462    118587876497.0,
1463    2015993900449.0,
1464    34271896307633.0,
1465    582622237229761.0,
1466];
1467const_assert!(SMALL_F64_POW17.len() > f64_exponent_limit(17).1 as usize);
1468
1469/// Pre-computed large power-of-17 for 32-bit limbs.
1470#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
1471pub const LARGE_POW17: [u32; 10] = [
1472    2990615473, 2810986799, 4066186761, 2554374905, 4073187723, 2831536001, 529177471, 3891721527,
1473    4211495815, 386393,
1474];
1475
1476/// Pre-computed large power-of-17 for 64-bit limbs.
1477#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1478pub const LARGE_POW17: [u64; 5] = [
1479    12073096374183340977,
1480    10970956682764293641,
1481    12161354525814811019,
1482    16714816684133358463,
1483    1659549509899143,
1484];
1485
1486/// Step for large power-of-17 for 32-bit limbs.
1487pub const LARGE_POW17_STEP: u32 = 75;
1488
1489/// Pre-computed, small powers-of-18.
1490pub const SMALL_INT_POW18: [u64; 16] = [
1491    1,
1492    18,
1493    324,
1494    5832,
1495    104976,
1496    1889568,
1497    34012224,
1498    612220032,
1499    11019960576,
1500    198359290368,
1501    3570467226624,
1502    64268410079232,
1503    1156831381426176,
1504    20822964865671168,
1505    374813367582081024,
1506    6746640616477458432,
1507];
1508const_assert!(SMALL_INT_POW18.len() > f64_mantissa_limit(18) as usize);
1509const_assert!(SMALL_INT_POW18.len() == u64_power_limit(18) as usize + 1);
1510
1511/// Pre-computed, small powers-of-18.
1512pub const SMALL_F32_POW18: [f32; 8] =
1513    [1.0, 18.0, 324.0, 5832.0, 104976.0, 1889568.0, 34012224.0, 612220032.0];
1514const_assert!(SMALL_F32_POW18.len() > f32_exponent_limit(18).1 as usize);
1515
1516/// Pre-computed, small powers-of-18.
1517pub const SMALL_F64_POW18: [f64; 17] = [
1518    1.0,
1519    18.0,
1520    324.0,
1521    5832.0,
1522    104976.0,
1523    1889568.0,
1524    34012224.0,
1525    612220032.0,
1526    11019960576.0,
1527    198359290368.0,
1528    3570467226624.0,
1529    64268410079232.0,
1530    1156831381426176.0,
1531    2.082296486567117e+16,
1532    3.74813367582081e+17,
1533    6.746640616477458e+18,
1534    1.2143953109659425e+20,
1535];
1536const_assert!(SMALL_F64_POW18.len() > f64_exponent_limit(18).1 as usize);
1537
1538/// Pre-computed, small powers-of-19.
1539pub const SMALL_INT_POW19: [u64; 16] = [
1540    1,
1541    19,
1542    361,
1543    6859,
1544    130321,
1545    2476099,
1546    47045881,
1547    893871739,
1548    16983563041,
1549    322687697779,
1550    6131066257801,
1551    116490258898219,
1552    2213314919066161,
1553    42052983462257059,
1554    799006685782884121,
1555    15181127029874798299,
1556];
1557const_assert!(SMALL_INT_POW19.len() > f64_mantissa_limit(19) as usize);
1558const_assert!(SMALL_INT_POW19.len() == u64_power_limit(19) as usize + 1);
1559
1560/// Pre-computed, small powers-of-19.
1561pub const SMALL_F32_POW19: [f32; 6] = [1.0, 19.0, 361.0, 6859.0, 130321.0, 2476099.0];
1562const_assert!(SMALL_F32_POW19.len() > f32_exponent_limit(19).1 as usize);
1563
1564/// Pre-computed, small powers-of-19.
1565pub const SMALL_F64_POW19: [f64; 13] = [
1566    1.0,
1567    19.0,
1568    361.0,
1569    6859.0,
1570    130321.0,
1571    2476099.0,
1572    47045881.0,
1573    893871739.0,
1574    16983563041.0,
1575    322687697779.0,
1576    6131066257801.0,
1577    116490258898219.0,
1578    2213314919066161.0,
1579];
1580const_assert!(SMALL_F64_POW19.len() > f64_exponent_limit(19).1 as usize);
1581
1582/// Pre-computed large power-of-19 for 32-bit limbs.
1583#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
1584pub const LARGE_POW19: [u32; 10] = [
1585    844079147, 4109067463, 2265902219, 1405351247, 3107957240, 2205473157, 271286156, 2969717342,
1586    1924040718, 1621366965,
1587];
1588
1589/// Pre-computed large power-of-19 for 64-bit limbs.
1590#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1591pub const LARGE_POW19: [u64; 5] = [
1592    17648310371486769195,
1593    6035937647523720331,
1594    9472435084628830712,
1595    12754838862525333388,
1596    6963718091413817358,
1597];
1598
1599/// Step for large power-of-19 for 32-bit limbs.
1600pub const LARGE_POW19_STEP: u32 = 75;
1601
1602/// Pre-computed, small powers-of-20.
1603pub const SMALL_INT_POW20: [u64; 15] = [
1604    1,
1605    20,
1606    400,
1607    8000,
1608    160000,
1609    3200000,
1610    64000000,
1611    1280000000,
1612    25600000000,
1613    512000000000,
1614    10240000000000,
1615    204800000000000,
1616    4096000000000000,
1617    81920000000000000,
1618    1638400000000000000,
1619];
1620const_assert!(SMALL_INT_POW20.len() > f64_mantissa_limit(20) as usize);
1621const_assert!(SMALL_INT_POW20.len() == u64_power_limit(20) as usize + 1);
1622
1623/// Pre-computed, small powers-of-20.
1624pub const SMALL_F32_POW20: [f32; 11] = [
1625    1.0,
1626    20.0,
1627    400.0,
1628    8000.0,
1629    160000.0,
1630    3200000.0,
1631    64000000.0,
1632    1280000000.0,
1633    25600000000.0,
1634    512000000000.0,
1635    10240000000000.0,
1636];
1637const_assert!(SMALL_F32_POW20.len() > f32_exponent_limit(20).1 as usize);
1638
1639/// Pre-computed, small powers-of-20.
1640pub const SMALL_F64_POW20: [f64; 23] = [
1641    1.0,
1642    20.0,
1643    400.0,
1644    8000.0,
1645    160000.0,
1646    3200000.0,
1647    64000000.0,
1648    1280000000.0,
1649    25600000000.0,
1650    512000000000.0,
1651    10240000000000.0,
1652    204800000000000.0,
1653    4096000000000000.0,
1654    8.192e+16,
1655    1.6384e+18,
1656    3.2768e+19,
1657    6.5536e+20,
1658    1.31072e+22,
1659    2.62144e+23,
1660    5.24288e+24,
1661    1.048576e+26,
1662    2.097152e+27,
1663    4.194304e+28,
1664];
1665const_assert!(SMALL_F64_POW20.len() > f64_exponent_limit(20).1 as usize);
1666
1667/// Pre-computed, small powers-of-21.
1668pub const SMALL_INT_POW21: [u64; 15] = [
1669    1,
1670    21,
1671    441,
1672    9261,
1673    194481,
1674    4084101,
1675    85766121,
1676    1801088541,
1677    37822859361,
1678    794280046581,
1679    16679880978201,
1680    350277500542221,
1681    7355827511386641,
1682    154472377739119461,
1683    3243919932521508681,
1684];
1685const_assert!(SMALL_INT_POW21.len() > f64_mantissa_limit(21) as usize);
1686const_assert!(SMALL_INT_POW21.len() == u64_power_limit(21) as usize + 1);
1687
1688/// Pre-computed, small powers-of-21.
1689pub const SMALL_F32_POW21: [f32; 6] = [1.0, 21.0, 441.0, 9261.0, 194481.0, 4084101.0];
1690const_assert!(SMALL_F32_POW21.len() > f32_exponent_limit(21).1 as usize);
1691
1692/// Pre-computed, small powers-of-21.
1693pub const SMALL_F64_POW21: [f64; 13] = [
1694    1.0,
1695    21.0,
1696    441.0,
1697    9261.0,
1698    194481.0,
1699    4084101.0,
1700    85766121.0,
1701    1801088541.0,
1702    37822859361.0,
1703    794280046581.0,
1704    16679880978201.0,
1705    350277500542221.0,
1706    7355827511386641.0,
1707];
1708const_assert!(SMALL_F64_POW21.len() > f64_exponent_limit(21).1 as usize);
1709
1710/// Pre-computed large power-of-21 for 32-bit limbs.
1711#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
1712pub const LARGE_POW21: [u32; 10] = [
1713    138418921, 1265804130, 2218244279, 959999061, 1977606600, 816701562, 1115590038, 3476226057,
1714    1985711423, 722290,
1715];
1716
1717/// Pre-computed large power-of-21 for 64-bit limbs.
1718#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1719pub const LARGE_POW21: [u64; 5] = [
1720    5436587341630151401,
1721    4123164573403953335,
1722    3507706501359722952,
1723    14930277229433621910,
1724    3102213913939263,
1725];
1726
1727/// Step for large power-of-21 for 32-bit limbs.
1728pub const LARGE_POW21_STEP: u32 = 70;
1729
1730/// Pre-computed, small powers-of-22.
1731pub const SMALL_INT_POW22: [u64; 15] = [
1732    1,
1733    22,
1734    484,
1735    10648,
1736    234256,
1737    5153632,
1738    113379904,
1739    2494357888,
1740    54875873536,
1741    1207269217792,
1742    26559922791424,
1743    584318301411328,
1744    12855002631049216,
1745    282810057883082752,
1746    6221821273427820544,
1747];
1748const_assert!(SMALL_INT_POW22.len() > f64_mantissa_limit(22) as usize);
1749const_assert!(SMALL_INT_POW22.len() == u64_power_limit(22) as usize + 1);
1750
1751/// Pre-computed, small powers-of-22.
1752pub const SMALL_F32_POW22: [f32; 7] = [1.0, 22.0, 484.0, 10648.0, 234256.0, 5153632.0, 113379904.0];
1753const_assert!(SMALL_F32_POW22.len() > f32_exponent_limit(22).1 as usize);
1754
1755/// Pre-computed, small powers-of-22.
1756pub const SMALL_F64_POW22: [f64; 16] = [
1757    1.0,
1758    22.0,
1759    484.0,
1760    10648.0,
1761    234256.0,
1762    5153632.0,
1763    113379904.0,
1764    2494357888.0,
1765    54875873536.0,
1766    1207269217792.0,
1767    26559922791424.0,
1768    584318301411328.0,
1769    1.2855002631049216e+16,
1770    2.8281005788308275e+17,
1771    6.221821273427821e+18,
1772    1.3688006801541205e+20,
1773];
1774const_assert!(SMALL_F64_POW22.len() > f64_exponent_limit(22).1 as usize);
1775
1776/// Pre-computed, small powers-of-23.
1777pub const SMALL_INT_POW23: [u64; 15] = [
1778    1,
1779    23,
1780    529,
1781    12167,
1782    279841,
1783    6436343,
1784    148035889,
1785    3404825447,
1786    78310985281,
1787    1801152661463,
1788    41426511213649,
1789    952809757913927,
1790    21914624432020321,
1791    504036361936467383,
1792    11592836324538749809,
1793];
1794const_assert!(SMALL_INT_POW23.len() > f64_mantissa_limit(23) as usize);
1795const_assert!(SMALL_INT_POW23.len() == u64_power_limit(23) as usize + 1);
1796
1797/// Pre-computed, small powers-of-23.
1798pub const SMALL_F32_POW23: [f32; 6] = [1.0, 23.0, 529.0, 12167.0, 279841.0, 6436343.0];
1799const_assert!(SMALL_F32_POW23.len() > f32_exponent_limit(23).1 as usize);
1800
1801/// Pre-computed, small powers-of-23.
1802pub const SMALL_F64_POW23: [f64; 12] = [
1803    1.0,
1804    23.0,
1805    529.0,
1806    12167.0,
1807    279841.0,
1808    6436343.0,
1809    148035889.0,
1810    3404825447.0,
1811    78310985281.0,
1812    1801152661463.0,
1813    41426511213649.0,
1814    952809757913927.0,
1815];
1816const_assert!(SMALL_F64_POW23.len() > f64_exponent_limit(23).1 as usize);
1817
1818/// Pre-computed large power-of-23 for 32-bit limbs.
1819#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
1820pub const LARGE_POW23: [u32; 10] = [
1821    1403677489, 2801905613, 3028338484, 1469351396, 2741227823, 193620048, 1084942677, 2905110101,
1822    3742230796, 421026827,
1823];
1824
1825/// Pre-computed large power-of-23 for 64-bit limbs.
1826#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1827pub const LARGE_POW23: [u64; 5] = [
1828    12034092975717509937,
1829    6310816195180283700,
1830    831591776751178031,
1831    12477352876159199573,
1832    1808296456445880588,
1833];
1834
1835/// Step for large power-of-23 for 32-bit limbs.
1836pub const LARGE_POW23_STEP: u32 = 70;
1837
1838/// Pre-computed, small powers-of-24.
1839pub const SMALL_INT_POW24: [u64; 14] = [
1840    1,
1841    24,
1842    576,
1843    13824,
1844    331776,
1845    7962624,
1846    191102976,
1847    4586471424,
1848    110075314176,
1849    2641807540224,
1850    63403380965376,
1851    1521681143169024,
1852    36520347436056576,
1853    876488338465357824,
1854];
1855const_assert!(SMALL_INT_POW24.len() > f64_mantissa_limit(24) as usize);
1856const_assert!(SMALL_INT_POW24.len() == u64_power_limit(24) as usize + 1);
1857
1858/// Pre-computed, small powers-of-24.
1859pub const SMALL_F32_POW24: [f32; 16] = [
1860    1.0,
1861    24.0,
1862    576.0,
1863    13824.0,
1864    331776.0,
1865    7962624.0,
1866    191102976.0,
1867    4586471424.0,
1868    110075314176.0,
1869    2641807540224.0,
1870    63403380965376.0,
1871    1521681143169024.0,
1872    3.652034743605658e+16,
1873    8.764883384653578e+17,
1874    2.1035720123168588e+19,
1875    5.048572829560461e+20,
1876];
1877const_assert!(SMALL_F32_POW24.len() > f32_exponent_limit(24).1 as usize);
1878
1879/// Pre-computed, small powers-of-24.
1880pub const SMALL_F64_POW24: [f64; 34] = [
1881    1.0,
1882    24.0,
1883    576.0,
1884    13824.0,
1885    331776.0,
1886    7962624.0,
1887    191102976.0,
1888    4586471424.0,
1889    110075314176.0,
1890    2641807540224.0,
1891    63403380965376.0,
1892    1521681143169024.0,
1893    3.652034743605658e+16,
1894    8.764883384653578e+17,
1895    2.1035720123168588e+19,
1896    5.048572829560461e+20,
1897    1.2116574790945107e+22,
1898    2.9079779498268256e+23,
1899    6.979147079584381e+24,
1900    1.6749952991002515e+26,
1901    4.0199887178406037e+27,
1902    9.647972922817449e+28,
1903    2.3155135014761877e+30,
1904    5.5572324035428505e+31,
1905    1.333735776850284e+33,
1906    3.200965864440682e+34,
1907    7.682318074657637e+35,
1908    1.8437563379178328e+37,
1909    4.425015211002799e+38,
1910    1.0620036506406717e+40,
1911    2.548808761537612e+41,
1912    6.117141027690269e+42,
1913    1.4681138466456645e+44,
1914    3.523473231949595e+45,
1915];
1916const_assert!(SMALL_F64_POW24.len() > f64_exponent_limit(24).1 as usize);
1917
1918/// Pre-computed, small powers-of-25.
1919pub const SMALL_INT_POW25: [u64; 14] = [
1920    1,
1921    25,
1922    625,
1923    15625,
1924    390625,
1925    9765625,
1926    244140625,
1927    6103515625,
1928    152587890625,
1929    3814697265625,
1930    95367431640625,
1931    2384185791015625,
1932    59604644775390625,
1933    1490116119384765625,
1934];
1935const_assert!(SMALL_INT_POW25.len() > f64_mantissa_limit(25) as usize);
1936const_assert!(SMALL_INT_POW25.len() == u64_power_limit(25) as usize + 1);
1937
1938/// Pre-computed, small powers-of-25.
1939pub const SMALL_F32_POW25: [f32; 6] = [1.0, 25.0, 625.0, 15625.0, 390625.0, 9765625.0];
1940const_assert!(SMALL_F32_POW25.len() > f32_exponent_limit(25).1 as usize);
1941
1942/// Pre-computed, small powers-of-25.
1943pub const SMALL_F64_POW25: [f64; 12] = [
1944    1.0,
1945    25.0,
1946    625.0,
1947    15625.0,
1948    390625.0,
1949    9765625.0,
1950    244140625.0,
1951    6103515625.0,
1952    152587890625.0,
1953    3814697265625.0,
1954    95367431640625.0,
1955    2384185791015625.0,
1956];
1957const_assert!(SMALL_F64_POW25.len() > f64_exponent_limit(25).1 as usize);
1958
1959/// Pre-computed large power-of-25 for 32-bit limbs.
1960#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
1961pub const LARGE_POW25: [u32; 10] = [
1962    2358447641, 1624633829, 2031259829, 1986676888, 2941191183, 611941596, 1880507741, 990341507,
1963    3289036379, 14772,
1964];
1965
1966/// Pre-computed large power-of-25 for 64-bit limbs.
1967#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
1968pub const LARGE_POW25: [u64; 5] = [
1969    6977749165888704025,
1970    8532712263710314677,
1971    2628269144823235599,
1972    4253484386316862813,
1973    63448545932891,
1974];
1975
1976/// Step for large power-of-25 for 32-bit limbs.
1977pub const LARGE_POW25_STEP: u32 = 65;
1978
1979/// Pre-computed, small powers-of-26.
1980pub const SMALL_INT_POW26: [u64; 14] = [
1981    1,
1982    26,
1983    676,
1984    17576,
1985    456976,
1986    11881376,
1987    308915776,
1988    8031810176,
1989    208827064576,
1990    5429503678976,
1991    141167095653376,
1992    3670344486987776,
1993    95428956661682176,
1994    2481152873203736576,
1995];
1996const_assert!(SMALL_INT_POW26.len() > f64_mantissa_limit(26) as usize);
1997const_assert!(SMALL_INT_POW26.len() == u64_power_limit(26) as usize + 1);
1998
1999/// Pre-computed, small powers-of-26.
2000pub const SMALL_F32_POW26: [f32; 7] =
2001    [1.0, 26.0, 676.0, 17576.0, 456976.0, 11881376.0, 308915776.0];
2002const_assert!(SMALL_F32_POW26.len() > f32_exponent_limit(26).1 as usize);
2003
2004/// Pre-computed, small powers-of-26.
2005pub const SMALL_F64_POW26: [f64; 15] = [
2006    1.0,
2007    26.0,
2008    676.0,
2009    17576.0,
2010    456976.0,
2011    11881376.0,
2012    308915776.0,
2013    8031810176.0,
2014    208827064576.0,
2015    5429503678976.0,
2016    141167095653376.0,
2017    3670344486987776.0,
2018    9.542895666168218e+16,
2019    2.4811528732037366e+18,
2020    6.450997470329715e+19,
2021];
2022const_assert!(SMALL_F64_POW26.len() > f64_exponent_limit(26).1 as usize);
2023
2024/// Pre-computed, small powers-of-27.
2025pub const SMALL_INT_POW27: [u64; 14] = [
2026    1,
2027    27,
2028    729,
2029    19683,
2030    531441,
2031    14348907,
2032    387420489,
2033    10460353203,
2034    282429536481,
2035    7625597484987,
2036    205891132094649,
2037    5559060566555523,
2038    150094635296999121,
2039    4052555153018976267,
2040];
2041const_assert!(SMALL_INT_POW27.len() > f64_mantissa_limit(27) as usize);
2042const_assert!(SMALL_INT_POW27.len() == u64_power_limit(27) as usize + 1);
2043
2044/// Pre-computed, small powers-of-27.
2045pub const SMALL_F32_POW27: [f32; 6] = [1.0, 27.0, 729.0, 19683.0, 531441.0, 14348907.0];
2046const_assert!(SMALL_F32_POW27.len() > f32_exponent_limit(27).1 as usize);
2047
2048/// Pre-computed, small powers-of-27.
2049pub const SMALL_F64_POW27: [f64; 12] = [
2050    1.0,
2051    27.0,
2052    729.0,
2053    19683.0,
2054    531441.0,
2055    14348907.0,
2056    387420489.0,
2057    10460353203.0,
2058    282429536481.0,
2059    7625597484987.0,
2060    205891132094649.0,
2061    5559060566555523.0,
2062];
2063const_assert!(SMALL_F64_POW27.len() > f64_exponent_limit(27).1 as usize);
2064
2065/// Pre-computed large power-of-27 for 32-bit limbs.
2066#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
2067pub const LARGE_POW27: [u32; 10] = [
2068    1249037595, 465894344, 2861423576, 2518924695, 4122946360, 4029669975, 3949684612, 3795800505,
2069    3556955416, 2197889,
2070];
2071
2072/// Pre-computed large power-of-27 for 64-bit limbs.
2073#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
2074pub const LARGE_POW27: [u64; 5] = [
2075    2001000972120411419,
2076    10818699188973198296,
2077    17307300760421083960,
2078    16302839035064969092,
2079    9439864932193560,
2080];
2081
2082/// Step for large power-of-27 for 32-bit limbs.
2083pub const LARGE_POW27_STEP: u32 = 65;
2084
2085/// Pre-computed, small powers-of-28.
2086pub const SMALL_INT_POW28: [u64; 14] = [
2087    1,
2088    28,
2089    784,
2090    21952,
2091    614656,
2092    17210368,
2093    481890304,
2094    13492928512,
2095    377801998336,
2096    10578455953408,
2097    296196766695424,
2098    8293509467471872,
2099    232218265089212416,
2100    6502111422497947648,
2101];
2102const_assert!(SMALL_INT_POW28.len() > f64_mantissa_limit(28) as usize);
2103const_assert!(SMALL_INT_POW28.len() == u64_power_limit(28) as usize + 1);
2104
2105/// Pre-computed, small powers-of-28.
2106pub const SMALL_F32_POW28: [f32; 9] =
2107    [1.0, 28.0, 784.0, 21952.0, 614656.0, 17210368.0, 481890304.0, 13492928512.0, 377801998336.0];
2108const_assert!(SMALL_F32_POW28.len() > f32_exponent_limit(28).1 as usize);
2109
2110/// Pre-computed, small powers-of-28.
2111pub const SMALL_F64_POW28: [f64; 19] = [
2112    1.0,
2113    28.0,
2114    784.0,
2115    21952.0,
2116    614656.0,
2117    17210368.0,
2118    481890304.0,
2119    13492928512.0,
2120    377801998336.0,
2121    10578455953408.0,
2122    296196766695424.0,
2123    8293509467471872.0,
2124    2.322182650892124e+17,
2125    6.502111422497948e+18,
2126    1.8205911982994253e+20,
2127    5.097655355238391e+21,
2128    1.4273434994667495e+23,
2129    3.9965617985068985e+24,
2130    1.1190373035819316e+26,
2131];
2132const_assert!(SMALL_F64_POW28.len() > f64_exponent_limit(28).1 as usize);
2133
2134/// Pre-computed, small powers-of-29.
2135pub const SMALL_INT_POW29: [u64; 14] = [
2136    1,
2137    29,
2138    841,
2139    24389,
2140    707281,
2141    20511149,
2142    594823321,
2143    17249876309,
2144    500246412961,
2145    14507145975869,
2146    420707233300201,
2147    12200509765705829,
2148    353814783205469041,
2149    10260628712958602189,
2150];
2151const_assert!(SMALL_INT_POW29.len() > f64_mantissa_limit(29) as usize);
2152const_assert!(SMALL_INT_POW29.len() == u64_power_limit(29) as usize + 1);
2153
2154/// Pre-computed, small powers-of-29.
2155pub const SMALL_F32_POW29: [f32; 5] = [1.0, 29.0, 841.0, 24389.0, 707281.0];
2156const_assert!(SMALL_F32_POW29.len() > f32_exponent_limit(29).1 as usize);
2157
2158/// Pre-computed, small powers-of-29.
2159pub const SMALL_F64_POW29: [f64; 11] = [
2160    1.0,
2161    29.0,
2162    841.0,
2163    24389.0,
2164    707281.0,
2165    20511149.0,
2166    594823321.0,
2167    17249876309.0,
2168    500246412961.0,
2169    14507145975869.0,
2170    420707233300201.0,
2171];
2172const_assert!(SMALL_F64_POW29.len() > f64_exponent_limit(29).1 as usize);
2173
2174/// Pre-computed large power-of-29 for 32-bit limbs.
2175#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
2176pub const LARGE_POW29: [u32; 10] = [
2177    3437097245, 219578399, 3191687836, 3061529344, 4005823358, 3201416410, 694756510, 1988053185,
2178    463784885, 228681542,
2179];
2180
2181/// Pre-computed large power-of-29 for 64-bit limbs.
2182#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
2183pub const LARGE_POW29: [u64; 5] = [
2184    943082046050136349,
2185    13149168411416021660,
2186    13749978785833550718,
2187    8538623412978394270,
2188    982179744552635317,
2189];
2190
2191/// Step for large power-of-29 for 32-bit limbs.
2192pub const LARGE_POW29_STEP: u32 = 65;
2193
2194/// Pre-computed, small powers-of-30.
2195pub const SMALL_INT_POW30: [u64; 14] = [
2196    1,
2197    30,
2198    900,
2199    27000,
2200    810000,
2201    24300000,
2202    729000000,
2203    21870000000,
2204    656100000000,
2205    19683000000000,
2206    590490000000000,
2207    17714700000000000,
2208    531441000000000000,
2209    15943230000000000000,
2210];
2211const_assert!(SMALL_INT_POW30.len() > f64_mantissa_limit(30) as usize);
2212const_assert!(SMALL_INT_POW30.len() == u64_power_limit(30) as usize + 1);
2213
2214/// Pre-computed, small powers-of-30.
2215pub const SMALL_F32_POW30: [f32; 7] =
2216    [1.0, 30.0, 900.0, 27000.0, 810000.0, 24300000.0, 729000000.0];
2217const_assert!(SMALL_F32_POW30.len() > f32_exponent_limit(30).1 as usize);
2218
2219/// Pre-computed, small powers-of-30.
2220pub const SMALL_F64_POW30: [f64; 14] = [
2221    1.0,
2222    30.0,
2223    900.0,
2224    27000.0,
2225    810000.0,
2226    24300000.0,
2227    729000000.0,
2228    21870000000.0,
2229    656100000000.0,
2230    19683000000000.0,
2231    590490000000000.0,
2232    1.77147e+16,
2233    5.31441e+17,
2234    1.594323e+19,
2235];
2236const_assert!(SMALL_F64_POW30.len() > f64_exponent_limit(30).1 as usize);
2237
2238/// Pre-computed, small powers-of-31.
2239pub const SMALL_INT_POW31: [u64; 13] = [
2240    1,
2241    31,
2242    961,
2243    29791,
2244    923521,
2245    28629151,
2246    887503681,
2247    27512614111,
2248    852891037441,
2249    26439622160671,
2250    819628286980801,
2251    25408476896404831,
2252    787662783788549761,
2253];
2254const_assert!(SMALL_INT_POW31.len() > f64_mantissa_limit(31) as usize);
2255const_assert!(SMALL_INT_POW31.len() == u64_power_limit(31) as usize + 1);
2256
2257/// Pre-computed, small powers-of-31.
2258pub const SMALL_F32_POW31: [f32; 5] = [1.0, 31.0, 961.0, 29791.0, 923521.0];
2259const_assert!(SMALL_F32_POW31.len() > f32_exponent_limit(31).1 as usize);
2260
2261/// Pre-computed, small powers-of-31.
2262pub const SMALL_F64_POW31: [f64; 11] = [
2263    1.0,
2264    31.0,
2265    961.0,
2266    29791.0,
2267    923521.0,
2268    28629151.0,
2269    887503681.0,
2270    27512614111.0,
2271    852891037441.0,
2272    26439622160671.0,
2273    819628286980801.0,
2274];
2275const_assert!(SMALL_F64_POW31.len() > f64_exponent_limit(31).1 as usize);
2276
2277/// Pre-computed large power-of-31 for 32-bit limbs.
2278#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
2279pub const LARGE_POW31: [u32; 10] = [
2280    3128270977, 627186439, 3737223222, 1519964902, 4275419645, 1305227997, 3310009113, 99290790,
2281    2685019127, 609,
2282];
2283
2284/// Pre-computed large power-of-31 for 64-bit limbs.
2285#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
2286pub const LARGE_POW31: [u64; 5] = [
2287    2693745247127969921,
2288    6528199548895068214,
2289    5605911565214005757,
2290    426450699154012953,
2291    2618320102391,
2292];
2293
2294/// Step for large power-of-31 for 32-bit limbs.
2295pub const LARGE_POW31_STEP: u32 = 60;
2296
2297/// Pre-computed, small powers-of-33.
2298pub const SMALL_INT_POW33: [u64; 13] = [
2299    1,
2300    33,
2301    1089,
2302    35937,
2303    1185921,
2304    39135393,
2305    1291467969,
2306    42618442977,
2307    1406408618241,
2308    46411484401953,
2309    1531578985264449,
2310    50542106513726817,
2311    1667889514952984961,
2312];
2313const_assert!(SMALL_INT_POW33.len() > f64_mantissa_limit(33) as usize);
2314const_assert!(SMALL_INT_POW33.len() == u64_power_limit(33) as usize + 1);
2315
2316/// Pre-computed, small powers-of-33.
2317pub const SMALL_F32_POW33: [f32; 5] = [1.0, 33.0, 1089.0, 35937.0, 1185921.0];
2318const_assert!(SMALL_F32_POW33.len() > f32_exponent_limit(33).1 as usize);
2319
2320/// Pre-computed, small powers-of-33.
2321pub const SMALL_F64_POW33: [f64; 11] = [
2322    1.0,
2323    33.0,
2324    1089.0,
2325    35937.0,
2326    1185921.0,
2327    39135393.0,
2328    1291467969.0,
2329    42618442977.0,
2330    1406408618241.0,
2331    46411484401953.0,
2332    1531578985264449.0,
2333];
2334const_assert!(SMALL_F64_POW33.len() > f64_exponent_limit(33).1 as usize);
2335
2336/// Pre-computed large power-of-33 for 32-bit limbs.
2337#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
2338pub const LARGE_POW33: [u32; 10] = [
2339    1612820353, 1081423072, 127566253, 3291061608, 3338225311, 2497994496, 2486573331, 4032720849,
2340    2585834285, 25953,
2341];
2342
2343/// Pre-computed large power-of-33 for 64-bit limbs.
2344#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
2345pub const LARGE_POW33: [u64; 5] = [
2346    4644676728992673665,
2347    14135001975608738221,
2348    10728804669246228127,
2349    17320404162838927635,
2350    111469872067373,
2351];
2352
2353/// Step for large power-of-33 for 32-bit limbs.
2354pub const LARGE_POW33_STEP: u32 = 60;
2355
2356/// Pre-computed, small powers-of-34.
2357pub const SMALL_INT_POW34: [u64; 13] = [
2358    1,
2359    34,
2360    1156,
2361    39304,
2362    1336336,
2363    45435424,
2364    1544804416,
2365    52523350144,
2366    1785793904896,
2367    60716992766464,
2368    2064377754059776,
2369    70188843638032384,
2370    2386420683693101056,
2371];
2372const_assert!(SMALL_INT_POW34.len() > f64_mantissa_limit(34) as usize);
2373const_assert!(SMALL_INT_POW34.len() == u64_power_limit(34) as usize + 1);
2374
2375/// Pre-computed, small powers-of-34.
2376pub const SMALL_F32_POW34: [f32; 6] = [1.0, 34.0, 1156.0, 39304.0, 1336336.0, 45435424.0];
2377const_assert!(SMALL_F32_POW34.len() > f32_exponent_limit(34).1 as usize);
2378
2379/// Pre-computed, small powers-of-34.
2380pub const SMALL_F64_POW34: [f64; 13] = [
2381    1.0,
2382    34.0,
2383    1156.0,
2384    39304.0,
2385    1336336.0,
2386    45435424.0,
2387    1544804416.0,
2388    52523350144.0,
2389    1785793904896.0,
2390    60716992766464.0,
2391    2064377754059776.0,
2392    7.018884363803238e+16,
2393    2.386420683693101e+18,
2394];
2395const_assert!(SMALL_F64_POW34.len() > f64_exponent_limit(34).1 as usize);
2396
2397/// Pre-computed, small powers-of-35.
2398pub const SMALL_INT_POW35: [u64; 13] = [
2399    1,
2400    35,
2401    1225,
2402    42875,
2403    1500625,
2404    52521875,
2405    1838265625,
2406    64339296875,
2407    2251875390625,
2408    78815638671875,
2409    2758547353515625,
2410    96549157373046875,
2411    3379220508056640625,
2412];
2413const_assert!(SMALL_INT_POW35.len() > f64_mantissa_limit(35) as usize);
2414const_assert!(SMALL_INT_POW35.len() == u64_power_limit(35) as usize + 1);
2415
2416/// Pre-computed, small powers-of-35.
2417pub const SMALL_F32_POW35: [f32; 5] = [1.0, 35.0, 1225.0, 42875.0, 1500625.0];
2418const_assert!(SMALL_F32_POW35.len() > f32_exponent_limit(35).1 as usize);
2419
2420/// Pre-computed, small powers-of-35.
2421pub const SMALL_F64_POW35: [f64; 11] = [
2422    1.0,
2423    35.0,
2424    1225.0,
2425    42875.0,
2426    1500625.0,
2427    52521875.0,
2428    1838265625.0,
2429    64339296875.0,
2430    2251875390625.0,
2431    78815638671875.0,
2432    2758547353515625.0,
2433];
2434const_assert!(SMALL_F64_POW35.len() > f64_exponent_limit(35).1 as usize);
2435
2436/// Pre-computed large power-of-35 for 32-bit limbs.
2437#[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
2438pub const LARGE_POW35: [u32; 10] = [
2439    2481068081, 3589182317, 2073348182, 2214889340, 548239849, 1614245998, 4081052795, 291764764,
2440    3369344364, 886020,
2441];
2442
2443/// Pre-computed large power-of-35 for 64-bit limbs.
2444#[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
2445pub const LARGE_POW35: [u64; 5] = [
2446    15415420673377572913,
2447    9512877281632372822,
2448    6933133769657121257,
2449    1253120123586210939,
2450    3805430292946284,
2451];
2452
2453/// Step for large power-of-35 for 32-bit limbs.
2454pub const LARGE_POW35_STEP: u32 = 60;
2455
2456/// Pre-computed, small powers-of-36.
2457pub const SMALL_INT_POW36: [u64; 13] = [
2458    1,
2459    36,
2460    1296,
2461    46656,
2462    1679616,
2463    60466176,
2464    2176782336,
2465    78364164096,
2466    2821109907456,
2467    101559956668416,
2468    3656158440062976,
2469    131621703842267136,
2470    4738381338321616896,
2471];
2472const_assert!(SMALL_INT_POW36.len() > f64_mantissa_limit(36) as usize);
2473const_assert!(SMALL_INT_POW36.len() == u64_power_limit(36) as usize + 1);
2474
2475/// Pre-computed, small powers-of-36.
2476pub const SMALL_F32_POW36: [f32; 8] =
2477    [1.0, 36.0, 1296.0, 46656.0, 1679616.0, 60466176.0, 2176782336.0, 78364164096.0];
2478const_assert!(SMALL_F32_POW36.len() > f32_exponent_limit(36).1 as usize);
2479
2480/// Pre-computed, small powers-of-36.
2481pub const SMALL_F64_POW36: [f64; 17] = [
2482    1.0,
2483    36.0,
2484    1296.0,
2485    46656.0,
2486    1679616.0,
2487    60466176.0,
2488    2176782336.0,
2489    78364164096.0,
2490    2821109907456.0,
2491    101559956668416.0,
2492    3656158440062976.0,
2493    1.3162170384226714e+17,
2494    4.738381338321617e+18,
2495    1.705817281795782e+20,
2496    6.140942214464815e+21,
2497    2.2107391972073336e+23,
2498    7.958661109946401e+24,
2499];
2500const_assert!(SMALL_F64_POW36.len() > f64_exponent_limit(36).1 as usize);