-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
The following code fails an internal expect
:
let num = I256::from_be_hex("eed8f6c7a5b1a65031ebc9b7a93492e89f282d49e75d25607a5693b3d8ae2e87");
let denom = U128::from_be_hex("de157f812521c55eccf9a903b31e4a34").to_nz().unwrap();
let (q, r) = num.div_rem_uint(&denom);
The author of the div_rem_uint
function (=me) incorrectly assumed that the remainder of an int
/uint
will always fit in an int
.
Edit: Actually, I was correct about this, until we modified Uint::div_rem
to accept numerators and denominators with different LIMBS-sizes.
Metadata
Metadata
Assignees
Labels
No labels