diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-28 11:46:30 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-07-28 22:40:18 +0000 |
commit | 46caf7a449baed61516605bb6feb595ab747adea (patch) | |
tree | aa3851dcb1fe1bda46c35faad178f45dc728876d /tests | |
parent | 659a52bcaa4abcf2b8a8fff87d94c41af7a25d06 (diff) |
Make qfloat16 helper functions consistent with float/double versions
Infinite is only when the mantissa is 0, everything else is NaN.
std::isnormal returns false on zero.
Change-Id: I897fc0dc3b8a9c557bb1922ea7ca8df501e91859
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d782df48612a932f03a579c889670d34c26e9574)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp index a661b0388e..99f539f341 100644 --- a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp +++ b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp @@ -423,7 +423,7 @@ void tst_qfloat16::finite() { QFETCH(qfloat16, value); QFETCH(int, mode); - QCOMPARE(value.isNormal(), mode != FP_SUBNORMAL); + QCOMPARE(value.isNormal(), mode == FP_NORMAL); QCOMPARE(value, value); // Fuzzy QVERIFY(value == value); // Exact QVERIFY(qIsFinite(value)); |