Coverage Report

Created: 2026-04-29 06:53

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/lexical-util-1.0.7/src/step.rs
Line
Count
Source
1
//! The maximum digits that can be held in a u64 for a given radix without
2
//! overflowing.
3
//!
4
//! This is useful for 128-bit division and operations, since it can
5
//! reduces the number of inefficient, non-native operations.
6
//!
7
//! # Generation
8
//!
9
//! See [`etc/step.py`] for the script to generate the divisors and the
10
//! constants, and the division algorithm.
11
//!
12
//! [`etc/step.py`]: https://github.com/Alexhuszagh/rust-lexical/blob/main/lexical-util/etc/step.py
13
14
#![cfg(any(
15
    feature = "parse-floats",
16
    feature = "parse-integers",
17
    feature = "write-floats",
18
    feature = "write-integers",
19
))]
20
21
// NOTE:
22
//  Fallback radixes use 1 for the value to avoid infinite loops,
23
//  but allowing them in `const fn`.
24
25
/// Get the number of digits that can be always processed without overflowing.
26
///
27
/// Calculate the number of digits that can always be processed without
28
/// overflowing for a given type, that is, it can process every (positive) value
29
/// in the range `[0, radix^N)` where `N` is the number of digits.
30
///
31
/// For example, with [`u8`] with radix `10`, we have a maximum value of `255`,
32
/// so we have a min step of `2`: that is, we can always process values from
33
/// `[0, 10^2)` (or `[0, 100)`).
34
#[inline(always)]
35
#[allow(clippy::needless_return)] // reason="required depending on our radix configuration"
36
5.30k
pub const fn min_step(radix: u32, bits: usize, is_signed: bool) -> usize {
37
    // NOTE: to avoid branching when w don't need it, we use the compile logic
38
39
    #[cfg(feature = "radix")]
40
    {
41
        return match radix {
42
            2 => min_step_2(bits, is_signed),
43
            3 => min_step_3(bits, is_signed),
44
            4 => min_step_4(bits, is_signed),
45
            5 => min_step_5(bits, is_signed),
46
            6 => min_step_6(bits, is_signed),
47
            7 => min_step_7(bits, is_signed),
48
            8 => min_step_8(bits, is_signed),
49
            9 => min_step_9(bits, is_signed),
50
            10 => min_step_10(bits, is_signed),
51
            11 => min_step_11(bits, is_signed),
52
            12 => min_step_12(bits, is_signed),
53
            13 => min_step_13(bits, is_signed),
54
            14 => min_step_14(bits, is_signed),
55
            15 => min_step_15(bits, is_signed),
56
            16 => min_step_16(bits, is_signed),
57
            17 => min_step_17(bits, is_signed),
58
            18 => min_step_18(bits, is_signed),
59
            19 => min_step_19(bits, is_signed),
60
            20 => min_step_20(bits, is_signed),
61
            21 => min_step_21(bits, is_signed),
62
            22 => min_step_22(bits, is_signed),
63
            23 => min_step_23(bits, is_signed),
64
            24 => min_step_24(bits, is_signed),
65
            25 => min_step_25(bits, is_signed),
66
            26 => min_step_26(bits, is_signed),
67
            27 => min_step_27(bits, is_signed),
68
            28 => min_step_28(bits, is_signed),
69
            29 => min_step_29(bits, is_signed),
70
            30 => min_step_30(bits, is_signed),
71
            31 => min_step_31(bits, is_signed),
72
            32 => min_step_32(bits, is_signed),
73
            33 => min_step_33(bits, is_signed),
74
            34 => min_step_34(bits, is_signed),
75
            35 => min_step_35(bits, is_signed),
76
            36 => min_step_36(bits, is_signed),
77
            _ => 1,
78
        };
79
    }
80
81
    #[cfg(all(feature = "power-of-two", not(feature = "radix")))]
82
    {
83
        return match radix {
84
            2 => min_step_2(bits, is_signed),
85
            4 => min_step_4(bits, is_signed),
86
            8 => min_step_8(bits, is_signed),
87
            10 => min_step_10(bits, is_signed),
88
            16 => min_step_16(bits, is_signed),
89
            32 => min_step_32(bits, is_signed),
90
            _ => 1,
91
        };
92
    }
93
94
    #[cfg(not(feature = "power-of-two"))]
95
    {
96
5.30k
        _ = radix;
97
5.30k
        return min_step_10(bits, is_signed);
98
    }
99
5.30k
}
100
101
/// Get the maximum number of digits that can be processed without overflowing.
102
///
103
/// Calculate the number of digits that can be processed without overflowing for
104
/// a given type, that is, it can process at least `radix^N`. This does not
105
/// necessarily mean it can process every value in the range `[0, radix^(N+1))`.
106
///
107
/// For example, with [`u8`] with radix `10`, we have a maximum value of `255`,
108
/// so we have a max step of `3`: that is, it can process up to 3 digits (`[100,
109
/// 256)`), even if it **cannot** process every 3 digit value (`[256, 1000)`).
110
#[inline(always)]
111
#[allow(clippy::needless_return)] // reason="required depending on our radix configuration"
112
0
pub const fn max_step(radix: u32, bits: usize, is_signed: bool) -> usize {
113
    #[cfg(feature = "radix")]
114
    {
115
        return match radix {
116
            2 => max_step_2(bits, is_signed),
117
            3 => max_step_3(bits, is_signed),
118
            4 => max_step_4(bits, is_signed),
119
            5 => max_step_5(bits, is_signed),
120
            6 => max_step_6(bits, is_signed),
121
            7 => max_step_7(bits, is_signed),
122
            8 => max_step_8(bits, is_signed),
123
            9 => max_step_9(bits, is_signed),
124
            10 => max_step_10(bits, is_signed),
125
            11 => max_step_11(bits, is_signed),
126
            12 => max_step_12(bits, is_signed),
127
            13 => max_step_13(bits, is_signed),
128
            14 => max_step_14(bits, is_signed),
129
            15 => max_step_15(bits, is_signed),
130
            16 => max_step_16(bits, is_signed),
131
            17 => max_step_17(bits, is_signed),
132
            18 => max_step_18(bits, is_signed),
133
            19 => max_step_19(bits, is_signed),
134
            20 => max_step_20(bits, is_signed),
135
            21 => max_step_21(bits, is_signed),
136
            22 => max_step_22(bits, is_signed),
137
            23 => max_step_23(bits, is_signed),
138
            24 => max_step_24(bits, is_signed),
139
            25 => max_step_25(bits, is_signed),
140
            26 => max_step_26(bits, is_signed),
141
            27 => max_step_27(bits, is_signed),
142
            28 => max_step_28(bits, is_signed),
143
            29 => max_step_29(bits, is_signed),
144
            30 => max_step_30(bits, is_signed),
145
            31 => max_step_31(bits, is_signed),
146
            32 => max_step_32(bits, is_signed),
147
            33 => max_step_33(bits, is_signed),
148
            34 => max_step_34(bits, is_signed),
149
            35 => max_step_35(bits, is_signed),
150
            36 => max_step_36(bits, is_signed),
151
            _ => 1,
152
        };
153
    }
154
155
    #[cfg(all(feature = "power-of-two", not(feature = "radix")))]
156
    {
157
        return match radix {
158
            2 => max_step_2(bits, is_signed),
159
            4 => max_step_4(bits, is_signed),
160
            8 => max_step_8(bits, is_signed),
161
            10 => max_step_10(bits, is_signed),
162
            16 => max_step_16(bits, is_signed),
163
            32 => max_step_32(bits, is_signed),
164
            _ => 1,
165
        };
166
    }
167
168
    #[cfg(not(feature = "power-of-two"))]
169
    {
170
0
        _ = radix;
171
0
        return max_step_10(bits, is_signed);
172
    }
173
0
}
174
175
/// Calculate the number of digits that can be processed without overflowing a
176
/// [`u64`]. Helper function since this is used for 128-bit division.
177
///
178
/// This is an alias for [`min_step`] with `bits == 64` and `is_signed ==
179
/// false`.
180
5.30k
pub const fn u64_step(radix: u32) -> usize {
181
5.30k
    min_step(radix, 64, false)
182
5.30k
}
183
184
// AUTO-GENERATED
185
// These functions were auto-generated by `etc/step.py`.
186
// Do not edit them unless there is a good reason to.
187
// Preferably, edit the source code to generate the constants.
188
//
189
// NOTE: For the fallthrough value for types (in case of adding short
190
// or wider type support in the future), use 1 so it doesn't infinitely
191
// recurse. Under normal circumstances, this will never be called.
192
193
#[inline(always)]
194
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
195
0
const fn max_step_2(bits: usize, is_signed: bool) -> usize {
196
0
    match bits {
197
0
        8 if is_signed => 7,
198
0
        8 if !is_signed => 8,
199
0
        16 if is_signed => 15,
200
0
        16 if !is_signed => 16,
201
0
        32 if is_signed => 31,
202
0
        32 if !is_signed => 32,
203
0
        64 if is_signed => 63,
204
0
        64 if !is_signed => 64,
205
0
        128 if is_signed => 127,
206
0
        128 if !is_signed => 128,
207
0
        _ => 1,
208
    }
209
0
}
210
211
#[inline(always)]
212
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
213
0
const fn min_step_2(bits: usize, is_signed: bool) -> usize {
214
0
    match bits {
215
0
        8 if is_signed => 7,
216
0
        8 if !is_signed => 8,
217
0
        16 if is_signed => 15,
218
0
        16 if !is_signed => 16,
219
0
        32 if is_signed => 31,
220
0
        32 if !is_signed => 32,
221
0
        64 if is_signed => 63,
222
0
        64 if !is_signed => 64,
223
0
        128 if is_signed => 127,
224
0
        128 if !is_signed => 128,
225
0
        _ => 1,
226
    }
227
0
}
228
229
#[inline(always)]
230
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
231
0
const fn max_step_3(bits: usize, is_signed: bool) -> usize {
232
0
    match bits {
233
0
        8 if is_signed => 5,
234
0
        8 if !is_signed => 6,
235
0
        16 if is_signed => 10,
236
0
        16 if !is_signed => 11,
237
0
        32 if is_signed => 20,
238
0
        32 if !is_signed => 21,
239
0
        64 if is_signed => 40,
240
0
        64 if !is_signed => 41,
241
0
        128 if is_signed => 81,
242
0
        128 if !is_signed => 81,
243
0
        _ => 1,
244
    }
245
0
}
246
247
#[inline(always)]
248
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
249
0
const fn min_step_3(bits: usize, is_signed: bool) -> usize {
250
0
    match bits {
251
0
        8 if is_signed => 4,
252
0
        8 if !is_signed => 5,
253
0
        16 if is_signed => 9,
254
0
        16 if !is_signed => 10,
255
0
        32 if is_signed => 19,
256
0
        32 if !is_signed => 20,
257
0
        64 if is_signed => 39,
258
0
        64 if !is_signed => 40,
259
0
        128 if is_signed => 80,
260
0
        128 if !is_signed => 80,
261
0
        _ => 1,
262
    }
263
0
}
264
265
#[inline(always)]
266
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
267
0
const fn max_step_4(bits: usize, is_signed: bool) -> usize {
268
0
    match bits {
269
0
        8 if is_signed => 4,
270
0
        8 if !is_signed => 4,
271
0
        16 if is_signed => 8,
272
0
        16 if !is_signed => 8,
273
0
        32 if is_signed => 16,
274
0
        32 if !is_signed => 16,
275
0
        64 if is_signed => 32,
276
0
        64 if !is_signed => 32,
277
0
        128 if is_signed => 64,
278
0
        128 if !is_signed => 64,
279
0
        _ => 1,
280
    }
281
0
}
282
283
#[inline(always)]
284
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
285
0
const fn min_step_4(bits: usize, is_signed: bool) -> usize {
286
0
    match bits {
287
0
        8 if is_signed => 3,
288
0
        8 if !is_signed => 4,
289
0
        16 if is_signed => 7,
290
0
        16 if !is_signed => 8,
291
0
        32 if is_signed => 15,
292
0
        32 if !is_signed => 16,
293
0
        64 if is_signed => 31,
294
0
        64 if !is_signed => 32,
295
0
        128 if is_signed => 63,
296
0
        128 if !is_signed => 64,
297
0
        _ => 1,
298
    }
299
0
}
300
301
#[inline(always)]
302
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
303
0
const fn max_step_5(bits: usize, is_signed: bool) -> usize {
304
0
    match bits {
305
0
        8 if is_signed => 4,
306
0
        8 if !is_signed => 4,
307
0
        16 if is_signed => 7,
308
0
        16 if !is_signed => 7,
309
0
        32 if is_signed => 14,
310
0
        32 if !is_signed => 14,
311
0
        64 if is_signed => 28,
312
0
        64 if !is_signed => 28,
313
0
        128 if is_signed => 55,
314
0
        128 if !is_signed => 56,
315
0
        _ => 1,
316
    }
317
0
}
318
319
#[inline(always)]
320
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
321
0
const fn min_step_5(bits: usize, is_signed: bool) -> usize {
322
0
    match bits {
323
0
        8 if is_signed => 3,
324
0
        8 if !is_signed => 3,
325
0
        16 if is_signed => 6,
326
0
        16 if !is_signed => 6,
327
0
        32 if is_signed => 13,
328
0
        32 if !is_signed => 13,
329
0
        64 if is_signed => 27,
330
0
        64 if !is_signed => 27,
331
0
        128 if is_signed => 54,
332
0
        128 if !is_signed => 55,
333
0
        _ => 1,
334
    }
335
0
}
336
337
#[inline(always)]
338
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
339
0
const fn max_step_6(bits: usize, is_signed: bool) -> usize {
340
0
    match bits {
341
0
        8 if is_signed => 3,
342
0
        8 if !is_signed => 4,
343
0
        16 if is_signed => 6,
344
0
        16 if !is_signed => 7,
345
0
        32 if is_signed => 12,
346
0
        32 if !is_signed => 13,
347
0
        64 if is_signed => 25,
348
0
        64 if !is_signed => 25,
349
0
        128 if is_signed => 50,
350
0
        128 if !is_signed => 50,
351
0
        _ => 1,
352
    }
353
0
}
354
355
#[inline(always)]
356
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
357
0
const fn min_step_6(bits: usize, is_signed: bool) -> usize {
358
0
    match bits {
359
0
        8 if is_signed => 2,
360
0
        8 if !is_signed => 3,
361
0
        16 if is_signed => 5,
362
0
        16 if !is_signed => 6,
363
0
        32 if is_signed => 11,
364
0
        32 if !is_signed => 12,
365
0
        64 if is_signed => 24,
366
0
        64 if !is_signed => 24,
367
0
        128 if is_signed => 49,
368
0
        128 if !is_signed => 49,
369
0
        _ => 1,
370
    }
371
0
}
372
373
#[inline(always)]
374
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
375
0
const fn max_step_7(bits: usize, is_signed: bool) -> usize {
376
0
    match bits {
377
0
        8 if is_signed => 3,
378
0
        8 if !is_signed => 3,
379
0
        16 if is_signed => 6,
380
0
        16 if !is_signed => 6,
381
0
        32 if is_signed => 12,
382
0
        32 if !is_signed => 12,
383
0
        64 if is_signed => 23,
384
0
        64 if !is_signed => 23,
385
0
        128 if is_signed => 46,
386
0
        128 if !is_signed => 46,
387
0
        _ => 1,
388
    }
389
0
}
390
391
#[inline(always)]
392
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
393
0
const fn min_step_7(bits: usize, is_signed: bool) -> usize {
394
0
    match bits {
395
0
        8 if is_signed => 2,
396
0
        8 if !is_signed => 2,
397
0
        16 if is_signed => 5,
398
0
        16 if !is_signed => 5,
399
0
        32 if is_signed => 11,
400
0
        32 if !is_signed => 11,
401
0
        64 if is_signed => 22,
402
0
        64 if !is_signed => 22,
403
0
        128 if is_signed => 45,
404
0
        128 if !is_signed => 45,
405
0
        _ => 1,
406
    }
407
0
}
408
409
#[inline(always)]
410
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
411
0
const fn max_step_8(bits: usize, is_signed: bool) -> usize {
412
0
    match bits {
413
0
        8 if is_signed => 3,
414
0
        8 if !is_signed => 3,
415
0
        16 if is_signed => 5,
416
0
        16 if !is_signed => 6,
417
0
        32 if is_signed => 11,
418
0
        32 if !is_signed => 11,
419
0
        64 if is_signed => 21,
420
0
        64 if !is_signed => 22,
421
0
        128 if is_signed => 43,
422
0
        128 if !is_signed => 43,
423
0
        _ => 1,
424
    }
425
0
}
426
427
#[inline(always)]
428
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
429
0
const fn min_step_8(bits: usize, is_signed: bool) -> usize {
430
0
    match bits {
431
0
        8 if is_signed => 2,
432
0
        8 if !is_signed => 2,
433
0
        16 if is_signed => 5,
434
0
        16 if !is_signed => 5,
435
0
        32 if is_signed => 10,
436
0
        32 if !is_signed => 10,
437
0
        64 if is_signed => 21,
438
0
        64 if !is_signed => 21,
439
0
        128 if is_signed => 42,
440
0
        128 if !is_signed => 42,
441
0
        _ => 1,
442
    }
443
0
}
444
445
#[inline(always)]
446
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
447
0
const fn max_step_9(bits: usize, is_signed: bool) -> usize {
448
0
    match bits {
449
0
        8 if is_signed => 3,
450
0
        8 if !is_signed => 3,
451
0
        16 if is_signed => 5,
452
0
        16 if !is_signed => 6,
453
0
        32 if is_signed => 10,
454
0
        32 if !is_signed => 11,
455
0
        64 if is_signed => 20,
456
0
        64 if !is_signed => 21,
457
0
        128 if is_signed => 41,
458
0
        128 if !is_signed => 41,
459
0
        _ => 1,
460
    }
461
0
}
462
463
#[inline(always)]
464
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
465
0
const fn min_step_9(bits: usize, is_signed: bool) -> usize {
466
0
    match bits {
467
0
        8 if is_signed => 2,
468
0
        8 if !is_signed => 2,
469
0
        16 if is_signed => 4,
470
0
        16 if !is_signed => 5,
471
0
        32 if is_signed => 9,
472
0
        32 if !is_signed => 10,
473
0
        64 if is_signed => 19,
474
0
        64 if !is_signed => 20,
475
0
        128 if is_signed => 40,
476
0
        128 if !is_signed => 40,
477
0
        _ => 1,
478
    }
479
0
}
480
481
#[inline(always)]
482
0
const fn max_step_10(bits: usize, is_signed: bool) -> usize {
483
0
    match bits {
484
0
        8 if is_signed => 3,
485
0
        8 if !is_signed => 3,
486
0
        16 if is_signed => 5,
487
0
        16 if !is_signed => 5,
488
0
        32 if is_signed => 10,
489
0
        32 if !is_signed => 10,
490
0
        64 if is_signed => 19,
491
0
        64 if !is_signed => 20,
492
0
        128 if is_signed => 39,
493
0
        128 if !is_signed => 39,
494
0
        _ => 1,
495
    }
496
0
}
497
498
#[inline(always)]
499
5.30k
const fn min_step_10(bits: usize, is_signed: bool) -> usize {
500
0
    match bits {
501
0
        8 if is_signed => 2,
502
0
        8 if !is_signed => 2,
503
0
        16 if is_signed => 4,
504
0
        16 if !is_signed => 4,
505
0
        32 if is_signed => 9,
506
0
        32 if !is_signed => 9,
507
0
        64 if is_signed => 18,
508
5.30k
        64 if !is_signed => 19,
509
0
        128 if is_signed => 38,
510
0
        128 if !is_signed => 38,
511
0
        _ => 1,
512
    }
513
5.30k
}
514
515
#[inline(always)]
516
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
517
0
const fn max_step_11(bits: usize, is_signed: bool) -> usize {
518
0
    match bits {
519
0
        8 if is_signed => 3,
520
0
        8 if !is_signed => 3,
521
0
        16 if is_signed => 5,
522
0
        16 if !is_signed => 5,
523
0
        32 if is_signed => 9,
524
0
        32 if !is_signed => 10,
525
0
        64 if is_signed => 19,
526
0
        64 if !is_signed => 19,
527
0
        128 if is_signed => 37,
528
0
        128 if !is_signed => 38,
529
0
        _ => 1,
530
    }
531
0
}
532
533
#[inline(always)]
534
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
535
0
const fn min_step_11(bits: usize, is_signed: bool) -> usize {
536
0
    match bits {
537
0
        8 if is_signed => 2,
538
0
        8 if !is_signed => 2,
539
0
        16 if is_signed => 4,
540
0
        16 if !is_signed => 4,
541
0
        32 if is_signed => 8,
542
0
        32 if !is_signed => 9,
543
0
        64 if is_signed => 18,
544
0
        64 if !is_signed => 18,
545
0
        128 if is_signed => 36,
546
0
        128 if !is_signed => 37,
547
0
        _ => 1,
548
    }
549
0
}
550
551
#[inline(always)]
552
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
553
0
const fn max_step_12(bits: usize, is_signed: bool) -> usize {
554
0
    match bits {
555
0
        8 if is_signed => 2,
556
0
        8 if !is_signed => 3,
557
0
        16 if is_signed => 5,
558
0
        16 if !is_signed => 5,
559
0
        32 if is_signed => 9,
560
0
        32 if !is_signed => 9,
561
0
        64 if is_signed => 18,
562
0
        64 if !is_signed => 18,
563
0
        128 if is_signed => 36,
564
0
        128 if !is_signed => 36,
565
0
        _ => 1,
566
    }
567
0
}
568
569
#[inline(always)]
570
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
571
0
const fn min_step_12(bits: usize, is_signed: bool) -> usize {
572
0
    match bits {
573
0
        8 if is_signed => 1,
574
0
        8 if !is_signed => 2,
575
0
        16 if is_signed => 4,
576
0
        16 if !is_signed => 4,
577
0
        32 if is_signed => 8,
578
0
        32 if !is_signed => 8,
579
0
        64 if is_signed => 17,
580
0
        64 if !is_signed => 17,
581
0
        128 if is_signed => 35,
582
0
        128 if !is_signed => 35,
583
0
        _ => 1,
584
    }
585
0
}
586
587
#[inline(always)]
588
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
589
0
const fn max_step_13(bits: usize, is_signed: bool) -> usize {
590
0
    match bits {
591
0
        8 if is_signed => 2,
592
0
        8 if !is_signed => 3,
593
0
        16 if is_signed => 5,
594
0
        16 if !is_signed => 5,
595
0
        32 if is_signed => 9,
596
0
        32 if !is_signed => 9,
597
0
        64 if is_signed => 18,
598
0
        64 if !is_signed => 18,
599
0
        128 if is_signed => 35,
600
0
        128 if !is_signed => 35,
601
0
        _ => 1,
602
    }
603
0
}
604
605
#[inline(always)]
606
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
607
0
const fn min_step_13(bits: usize, is_signed: bool) -> usize {
608
0
    match bits {
609
0
        8 if is_signed => 1,
610
0
        8 if !is_signed => 2,
611
0
        16 if is_signed => 4,
612
0
        16 if !is_signed => 4,
613
0
        32 if is_signed => 8,
614
0
        32 if !is_signed => 8,
615
0
        64 if is_signed => 17,
616
0
        64 if !is_signed => 17,
617
0
        128 if is_signed => 34,
618
0
        128 if !is_signed => 34,
619
0
        _ => 1,
620
    }
621
0
}
622
623
#[inline(always)]
624
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
625
0
const fn max_step_14(bits: usize, is_signed: bool) -> usize {
626
0
    match bits {
627
0
        8 if is_signed => 2,
628
0
        8 if !is_signed => 3,
629
0
        16 if is_signed => 4,
630
0
        16 if !is_signed => 5,
631
0
        32 if is_signed => 9,
632
0
        32 if !is_signed => 9,
633
0
        64 if is_signed => 17,
634
0
        64 if !is_signed => 17,
635
0
        128 if is_signed => 34,
636
0
        128 if !is_signed => 34,
637
0
        _ => 1,
638
    }
639
0
}
640
641
#[inline(always)]
642
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
643
0
const fn min_step_14(bits: usize, is_signed: bool) -> usize {
644
0
    match bits {
645
0
        8 if is_signed => 1,
646
0
        8 if !is_signed => 2,
647
0
        16 if is_signed => 3,
648
0
        16 if !is_signed => 4,
649
0
        32 if is_signed => 8,
650
0
        32 if !is_signed => 8,
651
0
        64 if is_signed => 16,
652
0
        64 if !is_signed => 16,
653
0
        128 if is_signed => 33,
654
0
        128 if !is_signed => 33,
655
0
        _ => 1,
656
    }
657
0
}
658
659
#[inline(always)]
660
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
661
0
const fn max_step_15(bits: usize, is_signed: bool) -> usize {
662
0
    match bits {
663
0
        8 if is_signed => 2,
664
0
        8 if !is_signed => 3,
665
0
        16 if is_signed => 4,
666
0
        16 if !is_signed => 5,
667
0
        32 if is_signed => 8,
668
0
        32 if !is_signed => 9,
669
0
        64 if is_signed => 17,
670
0
        64 if !is_signed => 17,
671
0
        128 if is_signed => 33,
672
0
        128 if !is_signed => 33,
673
0
        _ => 1,
674
    }
675
0
}
676
677
#[inline(always)]
678
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
679
0
const fn min_step_15(bits: usize, is_signed: bool) -> usize {
680
0
    match bits {
681
0
        8 if is_signed => 1,
682
0
        8 if !is_signed => 2,
683
0
        16 if is_signed => 3,
684
0
        16 if !is_signed => 4,
685
0
        32 if is_signed => 7,
686
0
        32 if !is_signed => 8,
687
0
        64 if is_signed => 16,
688
0
        64 if !is_signed => 16,
689
0
        128 if is_signed => 32,
690
0
        128 if !is_signed => 32,
691
0
        _ => 1,
692
    }
693
0
}
694
695
#[inline(always)]
696
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
697
0
const fn max_step_16(bits: usize, is_signed: bool) -> usize {
698
0
    match bits {
699
0
        8 if is_signed => 2,
700
0
        8 if !is_signed => 2,
701
0
        16 if is_signed => 4,
702
0
        16 if !is_signed => 4,
703
0
        32 if is_signed => 8,
704
0
        32 if !is_signed => 8,
705
0
        64 if is_signed => 16,
706
0
        64 if !is_signed => 16,
707
0
        128 if is_signed => 32,
708
0
        128 if !is_signed => 32,
709
0
        _ => 1,
710
    }
711
0
}
712
713
#[inline(always)]
714
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
715
0
const fn min_step_16(bits: usize, is_signed: bool) -> usize {
716
0
    match bits {
717
0
        8 if is_signed => 1,
718
0
        8 if !is_signed => 2,
719
0
        16 if is_signed => 3,
720
0
        16 if !is_signed => 4,
721
0
        32 if is_signed => 7,
722
0
        32 if !is_signed => 8,
723
0
        64 if is_signed => 15,
724
0
        64 if !is_signed => 16,
725
0
        128 if is_signed => 31,
726
0
        128 if !is_signed => 32,
727
0
        _ => 1,
728
    }
729
0
}
730
731
#[inline(always)]
732
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
733
0
const fn max_step_17(bits: usize, is_signed: bool) -> usize {
734
0
    match bits {
735
0
        8 if is_signed => 2,
736
0
        8 if !is_signed => 2,
737
0
        16 if is_signed => 4,
738
0
        16 if !is_signed => 4,
739
0
        32 if is_signed => 8,
740
0
        32 if !is_signed => 8,
741
0
        64 if is_signed => 16,
742
0
        64 if !is_signed => 16,
743
0
        128 if is_signed => 32,
744
0
        128 if !is_signed => 32,
745
0
        _ => 1,
746
    }
747
0
}
748
749
#[inline(always)]
750
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
751
0
const fn min_step_17(bits: usize, is_signed: bool) -> usize {
752
0
    match bits {
753
0
        8 if is_signed => 1,
754
0
        8 if !is_signed => 1,
755
0
        16 if is_signed => 3,
756
0
        16 if !is_signed => 3,
757
0
        32 if is_signed => 7,
758
0
        32 if !is_signed => 7,
759
0
        64 if is_signed => 15,
760
0
        64 if !is_signed => 15,
761
0
        128 if is_signed => 31,
762
0
        128 if !is_signed => 31,
763
0
        _ => 1,
764
    }
765
0
}
766
767
#[inline(always)]
768
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
769
0
const fn max_step_18(bits: usize, is_signed: bool) -> usize {
770
0
    match bits {
771
0
        8 if is_signed => 2,
772
0
        8 if !is_signed => 2,
773
0
        16 if is_signed => 4,
774
0
        16 if !is_signed => 4,
775
0
        32 if is_signed => 8,
776
0
        32 if !is_signed => 8,
777
0
        64 if is_signed => 16,
778
0
        64 if !is_signed => 16,
779
0
        128 if is_signed => 31,
780
0
        128 if !is_signed => 31,
781
0
        _ => 1,
782
    }
783
0
}
784
785
#[inline(always)]
786
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
787
0
const fn min_step_18(bits: usize, is_signed: bool) -> usize {
788
0
    match bits {
789
0
        8 if is_signed => 1,
790
0
        8 if !is_signed => 1,
791
0
        16 if is_signed => 3,
792
0
        16 if !is_signed => 3,
793
0
        32 if is_signed => 7,
794
0
        32 if !is_signed => 7,
795
0
        64 if is_signed => 15,
796
0
        64 if !is_signed => 15,
797
0
        128 if is_signed => 30,
798
0
        128 if !is_signed => 30,
799
0
        _ => 1,
800
    }
801
0
}
802
803
#[inline(always)]
804
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
805
0
const fn max_step_19(bits: usize, is_signed: bool) -> usize {
806
0
    match bits {
807
0
        8 if is_signed => 2,
808
0
        8 if !is_signed => 2,
809
0
        16 if is_signed => 4,
810
0
        16 if !is_signed => 4,
811
0
        32 if is_signed => 8,
812
0
        32 if !is_signed => 8,
813
0
        64 if is_signed => 15,
814
0
        64 if !is_signed => 16,
815
0
        128 if is_signed => 30,
816
0
        128 if !is_signed => 31,
817
0
        _ => 1,
818
    }
819
0
}
820
821
#[inline(always)]
822
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
823
0
const fn min_step_19(bits: usize, is_signed: bool) -> usize {
824
0
    match bits {
825
0
        8 if is_signed => 1,
826
0
        8 if !is_signed => 1,
827
0
        16 if is_signed => 3,
828
0
        16 if !is_signed => 3,
829
0
        32 if is_signed => 7,
830
0
        32 if !is_signed => 7,
831
0
        64 if is_signed => 14,
832
0
        64 if !is_signed => 15,
833
0
        128 if is_signed => 29,
834
0
        128 if !is_signed => 30,
835
0
        _ => 1,
836
    }
837
0
}
838
839
#[inline(always)]
840
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
841
0
const fn max_step_20(bits: usize, is_signed: bool) -> usize {
842
0
    match bits {
843
0
        8 if is_signed => 2,
844
0
        8 if !is_signed => 2,
845
0
        16 if is_signed => 4,
846
0
        16 if !is_signed => 4,
847
0
        32 if is_signed => 8,
848
0
        32 if !is_signed => 8,
849
0
        64 if is_signed => 15,
850
0
        64 if !is_signed => 15,
851
0
        128 if is_signed => 30,
852
0
        128 if !is_signed => 30,
853
0
        _ => 1,
854
    }
855
0
}
856
857
#[inline(always)]
858
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
859
0
const fn min_step_20(bits: usize, is_signed: bool) -> usize {
860
0
    match bits {
861
0
        8 if is_signed => 1,
862
0
        8 if !is_signed => 1,
863
0
        16 if is_signed => 3,
864
0
        16 if !is_signed => 3,
865
0
        32 if is_signed => 7,
866
0
        32 if !is_signed => 7,
867
0
        64 if is_signed => 14,
868
0
        64 if !is_signed => 14,
869
0
        128 if is_signed => 29,
870
0
        128 if !is_signed => 29,
871
0
        _ => 1,
872
    }
873
0
}
874
875
#[inline(always)]
876
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
877
0
const fn max_step_21(bits: usize, is_signed: bool) -> usize {
878
0
    match bits {
879
0
        8 if is_signed => 2,
880
0
        8 if !is_signed => 2,
881
0
        16 if is_signed => 4,
882
0
        16 if !is_signed => 4,
883
0
        32 if is_signed => 8,
884
0
        32 if !is_signed => 8,
885
0
        64 if is_signed => 15,
886
0
        64 if !is_signed => 15,
887
0
        128 if is_signed => 29,
888
0
        128 if !is_signed => 30,
889
0
        _ => 1,
890
    }
891
0
}
892
893
#[inline(always)]
894
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
895
0
const fn min_step_21(bits: usize, is_signed: bool) -> usize {
896
0
    match bits {
897
0
        8 if is_signed => 1,
898
0
        8 if !is_signed => 1,
899
0
        16 if is_signed => 3,
900
0
        16 if !is_signed => 3,
901
0
        32 if is_signed => 7,
902
0
        32 if !is_signed => 7,
903
0
        64 if is_signed => 14,
904
0
        64 if !is_signed => 14,
905
0
        128 if is_signed => 28,
906
0
        128 if !is_signed => 29,
907
0
        _ => 1,
908
    }
909
0
}
910
911
#[inline(always)]
912
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
913
0
const fn max_step_22(bits: usize, is_signed: bool) -> usize {
914
0
    match bits {
915
0
        8 if is_signed => 2,
916
0
        8 if !is_signed => 2,
917
0
        16 if is_signed => 4,
918
0
        16 if !is_signed => 4,
919
0
        32 if is_signed => 7,
920
0
        32 if !is_signed => 8,
921
0
        64 if is_signed => 15,
922
0
        64 if !is_signed => 15,
923
0
        128 if is_signed => 29,
924
0
        128 if !is_signed => 29,
925
0
        _ => 1,
926
    }
927
0
}
928
929
#[inline(always)]
930
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
931
0
const fn min_step_22(bits: usize, is_signed: bool) -> usize {
932
0
    match bits {
933
0
        8 if is_signed => 1,
934
0
        8 if !is_signed => 1,
935
0
        16 if is_signed => 3,
936
0
        16 if !is_signed => 3,
937
0
        32 if is_signed => 6,
938
0
        32 if !is_signed => 7,
939
0
        64 if is_signed => 14,
940
0
        64 if !is_signed => 14,
941
0
        128 if is_signed => 28,
942
0
        128 if !is_signed => 28,
943
0
        _ => 1,
944
    }
945
0
}
946
947
#[inline(always)]
948
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
949
0
const fn max_step_23(bits: usize, is_signed: bool) -> usize {
950
0
    match bits {
951
0
        8 if is_signed => 2,
952
0
        8 if !is_signed => 2,
953
0
        16 if is_signed => 4,
954
0
        16 if !is_signed => 4,
955
0
        32 if is_signed => 7,
956
0
        32 if !is_signed => 8,
957
0
        64 if is_signed => 14,
958
0
        64 if !is_signed => 15,
959
0
        128 if is_signed => 29,
960
0
        128 if !is_signed => 29,
961
0
        _ => 1,
962
    }
963
0
}
964
965
#[inline(always)]
966
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
967
0
const fn min_step_23(bits: usize, is_signed: bool) -> usize {
968
0
    match bits {
969
0
        8 if is_signed => 1,
970
0
        8 if !is_signed => 1,
971
0
        16 if is_signed => 3,
972
0
        16 if !is_signed => 3,
973
0
        32 if is_signed => 6,
974
0
        32 if !is_signed => 7,
975
0
        64 if is_signed => 13,
976
0
        64 if !is_signed => 14,
977
0
        128 if is_signed => 28,
978
0
        128 if !is_signed => 28,
979
0
        _ => 1,
980
    }
981
0
}
982
983
#[inline(always)]
984
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
985
0
const fn max_step_24(bits: usize, is_signed: bool) -> usize {
986
0
    match bits {
987
0
        8 if is_signed => 2,
988
0
        8 if !is_signed => 2,
989
0
        16 if is_signed => 4,
990
0
        16 if !is_signed => 4,
991
0
        32 if is_signed => 7,
992
0
        32 if !is_signed => 7,
993
0
        64 if is_signed => 14,
994
0
        64 if !is_signed => 14,
995
0
        128 if is_signed => 28,
996
0
        128 if !is_signed => 28,
997
0
        _ => 1,
998
    }
999
0
}
1000
1001
#[inline(always)]
1002
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1003
0
const fn min_step_24(bits: usize, is_signed: bool) -> usize {
1004
0
    match bits {
1005
0
        8 if is_signed => 1,
1006
0
        8 if !is_signed => 1,
1007
0
        16 if is_signed => 3,
1008
0
        16 if !is_signed => 3,
1009
0
        32 if is_signed => 6,
1010
0
        32 if !is_signed => 6,
1011
0
        64 if is_signed => 13,
1012
0
        64 if !is_signed => 13,
1013
0
        128 if is_signed => 27,
1014
0
        128 if !is_signed => 27,
1015
0
        _ => 1,
1016
    }
1017
0
}
1018
1019
#[inline(always)]
1020
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1021
0
const fn max_step_25(bits: usize, is_signed: bool) -> usize {
1022
0
    match bits {
1023
0
        8 if is_signed => 2,
1024
0
        8 if !is_signed => 2,
1025
0
        16 if is_signed => 4,
1026
0
        16 if !is_signed => 4,
1027
0
        32 if is_signed => 7,
1028
0
        32 if !is_signed => 7,
1029
0
        64 if is_signed => 14,
1030
0
        64 if !is_signed => 14,
1031
0
        128 if is_signed => 28,
1032
0
        128 if !is_signed => 28,
1033
0
        _ => 1,
1034
    }
1035
0
}
1036
1037
#[inline(always)]
1038
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1039
0
const fn min_step_25(bits: usize, is_signed: bool) -> usize {
1040
0
    match bits {
1041
0
        8 if is_signed => 1,
1042
0
        8 if !is_signed => 1,
1043
0
        16 if is_signed => 3,
1044
0
        16 if !is_signed => 3,
1045
0
        32 if is_signed => 6,
1046
0
        32 if !is_signed => 6,
1047
0
        64 if is_signed => 13,
1048
0
        64 if !is_signed => 13,
1049
0
        128 if is_signed => 27,
1050
0
        128 if !is_signed => 27,
1051
0
        _ => 1,
1052
    }
1053
0
}
1054
1055
#[inline(always)]
1056
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1057
0
const fn max_step_26(bits: usize, is_signed: bool) -> usize {
1058
0
    match bits {
1059
0
        8 if is_signed => 2,
1060
0
        8 if !is_signed => 2,
1061
0
        16 if is_signed => 4,
1062
0
        16 if !is_signed => 4,
1063
0
        32 if is_signed => 7,
1064
0
        32 if !is_signed => 7,
1065
0
        64 if is_signed => 14,
1066
0
        64 if !is_signed => 14,
1067
0
        128 if is_signed => 28,
1068
0
        128 if !is_signed => 28,
1069
0
        _ => 1,
1070
    }
1071
0
}
1072
1073
#[inline(always)]
1074
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1075
0
const fn min_step_26(bits: usize, is_signed: bool) -> usize {
1076
0
    match bits {
1077
0
        8 if is_signed => 1,
1078
0
        8 if !is_signed => 1,
1079
0
        16 if is_signed => 3,
1080
0
        16 if !is_signed => 3,
1081
0
        32 if is_signed => 6,
1082
0
        32 if !is_signed => 6,
1083
0
        64 if is_signed => 13,
1084
0
        64 if !is_signed => 13,
1085
0
        128 if is_signed => 27,
1086
0
        128 if !is_signed => 27,
1087
0
        _ => 1,
1088
    }
1089
0
}
1090
1091
#[inline(always)]
1092
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1093
0
const fn max_step_27(bits: usize, is_signed: bool) -> usize {
1094
0
    match bits {
1095
0
        8 if is_signed => 2,
1096
0
        8 if !is_signed => 2,
1097
0
        16 if is_signed => 4,
1098
0
        16 if !is_signed => 4,
1099
0
        32 if is_signed => 7,
1100
0
        32 if !is_signed => 7,
1101
0
        64 if is_signed => 14,
1102
0
        64 if !is_signed => 14,
1103
0
        128 if is_signed => 27,
1104
0
        128 if !is_signed => 27,
1105
0
        _ => 1,
1106
    }
1107
0
}
1108
1109
#[inline(always)]
1110
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1111
0
const fn min_step_27(bits: usize, is_signed: bool) -> usize {
1112
0
    match bits {
1113
0
        8 if is_signed => 1,
1114
0
        8 if !is_signed => 1,
1115
0
        16 if is_signed => 3,
1116
0
        16 if !is_signed => 3,
1117
0
        32 if is_signed => 6,
1118
0
        32 if !is_signed => 6,
1119
0
        64 if is_signed => 13,
1120
0
        64 if !is_signed => 13,
1121
0
        128 if is_signed => 26,
1122
0
        128 if !is_signed => 26,
1123
0
        _ => 1,
1124
    }
1125
0
}
1126
1127
#[inline(always)]
1128
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1129
0
const fn max_step_28(bits: usize, is_signed: bool) -> usize {
1130
0
    match bits {
1131
0
        8 if is_signed => 2,
1132
0
        8 if !is_signed => 2,
1133
0
        16 if is_signed => 4,
1134
0
        16 if !is_signed => 4,
1135
0
        32 if is_signed => 7,
1136
0
        32 if !is_signed => 7,
1137
0
        64 if is_signed => 14,
1138
0
        64 if !is_signed => 14,
1139
0
        128 if is_signed => 27,
1140
0
        128 if !is_signed => 27,
1141
0
        _ => 1,
1142
    }
1143
0
}
1144
1145
#[inline(always)]
1146
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1147
0
const fn min_step_28(bits: usize, is_signed: bool) -> usize {
1148
0
    match bits {
1149
0
        8 if is_signed => 1,
1150
0
        8 if !is_signed => 1,
1151
0
        16 if is_signed => 3,
1152
0
        16 if !is_signed => 3,
1153
0
        32 if is_signed => 6,
1154
0
        32 if !is_signed => 6,
1155
0
        64 if is_signed => 13,
1156
0
        64 if !is_signed => 13,
1157
0
        128 if is_signed => 26,
1158
0
        128 if !is_signed => 26,
1159
0
        _ => 1,
1160
    }
1161
0
}
1162
1163
#[inline(always)]
1164
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1165
0
const fn max_step_29(bits: usize, is_signed: bool) -> usize {
1166
0
    match bits {
1167
0
        8 if is_signed => 2,
1168
0
        8 if !is_signed => 2,
1169
0
        16 if is_signed => 4,
1170
0
        16 if !is_signed => 4,
1171
0
        32 if is_signed => 7,
1172
0
        32 if !is_signed => 7,
1173
0
        64 if is_signed => 13,
1174
0
        64 if !is_signed => 14,
1175
0
        128 if is_signed => 27,
1176
0
        128 if !is_signed => 27,
1177
0
        _ => 1,
1178
    }
1179
0
}
1180
1181
#[inline(always)]
1182
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1183
0
const fn min_step_29(bits: usize, is_signed: bool) -> usize {
1184
0
    match bits {
1185
0
        8 if is_signed => 1,
1186
0
        8 if !is_signed => 1,
1187
0
        16 if is_signed => 3,
1188
0
        16 if !is_signed => 3,
1189
0
        32 if is_signed => 6,
1190
0
        32 if !is_signed => 6,
1191
0
        64 if is_signed => 12,
1192
0
        64 if !is_signed => 13,
1193
0
        128 if is_signed => 26,
1194
0
        128 if !is_signed => 26,
1195
0
        _ => 1,
1196
    }
1197
0
}
1198
1199
#[inline(always)]
1200
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1201
0
const fn max_step_30(bits: usize, is_signed: bool) -> usize {
1202
0
    match bits {
1203
0
        8 if is_signed => 2,
1204
0
        8 if !is_signed => 2,
1205
0
        16 if is_signed => 4,
1206
0
        16 if !is_signed => 4,
1207
0
        32 if is_signed => 7,
1208
0
        32 if !is_signed => 7,
1209
0
        64 if is_signed => 13,
1210
0
        64 if !is_signed => 14,
1211
0
        128 if is_signed => 26,
1212
0
        128 if !is_signed => 27,
1213
0
        _ => 1,
1214
    }
1215
0
}
1216
1217
#[inline(always)]
1218
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1219
0
const fn min_step_30(bits: usize, is_signed: bool) -> usize {
1220
0
    match bits {
1221
0
        8 if is_signed => 1,
1222
0
        8 if !is_signed => 1,
1223
0
        16 if is_signed => 3,
1224
0
        16 if !is_signed => 3,
1225
0
        32 if is_signed => 6,
1226
0
        32 if !is_signed => 6,
1227
0
        64 if is_signed => 12,
1228
0
        64 if !is_signed => 13,
1229
0
        128 if is_signed => 25,
1230
0
        128 if !is_signed => 26,
1231
0
        _ => 1,
1232
    }
1233
0
}
1234
1235
#[inline(always)]
1236
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1237
0
const fn max_step_31(bits: usize, is_signed: bool) -> usize {
1238
0
    match bits {
1239
0
        8 if is_signed => 2,
1240
0
        8 if !is_signed => 2,
1241
0
        16 if is_signed => 4,
1242
0
        16 if !is_signed => 4,
1243
0
        32 if is_signed => 7,
1244
0
        32 if !is_signed => 7,
1245
0
        64 if is_signed => 13,
1246
0
        64 if !is_signed => 13,
1247
0
        128 if is_signed => 26,
1248
0
        128 if !is_signed => 26,
1249
0
        _ => 1,
1250
    }
1251
0
}
1252
1253
#[inline(always)]
1254
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1255
0
const fn min_step_31(bits: usize, is_signed: bool) -> usize {
1256
0
    match bits {
1257
0
        8 if is_signed => 1,
1258
0
        8 if !is_signed => 1,
1259
0
        16 if is_signed => 3,
1260
0
        16 if !is_signed => 3,
1261
0
        32 if is_signed => 6,
1262
0
        32 if !is_signed => 6,
1263
0
        64 if is_signed => 12,
1264
0
        64 if !is_signed => 12,
1265
0
        128 if is_signed => 25,
1266
0
        128 if !is_signed => 25,
1267
0
        _ => 1,
1268
    }
1269
0
}
1270
1271
#[inline(always)]
1272
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
1273
0
const fn max_step_32(bits: usize, is_signed: bool) -> usize {
1274
0
    match bits {
1275
0
        8 if is_signed => 2,
1276
0
        8 if !is_signed => 2,
1277
0
        16 if is_signed => 3,
1278
0
        16 if !is_signed => 4,
1279
0
        32 if is_signed => 7,
1280
0
        32 if !is_signed => 7,
1281
0
        64 if is_signed => 13,
1282
0
        64 if !is_signed => 13,
1283
0
        128 if is_signed => 26,
1284
0
        128 if !is_signed => 26,
1285
0
        _ => 1,
1286
    }
1287
0
}
1288
1289
#[inline(always)]
1290
#[cfg_attr(not(feature = "power-of-two"), allow(dead_code))]
1291
0
const fn min_step_32(bits: usize, is_signed: bool) -> usize {
1292
0
    match bits {
1293
0
        8 if is_signed => 1,
1294
0
        8 if !is_signed => 1,
1295
0
        16 if is_signed => 3,
1296
0
        16 if !is_signed => 3,
1297
0
        32 if is_signed => 6,
1298
0
        32 if !is_signed => 6,
1299
0
        64 if is_signed => 12,
1300
0
        64 if !is_signed => 12,
1301
0
        128 if is_signed => 25,
1302
0
        128 if !is_signed => 25,
1303
0
        _ => 1,
1304
    }
1305
0
}
1306
1307
#[inline(always)]
1308
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1309
0
const fn max_step_33(bits: usize, is_signed: bool) -> usize {
1310
0
    match bits {
1311
0
        8 if is_signed => 2,
1312
0
        8 if !is_signed => 2,
1313
0
        16 if is_signed => 3,
1314
0
        16 if !is_signed => 4,
1315
0
        32 if is_signed => 7,
1316
0
        32 if !is_signed => 7,
1317
0
        64 if is_signed => 13,
1318
0
        64 if !is_signed => 13,
1319
0
        128 if is_signed => 26,
1320
0
        128 if !is_signed => 26,
1321
0
        _ => 1,
1322
    }
1323
0
}
1324
1325
#[inline(always)]
1326
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1327
0
const fn min_step_33(bits: usize, is_signed: bool) -> usize {
1328
0
    match bits {
1329
0
        8 if is_signed => 1,
1330
0
        8 if !is_signed => 1,
1331
0
        16 if is_signed => 2,
1332
0
        16 if !is_signed => 3,
1333
0
        32 if is_signed => 6,
1334
0
        32 if !is_signed => 6,
1335
0
        64 if is_signed => 12,
1336
0
        64 if !is_signed => 12,
1337
0
        128 if is_signed => 25,
1338
0
        128 if !is_signed => 25,
1339
0
        _ => 1,
1340
    }
1341
0
}
1342
1343
#[inline(always)]
1344
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1345
0
const fn max_step_34(bits: usize, is_signed: bool) -> usize {
1346
0
    match bits {
1347
0
        8 if is_signed => 2,
1348
0
        8 if !is_signed => 2,
1349
0
        16 if is_signed => 3,
1350
0
        16 if !is_signed => 4,
1351
0
        32 if is_signed => 7,
1352
0
        32 if !is_signed => 7,
1353
0
        64 if is_signed => 13,
1354
0
        64 if !is_signed => 13,
1355
0
        128 if is_signed => 25,
1356
0
        128 if !is_signed => 26,
1357
0
        _ => 1,
1358
    }
1359
0
}
1360
1361
#[inline(always)]
1362
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1363
0
const fn min_step_34(bits: usize, is_signed: bool) -> usize {
1364
0
    match bits {
1365
0
        8 if is_signed => 1,
1366
0
        8 if !is_signed => 1,
1367
0
        16 if is_signed => 2,
1368
0
        16 if !is_signed => 3,
1369
0
        32 if is_signed => 6,
1370
0
        32 if !is_signed => 6,
1371
0
        64 if is_signed => 12,
1372
0
        64 if !is_signed => 12,
1373
0
        128 if is_signed => 24,
1374
0
        128 if !is_signed => 25,
1375
0
        _ => 1,
1376
    }
1377
0
}
1378
1379
#[inline(always)]
1380
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1381
0
const fn max_step_35(bits: usize, is_signed: bool) -> usize {
1382
0
    match bits {
1383
0
        8 if is_signed => 2,
1384
0
        8 if !is_signed => 2,
1385
0
        16 if is_signed => 3,
1386
0
        16 if !is_signed => 4,
1387
0
        32 if is_signed => 7,
1388
0
        32 if !is_signed => 7,
1389
0
        64 if is_signed => 13,
1390
0
        64 if !is_signed => 13,
1391
0
        128 if is_signed => 25,
1392
0
        128 if !is_signed => 25,
1393
0
        _ => 1,
1394
    }
1395
0
}
1396
1397
#[inline(always)]
1398
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1399
0
const fn min_step_35(bits: usize, is_signed: bool) -> usize {
1400
0
    match bits {
1401
0
        8 if is_signed => 1,
1402
0
        8 if !is_signed => 1,
1403
0
        16 if is_signed => 2,
1404
0
        16 if !is_signed => 3,
1405
0
        32 if is_signed => 6,
1406
0
        32 if !is_signed => 6,
1407
0
        64 if is_signed => 12,
1408
0
        64 if !is_signed => 12,
1409
0
        128 if is_signed => 24,
1410
0
        128 if !is_signed => 24,
1411
0
        _ => 1,
1412
    }
1413
0
}
1414
1415
#[inline(always)]
1416
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1417
0
const fn max_step_36(bits: usize, is_signed: bool) -> usize {
1418
0
    match bits {
1419
0
        8 if is_signed => 2,
1420
0
        8 if !is_signed => 2,
1421
0
        16 if is_signed => 3,
1422
0
        16 if !is_signed => 4,
1423
0
        32 if is_signed => 6,
1424
0
        32 if !is_signed => 7,
1425
0
        64 if is_signed => 13,
1426
0
        64 if !is_signed => 13,
1427
0
        128 if is_signed => 25,
1428
0
        128 if !is_signed => 25,
1429
0
        _ => 1,
1430
    }
1431
0
}
1432
1433
#[inline(always)]
1434
#[cfg_attr(not(feature = "radix"), allow(dead_code))]
1435
0
const fn min_step_36(bits: usize, is_signed: bool) -> usize {
1436
0
    match bits {
1437
0
        8 if is_signed => 1,
1438
0
        8 if !is_signed => 1,
1439
0
        16 if is_signed => 2,
1440
0
        16 if !is_signed => 3,
1441
0
        32 if is_signed => 5,
1442
0
        32 if !is_signed => 6,
1443
0
        64 if is_signed => 12,
1444
0
        64 if !is_signed => 12,
1445
0
        128 if is_signed => 24,
1446
0
        128 if !is_signed => 24,
1447
0
        _ => 1,
1448
    }
1449
0
}