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:
parent
04ebb981ab
commit
ccfb309b90
@ -939,6 +939,8 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
|
||||
|
||||
Rounds \a d to the nearest integer.
|
||||
|
||||
Rounds half up (e.g. 0.5 -> 1, -0.5 -> 0).
|
||||
|
||||
Example:
|
||||
|
||||
\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 half up (e.g. 0.5f -> 1, -0.5f -> 0).
|
||||
|
||||
Example:
|
||||
|
||||
\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 half up (e.g. 0.5 -> 1, -0.5 -> 0).
|
||||
|
||||
Example:
|
||||
|
||||
\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 half up (e.g. 0.5f -> 1, -0.5f -> 0).
|
||||
|
||||
Example:
|
||||
|
||||
\snippet code/src_corelib_global_qglobal.cpp 12B
|
||||
|
Loading…
Reference in New Issue
Block a user