This article is designed to provide VCS user with information regarding the rounding rule applied in the system, which is round half to even (also known as Gaussian rounding or banker's rounding).

Despite the fact that there is a wide variety of rounding algorithms with a round half up (common method) being the most popular, Gaussian rounding is default for IEEE 754 (IEEE Standard for Floating-Point Arithmetic) computing functions and operators, and, therefore, has been impemented in VCS.

The idea behind it is that when a number is halfway between two others, it is rounded toward the nearest even number. For instance, 2.125 rounds down to 2.12; 2.135 rounds up to 2.14. Other decimal fractions are rounded according to a common method: 2.122 to 2.12, 2.127 to 2.13, -2.122 to -2.12 etc. 

Two examples are given below to illustrate that round half to even algorithm givers better results and higher accuracy with operations involving rounding. 

Example #1: Rounding to 2nd decimal digit


UnroundedCommon RoundingRound to half even

54.175454.1854.18

343.2050343.21343.20

106.2038106.20106.20
TOTAL503.5842503.59503.58
Difference
0.00580.0042

               

Example #2: Rounding to 1st decimal digit


UnroundedCommon RoundingRound to half even

14.2514.314.2

36.4536.536.4

44.5544.644.6
TOTAL95.2595.495.2
Difference
0.150.05



  • No labels