We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6cd3fc commit 88fc254Copy full SHA for 88fc254
sycl/test/devicelib/math_utils.hpp
@@ -18,18 +18,12 @@ bool approx_equal_fp(T x, T y) {
18
return (x == y);
19
20
// two finite
21
- else {
22
- T threshold = std::numeric_limits<T>::epsilon() * 100;
23
- if (x != 0 && y != 0) {
24
- T max_v = std::fmax(std::abs(x), std::abs(y));
25
- return std::abs(x - y) < threshold * max_v;
26
- } else {
27
- if (x != 0)
28
- return std::abs(x) < threshold;
29
- else
30
- return std::abs(y) < threshold;
31
- }
+ T threshold = std::numeric_limits<T>::epsilon() * 100;
+ if (x != 0 && y != 0) {
+ T max_v = std::fmax(std::abs(x), std::abs(y));
+ return std::abs(x - y) < threshold * max_v;
32
}
+ return x != 0 ? std::abs(x) < threshold : std::abs(y) < threshold;
33
34
35
#endif
0 commit comments