Skip to content

Commit

Permalink
update code to flip the arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed May 30, 2023
1 parent 7d8753b commit 346a216
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,10 @@ impl AcirContext {
lhs: AcirVar,
rhs: AcirVar,
) -> Result<AcirVar, AcirGenError> {
// Flip the result of calling more than equal method to
// compute less than.
let comparison = self.more_than_eq_var(lhs, rhs)?;

let one = self.add_constant(FieldElement::one());
let comparison_negated = self.sub_var(one, comparison);

Ok(comparison_negated)
// Flip inputs of more than equal call to compute
// less than
// ie x < y , is the same as y >= x
Ok(self.more_than_eq_var(rhs, lhs)?)
}

/// Terminates the context and takes the resulting `GeneratedAcir`
Expand Down

0 comments on commit 346a216

Please sign in to comment.