-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: comparison for signed integers (#3873)
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* Implement comparison for signed integers. ## Additional Context ## Documentation\* Check one: - [X] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [X] I have tested the changes locally. - [X] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. Co-authored-by: kevaundray <kevtheappdev@gmail.com>
- Loading branch information
1 parent
12d884e
commit bcbd49b
Showing
5 changed files
with
83 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "signed_comparison" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
3 changes: 3 additions & 0 deletions
3
test_programs/execution_success/signed_comparison/Prover.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
x = "5" | ||
y = "8" | ||
z = "-15" |
13 changes: 13 additions & 0 deletions
13
test_programs/execution_success/signed_comparison/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use dep::std; | ||
|
||
fn main(mut x: i8, mut y: i8, z: i8) { | ||
let mut s1: i8 = 5; | ||
let mut s2: i8 = 8; | ||
assert(-1 as i8 < 0); | ||
assert(x < y); | ||
assert(-x < y); | ||
assert(-y < -x); | ||
assert((z > x) == false); | ||
assert(x <= s1); | ||
assert(z < x - y - s2); | ||
} |