From 8c8b9a4173f4add522ec13de85107deba7c82da0 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 20 May 2020 13:05:46 +0200 Subject: 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 --- src/corelib/global/qglobal.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/global/qglobal.cpp') 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::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::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::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::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: -- cgit v1.2.3