diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-12-31 15:13:32 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-12-31 15:13:32 -0500 |
| commit | dbae987f1fb54da795185a03f4c00d56a639f8cd (patch) | |
| tree | 40a4d00c045c29cd9af117aa01194b8c8be4fbeb /src/stdlib/intX.c.h | |
| parent | 0f9af5f44bd2735f34a48ceb177837a5a6ef25b0 (diff) | |
Changed is_between() to be bidirectional
Diffstat (limited to 'src/stdlib/intX.c.h')
| -rw-r--r-- | src/stdlib/intX.c.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdlib/intX.c.h b/src/stdlib/intX.c.h index 3e6648f7..04c8ef3b 100644 --- a/src/stdlib/intX.c.h +++ b/src/stdlib/intX.c.h @@ -116,7 +116,7 @@ PUREFUNC bool NAMESPACED(equal)(const void *x, const void *y, const TypeInfo_t * } public CONSTFUNC bool NAMESPACED(is_between)(const INT_T x, const INT_T low, const INT_T high) { - return low <= x && x <= high; + return (low <= x && x <= high) || (high <= x && x <= low); } public CONSTFUNC INT_T NAMESPACED(clamped)(INT_T x, INT_T min, INT_T max) { |
