summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qfloat16.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-09-23 16:46:07 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-10-03 16:30:40 +0200
commitd448f2ecb8bca7de1e69f9f6f10d0ffb8c3d1beb (patch)
tree76b45bb1213c81eccc2b3d536911dd9de91dccec /src/corelib/global/qfloat16.cpp
parenta978d21dac57697ae9557b99062bc804b005b9d4 (diff)
Correct handling of -qfloat16(0)
It is finite and normal; it classifies as a zero; and it should not be > qfloat16(0). Added tests to match. Change-Id: I7874fb54f622b4cdf28b0894050ad3e75cf5d77c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qfloat16.cpp')
-rw-r--r--src/corelib/global/qfloat16.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp
index 2ba4c79374..6c21b7de5a 100644
--- a/src/corelib/global/qfloat16.cpp
+++ b/src/corelib/global/qfloat16.cpp
@@ -155,7 +155,7 @@ QT_BEGIN_NAMESPACE
int qfloat16::fpClassify() const noexcept
{
return isInf() ? FP_INFINITE : isNaN() ? FP_NAN
- : !b16 ? FP_ZERO : isNormal() ? FP_NORMAL : FP_SUBNORMAL;
+ : !(b16 & 0x7fff) ? FP_ZERO : isNormal() ? FP_NORMAL : FP_SUBNORMAL;
}
/*! \fn int qRound(qfloat16 value)