Hey, I'm struggling a bit with using the BigInt library, and feel I may misunderstand how I'm supposed to use it. I'd like to be able to use arbitrarily large powers, up to say, 100^100. But the code below, at 10^10, is pretty much where the buck stops. I think I may actually be running into overflow problems on checked_pow
, but I'm not sure. In that case, how should I implement pow for BigInt such that this works?
fn main() {
let m:Vec<BigInt> = iproduct!(2..10,2..10)
.map(|(a,b)| BigInt::from(num::checked_pow(a,b)
.expect("failed on")))
.unique()
.collect();
println!("{:?}", m.len());
}