diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-12-22 18:13:46 -0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-12-27 11:50:09 +0000 |
commit | 3d7cdb64fca260b303b44263312af3eb65eb175e (patch) | |
tree | 6bd39d1434e640df874f39f7910b4cbd73183447 /src | |
parent | 44ef95a885f440a33e79ff3f9a79d4bb6d408dda (diff) |
qfloat16: NaN is not infinite
Change-Id: I39332e0a867442d58082fffd1502b7010424f0f8
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qfloat16_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/global/qfloat16_p.h b/src/corelib/global/qfloat16_p.h index ae52e64435..f3fc96e119 100644 --- a/src/corelib/global/qfloat16_p.h +++ b/src/corelib/global/qfloat16_p.h @@ -61,9 +61,9 @@ static inline bool qt_is_inf(qfloat16 d) Q_DECL_NOTHROW bool is_inf; uchar *ch = (uchar *)&d; if (QSysInfo::ByteOrder == QSysInfo::BigEndian) - is_inf = (ch[0] & 0x7c) == 0x7c; + is_inf = (ch[0] & 0x7c) == 0x7c && (ch[0] & 0x02) == 0; else - is_inf = (ch[1] & 0x7c) == 0x7c; + is_inf = (ch[1] & 0x7c) == 0x7c && (ch[1] & 0x02) == 0; return is_inf; } |