Skip to content

Commit

Permalink
Comment build::write_radix_bases
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Sep 5, 2019
1 parent aeb9fb7 commit 32e06f6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ fn main() {
write_radix_bases().unwrap();
}

/// Write tables of the greatest power of each radix for the given bit size. These are returned
/// from `biguint::get_radix_base` to batch the multiplication/division of radix conversions on
/// full `BigUint` values, operating on primitive integers as much as possible.
///
/// e.g. BASES_16[3] = (59049, 10) // 3¹⁰ fits in u16, but 3¹¹ is too big
/// BASES_32[3] = (3486784401, 20)
/// BASES_64[3] = (12157665459056928801, 40)
///
/// Powers of two are not included, just zeroed, as they're implemented with shifts.
#[allow(unknown_lints, bare_trait_objects)]
fn write_radix_bases() -> Result<(), Box<Error>> {
let out_dir = env::var("OUT_DIR")?;
Expand Down

0 comments on commit 32e06f6

Please sign in to comment.