Closed huonw closed 9 years ago
extern crate ramp; extern crate gmp; use ramp::Int; use gmp::mpz::Mpz; macro_rules! eq { ($r: expr, $g: expr) => { assert_eq!($r.to_str_radix(16, false), $g.to_str_radix(16)) } } fn parse(s: &str) -> (Int, Mpz) { (Int::from_str_radix(s, 16).unwrap(), Mpz::from_str_radix(s, 16).unwrap()) } fn main() { let (ar, ag) = parse("10000000000000000"); eq!(ar.pow(3), ag.pow(3)); }
thread '<main>' panicked at 'assertion failed: `(left == right)` (left: `"10000000000000000"`, right: `"1000000000000000000000000000000000000000000000000"`)', examples/isolated.rs:19
There has to be at least that many trailing zeros, presumably so that the lowest word is empty. And .pow(2) is computed correctly.
.pow(2)
There has to be at least that many trailing zeros, presumably so that the lowest word is empty. And
.pow(2)
is computed correctly.