The <QFloat16> header file provides 16-bit floating point support. More...
This documentation was introduced in Qt 5.9.
void | qFloatFromFloat16(float *out, const qfloat16 *in, int len) |
void | qFloatToFloat16(qfloat16 *out, const float *in, int len) |
bool | qFuzzyCompare(qfloat16 p1, qfloat16 p2) |
bool | qIsFinite(qfloat16 f) |
bool | qIsInf(qfloat16 f) |
bool | qIsNaN(qfloat16 f) |
qint64 | qRound64(qfloat16 value) |
int | qRound(qfloat16 value) |
This header file provides support for half-precision (16-bit) floating point data with the class qfloat16
. It is fully compliant with IEEE 754 as a storage type. This implies that any arithmetic operation on a
qfloat16
instance results in the value first being converted to a float
. This conversion to and from float
is performed by hardware when possible, but on processors that do not natively
support half-precision, the conversion is performed through a sequence of lookup table operations.
qfloat16
should be treated as if it were a POD (plain old data) type. Consequently, none of the supported operations need any elaboration beyond stating that it supports all arithmetic operators incident to
floating point types.
Converts len qfloat16 from in to floats and stores them in out. Both in and out must have len allocated entries.
This function was introduced in Qt 5.11.
Converts len floats from in to qfloat16 and stores them in out. Both in and out must have len allocated entries.
This function was introduced in Qt 5.11.
Compares the floating point value p1 and p2 and returns true
if they are considered equal, otherwise false
.
The two numbers are compared in a relative way, where the exactness is stronger the smaller the numbers are.
Returns true if the qfloat16
f is a finite number.
See also qIsFinite.
Returns true if the qfloat16
f is equivalent to infinity.
See also qIsInf.
Returns true if the qfloat16
f is not a number (NaN).
See also qIsNaN.
Rounds value to the nearest 64-bit integer.
See also qRound64.
Rounds value to the nearest integer.
See also qRound.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: