diff options
author | Kenneth Heafield <github@kheafield.com> | 2020-03-06 15:19:20 +0300 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2020-03-06 15:19:20 +0300 |
commit | 0cd3961956e3feb546b5cdfd730a755bfb83696a (patch) | |
tree | e21443b6dd1e97fca05b847f647954be9049ac8b | |
parent | 61bcbae423eab96156f646a92107ca5300b8ae27 (diff) |
fabsf to fix std::max
-rw-r--r-- | test/test.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test.h b/test/test.h index ac4a8f6..7de38e9 100644 --- a/test/test.h +++ b/test/test.h @@ -39,8 +39,8 @@ void CompareEps(const Type* reference, const Type* actual, Index size, Type epsi for (Index i = 0; i < size; ++i) { INFO("Inaccurate at " << i << ' ' << reference[i] << ' ' << actual[i]); // Ratio to maximum value. - float threshold = epsilon * std::max(0.01f, fabs(reference[i])); - CHECK(fabs(reference[i] - actual[i]) < threshold); + float threshold = epsilon * std::max<float>(0.01f, fabsf(reference[i])); + CHECK(fabsf(reference[i] - actual[i]) < threshold); } } |