<QFloat16>

該文檔編製在 Qt 5.9 引入。

    函數

    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.

    函數文檔編製

    bool qFuzzyCompare ( qfloat16 p1 , qfloat16 p2 )

    比較浮點值 p1 and p2 並返迴 true 若它們被認為相等,否則 false .

    The two numbers are compared in a relative way, where the exactness is stronger the smaller the numbers are.

    bool qIsFinite ( qfloat16 f )

    返迴 true 若 qfloat16 f 是有限數。

    另請參閱 qIsFinite.

    bool qIsInf ( qfloat16 f )

    返迴 true 若 qfloat16 f 相當於無窮大。

    另請參閱 qIsInf.

    bool qIsNaN ( qfloat16 f )

    返迴 true 若 qfloat16 f 是 NaN (非數字)。

    另請參閱 qIsNaN.

    qint64 qRound64 ( qfloat16 value )

    圓整 value 到最近 64 位整數。

    另請參閱 qRound64.

    int qRound ( qfloat16 value )

    圓整 value 到最近整數。

    另請參閱 qRound.