diff options
| author | Michael Williamson <mike@zwobble.org> | 2025-02-02 19:10:44 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2025-02-02 19:53:22 +0000 |
| commit | 6ead9f417fabd55cc26a93c6d54bdde1110fccd4 (patch) | |
| tree | ec43bf0f0f97d329e63229da812ae82b7df132aa /runtime/src | |
| parent | cab0787d8c259b21baa376ba1ec2d95740964bd9 (diff) | |
Add runtime support for relational int operations
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/shed/ints.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/runtime/src/shed/ints.c b/runtime/src/shed/ints.c index c7c2c8ea..ed18c263 100644 --- a/runtime/src/shed/ints.c +++ b/runtime/src/shed/ints.c @@ -44,3 +44,27 @@ bool shed__runtime__int_not_equal(ShedObject left, ShedObject right) { PatioInt right_value = shed__runtime__int_value(right); return left_value != right_value; } + +bool shed__runtime__int_less_than(ShedObject left, ShedObject right) { + PatioInt left_value = shed__runtime__int_value(left); + PatioInt right_value = shed__runtime__int_value(right); + return left_value < right_value; +} + +bool shed__runtime__int_less_than_or_equal(ShedObject left, ShedObject right) { + PatioInt left_value = shed__runtime__int_value(left); + PatioInt right_value = shed__runtime__int_value(right); + return left_value <= right_value; +} + +bool shed__runtime__int_greater_than(ShedObject left, ShedObject right) { + PatioInt left_value = shed__runtime__int_value(left); + PatioInt right_value = shed__runtime__int_value(right); + return left_value > right_value; +} + +bool shed__runtime__int_greater_than_or_equal(ShedObject left, ShedObject right) { + PatioInt left_value = shed__runtime__int_value(left); + PatioInt right_value = shed__runtime__int_value(right); + return left_value >= right_value; +} |
