diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-05-14 00:40:13 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-05-14 00:40:13 -0400 |
| commit | 31814db0a6e698e218121b12838f411358bf78a5 (patch) | |
| tree | 2f4e769a6297a8a687edf0c5a09659f2a560f50d | |
| parent | 8bafe71f17eb8b56f57de736f4eac9ec8bf5b40b (diff) | |
Bugfix for Num.near()
| -rw-r--r-- | builtins/nums.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtins/nums.c b/builtins/nums.c index 286b8d1d..4bd4fd26 100644 --- a/builtins/nums.c +++ b/builtins/nums.c @@ -34,7 +34,7 @@ public bool Num$equal(const double *x, const double *y, const TypeInfo *type) { public bool Num$near(double a, double b, double ratio, double absolute) { if (ratio < 0) ratio = 0; - else if (ratio > 0) ratio = 1; + else if (ratio > 1) ratio = 1; if (a == b) return true; @@ -116,7 +116,7 @@ public bool Num32$equal(const float *x, const float *y, const TypeInfo *type) { public bool Num32$near(float a, float b, float ratio, float absolute) { if (ratio < 0) ratio = 0; - else if (ratio > 0) ratio = 1; + else if (ratio > 1) ratio = 1; if (a == b) return true; |
