-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
noir_json_parser/src/_comparison_tools/lt.nr
Lines 57 to 67 in d0fdc8d
pub fn lt_field_8_bit(x: Field, y: Field) -> bool { | |
// Safety: check the comments below | |
let predicate = unsafe { get_lt_predicate_f(x, y) }; | |
let delta = y as Field - x as Field; | |
let lt_parameter = 2 * (predicate as Field) * delta - predicate as Field - delta; | |
// checks that the bit length of lt_parameter is 8 | |
// i.e. checks the sign of lt_parameter | |
lt_parameter.assert_max_bit_size::<8>(); | |
predicate | |
} |
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done