aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/float.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/utils/float.h')
-rw-r--r--src/include/utils/float.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/utils/float.h b/src/include/utils/float.h
index e2aae8ef177..79bf8daca80 100644
--- a/src/include/utils/float.h
+++ b/src/include/utils/float.h
@@ -225,9 +225,9 @@ float4_div(const float4 val1, const float4 val2)
if (unlikely(val2 == 0.0f) && !isnan(val1))
float_zero_divide_error();
result = val1 / val2;
- if (unlikely(isinf(result)) && !isinf(val1) && !isinf(val2))
+ if (unlikely(isinf(result)) && !isinf(val1))
float_overflow_error();
- if (unlikely(result == 0.0f) && val1 != 0.0f)
+ if (unlikely(result == 0.0f) && val1 != 0.0f && !isinf(val2))
float_underflow_error();
return result;
@@ -241,9 +241,9 @@ float8_div(const float8 val1, const float8 val2)
if (unlikely(val2 == 0.0) && !isnan(val1))
float_zero_divide_error();
result = val1 / val2;
- if (unlikely(isinf(result)) && !isinf(val1) && !isinf(val2))
+ if (unlikely(isinf(result)) && !isinf(val1))
float_overflow_error();
- if (unlikely(result == 0.0) && val1 != 0.0)
+ if (unlikely(result == 0.0) && val1 != 0.0 && !isinf(val2))
float_underflow_error();
return result;