Skip to content

Commit

Permalink
improve greater than (or equal)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Oct 10, 2023
1 parent c478ceb commit 68a83ba
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lib/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,7 @@ class Field {
* @return A {@link Bool} representing if this {@link Field} is greater than another "field-like" value.
*/
greaterThan(y: Field | bigint | number | string) {
// TODO: this is less efficient than possible for equivalence with ml
return this.lessThanOrEqual(y).not();
return Field.from(y).lessThan(this);
}

/**
Expand All @@ -776,8 +775,7 @@ class Field {
* @return A {@link Bool} representing if this {@link Field} is greater than or equal another "field-like" value.
*/
greaterThanOrEqual(y: Field | bigint | number | string) {
// TODO: this is less efficient than possible for equivalence with ml
return this.lessThan(y).not();
return Field.from(y).lessThanOrEqual(this);
}

/**
Expand Down

0 comments on commit 68a83ba

Please sign in to comment.