diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-05-20 13:05:46 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-09-16 18:33:58 +0200 |
commit | 8c8b9a4173f4add522ec13de85107deba7c82da0 (patch) | |
tree | 9b1653957a8435d3576eb963a2a0ff4d317db5e4 /src/corelib/global/qglobal.cpp | |
parent | c5f611c0841791baab4790588352a7b5eb5dc4c3 (diff) |
Normalize rounding
Change the rounding of negative half values to match standard C++
round, this will also allow future optimizations.
Change-Id: I8f8c71bed1f05891e82ea787c6bc284297de9c5c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 39f36bb3cc..1c55cb8f9f 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -973,7 +973,7 @@ 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). + Rounds half away from zero (e.g. 0.5 -> 1, -0.5 -> -1). Example: @@ -985,7 +985,7 @@ 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). + Rounds half away from zero (e.g. 0.5f -> 1, -0.5f -> -1). Example: @@ -997,7 +997,7 @@ 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). + Rounds half away from zero (e.g. 0.5 -> 1, -0.5 -> -1). Example: @@ -1009,7 +1009,7 @@ 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). + Rounds half away from zero (e.g. 0.5f -> 1, -0.5f -> -1). Example: |