summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdatastream.cpp
diff options
context:
space:
mode:
authorGlen Mabey <Glen.Mabey@swri.org>2013-06-22 19:43:46 -0500
committerGlen Mabey <Glen.Mabey@swri.org>2017-01-31 14:21:42 +0000
commit3ab7016632c825949f32b72d06ac324b6672b9f6 (patch)
treea385f0389c9b0f37e8c2e4f19980392d16c0b409 /src/corelib/io/qdatastream.cpp
parente5d303cb9fb3ade3fae6d3f14a5f4fe139af63c9 (diff)
New qfloat16 class
This constitutes a fairly complete submission of an entirely new floating point type which conforms to IEEE 754 as a 16-bit storage class. Conversion between qfloat16 and float is currently performed through a sequence of lookup tables. Global-level functions qRound(), qRound64(), qFuzzyCompare(), qFuzzyIsNull(), and qIsNull() each with a qfloat16 parameter have been included for completeness. [ChangeLog][QtCore] Added new qfloat16 class. Change-Id: Ia52eb27846965c14f8140c00faf5ba33c9443976 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdatastream.cpp')
-rw-r--r--src/corelib/io/qdatastream.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index 2730fd7f11..cac5152e87 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -448,6 +448,9 @@ QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision() const
The default is DoublePrecision.
+ Note that this property does not affect the serialization or deserialization of \c qfloat16
+ instances.
+
\warning This property must be set to the same value on the object that writes and the object
that reads the data stream.
@@ -972,6 +975,16 @@ QDataStream &QDataStream::operator>>(double &f)
/*!
+ \fn QDataStream &QDataStream::operator>>(qfloat16 &f)
+ \overload
+ \since 5.9
+
+ Reads a floating point number from the stream into \a f,
+ using the standard IEEE 754 format. Returns a reference to the
+ stream.
+*/
+
+/*!
\overload
Reads the '\\0'-terminated string \a s from the stream and returns
@@ -1260,6 +1273,15 @@ QDataStream &QDataStream::operator<<(double f)
/*!
+ \fn QDataStream &QDataStream::operator<<(qfloat16 f)
+ \overload
+ \since 5.9
+
+ Writes a floating point number, \a f, to the stream using
+ the standard IEEE 754 format. Returns a reference to the stream.
+*/
+
+/*!
\overload
Writes the '\\0'-terminated string \a s to the stream and returns a
@@ -1282,7 +1304,6 @@ QDataStream &QDataStream::operator<<(const char *s)
return *this;
}
-
/*!
Writes the length specifier \a len and the buffer \a s to the
stream and returns a reference to the stream.