malachite-float 0.10.0

The arbitrary-precision floating-point type Float, with efficient algorithms partially derived from MPFR.
Documentation
// Copyright © 2026 Mikhail Hogrefe
//
// Uses code adopted from the GNU MPFR Library.
//
//      The `__gmpfr_l2b` table and its `compute_l2b` generator were contributed to the GNU MPFR
//      project by the AriC and Caramba projects, INRIA.
//
//      Copyright © 2007-2024 Free Software Foundation, Inc.
//
// This file is part of Malachite.
//
// Malachite is free software: you can redistribute it and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published by the Free Software Foundation; either version
// 3 of the License, or (at your option) any later version. See <https://www.gnu.org/licenses/>.

// This section is created by l2b_data.rs.

// This is equivalent to `__gmpfr_l2b` in `get_str.c`, MPFR 4.x; it follows the `compute_l2b`
// algorithm in MPFR's `tests/tl2b.c`.
//
// For each base b in 2..=62, column 0 is a 23-bit upper bound on log2(b), and column 1 is a 77-bit
// upper bound on log_b(2) = 1 / log2(b). Each entry `(m, e)` represents the value `m * 2 ^ (e -
// 128)`; the mantissa `m` is left-justified (bit 127 is set), so it holds the significand exactly
// (both 23 and 77 fit in 128 bits).
//
// Indexed as `MPFR_L2B[b - 2][i]`.
pub(crate) const MPFR_L2B: [[(u128, i8); 2]; 61] = [
    [(0x80000000000000000000000000000000, 1), (0x80000000000000000000000000000000, 1)], // b = 2
    [(0xcae00e00000000000000000000000000, 1), (0xa1849cc1a9a9e94e0448000000000000, 0)], // b = 3
    [(0x80000000000000000000000000000000, 2), (0x80000000000000000000000000000000, 0)], // b = 4
    [(0x949a7a00000000000000000000000000, 2), (0xdc81a348287b972867b8000000000000, -1)], // b = 5
    [(0xa5700800000000000000000000000000, 2), (0xc6119236e054f9e9ff10000000000000, -1)], // b = 6
    [(0xb3abb400000000000000000000000000, 2), (0xb660c9d6754da71137b8000000000000, -1)], // b = 7
    [(0xc0000000000000000000000000000000, 2), (0xaaaaaaaaaaaaaaaaaab0000000000000, -1)], // b = 8
    [(0xcae00e00000000000000000000000000, 2), (0xa1849cc1a9a9e94e0448000000000000, -1)], // b = 9
    [(0xd49a7a00000000000000000000000000, 2), (0x9a209a84fbcff7988f90000000000000, -1)], // b = 10
    [(0xdd675400000000000000000000000000, 2), (0x94004e0eeb229d10e170000000000000, -1)], // b = 11
    [(0xe5700800000000000000000000000000, 2), (0x8ed19c1a0b031c24fe28000000000000, -1)], // b = 12
    [(0xecd40200000000000000000000000000, 2), (0x8a5ca7c6cb20f7b457f8000000000000, -1)], // b = 13
    [(0xf3abb400000000000000000000000000, 2), (0x8679fff696b55cab85a8000000000000, -1)], // b = 14
    [(0xfa0a8000000000000000000000000000, 2), (0x830cee2369f0a6aa6f80000000000000, -1)], // b = 15
    [(0x80000000000000000000000000000000, 3), (0x80000000000000000000000000000000, -1)], // b = 16
    [(0x82cc8000000000000000000000000000, 3), (0xfa85abf562c4259b8720000000000000, -2)], // b = 17
    [(0x85700800000000000000000000000000, 3), (0xf5916634553713783698000000000000, -2)], // b = 18
    [(0x87ef0600000000000000000000000000, 3), (0xf10f08c062ed558c0db8000000000000, -2)], // b = 19
    [(0x8a4d3e00000000000000000000000000, 3), (0xecee690a1cc1a71c0b40000000000000, -2)], // b = 20
    [(0x8c8dde00000000000000000000000000, 3), (0xe92263c1b3d06b264108000000000000, -2)], // b = 21
    [(0x8eb3aa00000000000000000000000000, 3), (0xe5a02c4d60b9f061dbe8000000000000, -2)], // b = 22
    [(0x90c10600000000000000000000000000, 3), (0xe25ecadd46b9586ac3e0000000000000, -2)], // b = 23
    [(0x92b80400000000000000000000000000, 3), (0xdf56bb44c7c672633668000000000000, -2)], // b = 24
    [(0x949a7a00000000000000000000000000, 3), (0xdc81a348287b972867b8000000000000, -2)], // b = 25
    [(0x966a0200000000000000000000000000, 3), (0xd9da19f9758378a46458000000000000, -2)], // b = 26
    [(0x98280a00000000000000000000000000, 3), (0xd75b7bace237e1bd5b08000000000000, -2)], // b = 27
    [(0x99d5da00000000000000000000000000, 3), (0xd501c75871dfe8b8deb8000000000000, -2)], // b = 28
    [(0x9b749600000000000000000000000000, 3), (0xd2c983159c6c62b3ccc8000000000000, -2)], // b = 29
    [(0x9d054000000000000000000000000000, 3), (0xd0afa6195cad17323588000000000000, -2)], // b = 30
    [(0x9e88c800000000000000000000000000, 3), (0xceb186e663eef7cad578000000000000, -2)], // b = 31
    [(0xa0000000000000000000000000000000, 3), (0xccccccccccccccccccd0000000000000, -2)], // b = 32
    [(0xa16bae00000000000000000000000000, 3), (0xcaff64045304a1870888000000000000, -2)], // b = 33
    [(0xa2cc8000000000000000000000000000, 3), (0xc94773d85a7917cafb50000000000000, -2)], // b = 34
    [(0xa4231800000000000000000000000000, 3), (0xc7a3567c603718c26960000000000000, -2)], // b = 35
    [(0xa5700800000000000000000000000000, 3), (0xc6119236e054f9e9ff10000000000000, -2)], // b = 36
    [(0xa6b3d800000000000000000000000000, 3), (0xc490d3a270d76b361618000000000000, -2)], // b = 37
    [(0xa7ef0600000000000000000000000000, 3), (0xc31fe8d251829505a3e0000000000000, -2)], // b = 38
    [(0xa9220400000000000000000000000000, 3), (0xc1bdbd3210caf1b5fcf8000000000000, -2)], // b = 39
    [(0xaa4d3e00000000000000000000000000, 3), (0xc06955ffeff74948dce8000000000000, -2)], // b = 40
    [(0xab711200000000000000000000000000, 3), (0xbf21cf47f6957cefdc28000000000000, -2)], // b = 41
    [(0xac8dde00000000000000000000000000, 3), (0xbde6594a939b7125ba10000000000000, -2)], // b = 42
    [(0xada3f600000000000000000000000000, 3), (0xbcb6363d91182ab59560000000000000, -2)], // b = 43
    [(0xaeb3aa00000000000000000000000000, 3), (0xbb90b8593a3d4e901590000000000000, -2)], // b = 44
    [(0xafbd4400000000000000000000000000, 3), (0xba754026101076f51e78000000000000, -2)], // b = 45
    [(0xb0c10600000000000000000000000000, 3), (0xb9633b0169aa0512b670000000000000, -2)], // b = 46
    [(0xb1bf3200000000000000000000000000, 3), (0xb85a21d0fbe441335118000000000000, -2)], // b = 47
    [(0xb2b80400000000000000000000000000, 3), (0xb75977de960d663d0490000000000000, -2)], // b = 48
    [(0xb3abb400000000000000000000000000, 3), (0xb660c9d6754da71137b8000000000000, -2)], // b = 49
    [(0xb49a7a00000000000000000000000000, 3), (0xb56face37344e53227f0000000000000, -2)], // b = 50
    [(0xb5848400000000000000000000000000, 3), (0xb485bde50f8ae9a94000000000000000, -2)], // b = 51
    [(0xb66a0200000000000000000000000000, 3), (0xb3a2a0bbeecffcb34608000000000000, -2)], // b = 52
    [(0xb74b2000000000000000000000000000, 3), (0xb2c5ffa9eb5f8ccba360000000000000, -2)], // b = 53
    [(0xb8280a00000000000000000000000000, 3), (0xb1ef8ac33e86e940f368000000000000, -2)], // b = 54
    [(0xb900e800000000000000000000000000, 3), (0xb11ef76ea4b5d18e7a40000000000000, -2)], // b = 55
    [(0xb9d5da00000000000000000000000000, 3), (0xb053fff2aa2c4c7be818000000000000, -2)], // b = 56
    [(0xbaa70a00000000000000000000000000, 3), (0xaf8e630e8e2f814fefb0000000000000, -2)], // b = 57
    [(0xbb749600000000000000000000000000, 3), (0xaecde39d611441a15d18000000000000, -2)], // b = 58
    [(0xbc3e9e00000000000000000000000000, 3), (0xae1248422f9797dfd000000000000000, -2)], // b = 59
    [(0xbd054000000000000000000000000000, 3), (0xad5b5b1c3555206dfe58000000000000, -2)], // b = 60
    [(0xbdc89a00000000000000000000000000, 3), (0xaca8e98231cb77574df8000000000000, -2)], // b = 61
    [(0xbe88c800000000000000000000000000, 3), (0xabfac3c41831f90574f8000000000000, -2)], // b = 62
];