Skip to content

Commit

Permalink
Merge 81b597c into bc9a44f
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Jan 12, 2024
2 parents bc9a44f + 81b597c commit f538729
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion noir_stdlib/src/uint128.nr
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ impl U128 {

pub fn from_integer<T>(i: T) -> U128 {
let f = crate::as_field(i);
// Reject values which would overflow a u128
f.assert_max_bit_size(128);
let lo = f as u64 as Field;
let hi = (f-lo) / pow64;
U128 {
Expand Down Expand Up @@ -289,4 +291,4 @@ impl Shr for U128 {
}
self / U128::from_integer(y)
}
}
}

0 comments on commit f538729

Please sign in to comment.