Rug, any way to set max exponent value?

I am coding an algorithm to compute large Bernoulli numbers. This algorithm requires factorials of very large values in floating point. The algorithm works for up to about Bernoulli(44_000_000) but fails for 45_000_000. I have found that the issue is the conversion of Integer to Float fails if the conversion results in an exponent of 2^30-1 or greater (results in an infinity). This does not look like a max precision problem but a max exponent problem. I am fairly new to Rust and do not know how to report issues to crate owners. Some test code is below:

use rug::{Float, Complete};
use rug::{Integer};
use rug::integer::IntegerExt64;

fn main() {
    let fact = Integer::factorial(44_000_000).complete();
    let sb = fact.significant_bits_64();
    let fact_float = Float::with_val_64(sb, fact);
    println!("fact_float 44m finite? {}", fact_float.is_finite());
    let fact = Integer::factorial(45_000_000).complete();
    let sb = fact.significant_bits_64();
    let fact_float = Float::with_val_64(sb, fact);
    println!("fact_float 45m finite? {}", fact_float.is_finite());
}

I have also tried floating point factorial function but it so slow that I can't test large values, but they probably will fail any way.

After do further looking it looks like the max exponent is limited to i32. Shame since I have several algorithms that need larger exponents.

Does it really? Are you sure you can't phrase it in terms of https://docs.rs/rug/latest/rug/struct.Float.html#method.ln_gamma or something?

Using gamma to compute factorial would still result in the same large numbers.

There's a reason I said logarithm of gamma.

I realize that log gamma would generate a smaller number but what I need is the large number for the Bernoulli calculation. The algorithm chosen produces a fraction (num/den). Bernoulli numerators grow dramatically as the Bernoulli numbers increase. Algorithm used is a Zeta and Staudt_Claussen algorithm that computes the numerator in floating point and truncates the final answer to an integer. The factorial is one component of the numerator computation.

For the record, the typical way to report an issue in a crate is:

  • Go to the crate's page on crates.io (in this case, https://crates.io/crates/rug)
  • Click the link under "Repository" on the right-hand side to go to the source repository for the crate on GitHub, GitLab, Codeberg, or the like (in this case, https://gitlab.com/tspiteri/rug)
  • Create an issue in the web interface there. For GitLab, issues are listed under "Plan" > "Work Items" in the menu on the left-hand side.

Thanks, jwodder, found the issue page for rug and made a request.