diff options
Diffstat (limited to 'src/stdlib/bigint.c')
| -rw-r--r-- | src/stdlib/bigint.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/stdlib/bigint.c b/src/stdlib/bigint.c index d47dfee8..11270848 100644 --- a/src/stdlib/bigint.c +++ b/src/stdlib/bigint.c @@ -140,7 +140,9 @@ CONSTFUNC Int_t Int$clamped(Int_t x, Int_t low, Int_t high) { public CONSTFUNC bool Int$is_between(const Int_t x, const Int_t low, const Int_t high) { - return Int$compare_value(low, x) <= 0 && Int$compare_value(x, high) <= 0; + int32_t low_cmp = Int$compare_value(x, low); + int32_t high_cmp = Int$compare_value(x, high); + return (low_cmp >= 0 && high_cmp <= 0) || (low_cmp <= 0 && high_cmp >= 0); } public |
