Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}
}