diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-03-13 18:49:04 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-03-19 17:52:30 +0000 |
commit | 84aea6c091d020a37c2b452a6f56ca27b3b2c7cb (patch) | |
tree | 50f321ea52344cfd3831856aabf44089b4962094 /src/corelib/kernel/qvariant.cpp | |
parent | 368eb2ecec7cc54ea987de00df7caa52a0d4503a (diff) |
Add qFpClassify() to mirror std::fpclassify()
The rules of std don't permit us to add an overload for
fpclassify(qfloat16), so we need our own equivalent that we *can*
overload. Deploy it in the few places we use fpclassify().
Extended qnumeric's testing to cover qFpClassify().
Change-Id: Ie5a0a5cc24599d1571404c573d33c682b0d305a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 18c7f7648d..deba977f77 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2018 Intel Corporation. ** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com> ** Contact: https://www.qt.io/licensing/ @@ -4002,8 +4002,8 @@ static int numericCompare(const QVariant::Private *d1, const QVariant::Private * return 0; // only do fuzzy comparisons for finite, non-zero numbers - int c1 = std::fpclassify(r1); - int c2 = std::fpclassify(r2); + int c1 = qFpClassify(r1); + int c2 = qFpClassify(r2); if ((c1 == FP_NORMAL || c1 == FP_SUBNORMAL) && (c2 == FP_NORMAL || c2 == FP_SUBNORMAL)) { if (qFuzzyCompare(r1, r2)) return 0; |