diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-02-27 11:17:45 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-03-26 13:06:50 +0000 |
commit | 921fa344e19218b650e44f3307943fe4ec77f098 (patch) | |
tree | f32dd9d8c8ddfd3654300ad092638e23b373f046 /src/corelib/global/qfloat16.cpp | |
parent | 920622b803629a454ef73284a0065fe31c3dc62c (diff) |
Simplify finite/NaN testing for qfloat16
Doing endian-dependent selection of bytes of the value was a clumsy
surrogate for just accessing the intenal quint16 shifted suitably.
Change-Id: Icfd9d1d18f69eb94b041b8d32275df606c14c2b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qfloat16.cpp')
-rw-r--r-- | src/corelib/global/qfloat16.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp index fd608efe55..110d7c4d7c 100644 --- a/src/corelib/global/qfloat16.cpp +++ b/src/corelib/global/qfloat16.cpp @@ -37,7 +37,7 @@ ** ****************************************************************************/ -#include "qfloat16_p.h" +#include "qfloat16.h" #include "private/qsimd_p.h" QT_BEGIN_NAMESPACE @@ -65,28 +65,31 @@ QT_BEGIN_NAMESPACE */ /*! - Returns true if the \c qfloat16 \a {f} is equivalent to infinity. + \fn bool qIsInf(qfloat16 f) \relates <QFloat16> + Returns true if the \c qfloat16 \a {f} is equivalent to infinity. + \sa qIsInf */ -Q_REQUIRED_RESULT bool qIsInf(qfloat16 f) Q_DECL_NOTHROW { return qt_is_inf(f); } /*! - Returns true if the \c qfloat16 \a {f} is not a number (NaN). + \fn bool qIsNaN(qfloat16 f) \relates <QFloat16> + Returns true if the \c qfloat16 \a {f} is not a number (NaN). + \sa qIsNaN */ -Q_REQUIRED_RESULT bool qIsNaN(qfloat16 f) Q_DECL_NOTHROW { return qt_is_nan(f); } /*! - Returns true if the \c qfloat16 \a {f} is a finite number. + \fn bool qIsFinite(qfloat16 f) \relates <QFloat16> + Returns true if the \c qfloat16 \a {f} is a finite number. + \sa qIsFinite */ -Q_REQUIRED_RESULT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW { return qt_is_finite(f); } /*! \fn int qRound(qfloat16 value) \relates <QFloat16> |