diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-04-20 22:30:56 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-04-21 11:01:58 +0000 |
commit | 759af3e5ad1520937955985bbcfee26f5a400e0f (patch) | |
tree | 76de6b32982e9197e30564711289feda656b3f0e /src/corelib/global/qfloat16.cpp | |
parent | 07942adb77f60738a6043665673d51fc7991233b (diff) |
Centralize the check that the floating point implementation follows IEEE754
C++ does not specify which kind of floating point implementation is
being used. The C Standard doesn't either, but it includes a normative
reference for implementations adoping it (ISO/IEC 9899:2011 Annex F).
There are a few existing checks in qfloat16.cpp; move them to qglobal.cpp
(next to the other, similar checks), and improve them by actually
checking that the radix used for floating point numbers is 2.
Change-Id: I704a3a8efeb51014b3be23fb236654d647a6f44f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/global/qfloat16.cpp')
-rw-r--r-- | src/corelib/global/qfloat16.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp index 1de1ae65fb..314a0addd1 100644 --- a/src/corelib/global/qfloat16.cpp +++ b/src/corelib/global/qfloat16.cpp @@ -59,24 +59,6 @@ QT_BEGIN_NAMESPACE \since 5.9 */ -Q_STATIC_ASSERT_X(sizeof(float) == sizeof(quint32), - "qfloat16 assumes that floats are 32 bits wide"); - -// There are a few corner cases regarding denormals where GHS compiler is relying -// hardware behavior that is not IEC 559 compliant. Therefore the compiler -// reports std::numeric_limits<float>::is_iec559 as false. This is all right -// according to our needs. - -#if !defined(Q_CC_GHS) -Q_STATIC_ASSERT_X(std::numeric_limits<float>::is_iec559, - "Only works with IEEE 754 floating point"); -#endif - -Q_STATIC_ASSERT_X(std::numeric_limits<float>::has_infinity && - std::numeric_limits<float>::has_quiet_NaN && - std::numeric_limits<float>::has_signaling_NaN, - "Only works with IEEE 754 floating point"); - /*! Returns true if the \c qfloat16 \a {f} is equivalent to infinity. \relates <QFloat16> |