Document qRound's rounding semantics

This differs from both C rounding (away from zero), and IEEE-754
rounding (to even).

Change-Id: I2cdd358824ca14c922b23029308e3ce3258c1d8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Allan Sandfeld Jensen 2018-05-30 12:23:29 +02:00
parent 04ebb981ab
commit ccfb309b90

View File

@ -939,6 +939,8 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
Rounds \a d to the nearest integer. Rounds \a d to the nearest integer.
Rounds half up (e.g. 0.5 -> 1, -0.5 -> 0).
Example: Example:
\snippet code/src_corelib_global_qglobal.cpp 11A \snippet code/src_corelib_global_qglobal.cpp 11A
@ -949,6 +951,8 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
Rounds \a d to the nearest integer. Rounds \a d to the nearest integer.
Rounds half up (e.g. 0.5f -> 1, -0.5f -> 0).
Example: Example:
\snippet code/src_corelib_global_qglobal.cpp 11B \snippet code/src_corelib_global_qglobal.cpp 11B
@ -959,6 +963,8 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
Rounds \a d to the nearest 64-bit integer. Rounds \a d to the nearest 64-bit integer.
Rounds half up (e.g. 0.5 -> 1, -0.5 -> 0).
Example: Example:
\snippet code/src_corelib_global_qglobal.cpp 12A \snippet code/src_corelib_global_qglobal.cpp 12A
@ -969,6 +975,8 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
Rounds \a d to the nearest 64-bit integer. Rounds \a d to the nearest 64-bit integer.
Rounds half up (e.g. 0.5f -> 1, -0.5f -> 0).
Example: Example:
\snippet code/src_corelib_global_qglobal.cpp 12B \snippet code/src_corelib_global_qglobal.cpp 12B