pxfm/logs/log10p1_tables.rs
1/*
2 * // Copyright (c) Radzivon Bartoshyk 6/2025. All rights reserved.
3 * //
4 * // Redistribution and use in source and binary forms, with or without modification,
5 * // are permitted provided that the following conditions are met:
6 * //
7 * // 1. Redistributions of source code must retain the above copyright notice, this
8 * // list of conditions and the following disclaimer.
9 * //
10 * // 2. Redistributions in binary form must reproduce the above copyright notice,
11 * // this list of conditions and the following disclaimer in the documentation
12 * // and/or other materials provided with the distribution.
13 * //
14 * // 3. Neither the name of the copyright holder nor the names of its
15 * // contributors may be used to endorse or promote products derived from
16 * // this software without specific prior written permission.
17 * //
18 * // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 * // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 * // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/* LOG10P1_EXACT_INT_TABLE[e] is zero if there is no value of the form 10^n-1 in the range
31[2^e, 2^(e+1)), otherwise it is this (unique) value. */
32pub(crate) static LOG10P1_EXACT_INT_TABLE: [u64; 50] = [
33 0x0000000000000000,
34 0x0000000000000000,
35 0x0000000000000000,
36 0x4022000000000000,
37 0x0000000000000000,
38 0x0000000000000000,
39 0x4058c00000000000,
40 0x0000000000000000,
41 0x0000000000000000,
42 0x408f380000000000,
43 0x0000000000000000,
44 0x0000000000000000,
45 0x0000000000000000,
46 0x40c3878000000000,
47 0x0000000000000000,
48 0x0000000000000000,
49 0x40f869f000000000,
50 0x0000000000000000,
51 0x0000000000000000,
52 0x412e847e00000000,
53 0x0000000000000000,
54 0x0000000000000000,
55 0x0000000000000000,
56 0x416312cfe0000000,
57 0x0000000000000000,
58 0x0000000000000000,
59 0x4197d783fc000000,
60 0x0000000000000000,
61 0x0000000000000000,
62 0x41cdcd64ff800000,
63 0x0000000000000000,
64 0x0000000000000000,
65 0x0000000000000000,
66 0x4202a05f1ff80000,
67 0x0000000000000000,
68 0x0000000000000000,
69 0x42374876e7ff0000,
70 0x0000000000000000,
71 0x0000000000000000,
72 0x426d1a94a1ffe000,
73 0x0000000000000000,
74 0x0000000000000000,
75 0x0000000000000000,
76 0x42a2309ce53ffe00,
77 0x0000000000000000,
78 0x0000000000000000,
79 0x42d6bcc41e8fffc0,
80 0x0000000000000000,
81 0x0000000000000000,
82 0x430c6bf52633fff8,
83];
84
85// LOG10P1_EXACT_INT_S_TABLE[e] is the integer n such that LOG10P1_EXACT_INT_TABLE[e] = 10^n-1 when LOG10P1_EXACT_INT_TABLE[e] is not zero
86pub(crate) static LOG10P1_EXACT_INT_S_TABLE: [u32; 50] = [
87 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 0, 4, 0, 0, 5, 0, 0, 6, 0, 0, 0, 7, 0, 0, 8, 0, 0, 9, 0, 0,
88 0, 10, 0, 0, 11, 0, 0, 12, 0, 0, 0, 13, 0, 0, 14, 0, 0, 15,
89];