Friday, January 15, 2021

Banker's round

When you convert the floating-point value to a fixed-point value, you should change the value. It is rounding.

For example, there is a value "1.5".

fixed point (1.5) is 1 or 2, which one is the right value?


There are many rounding methods.

https://en.wikipedia.org/wiki/Rounding


1. normal round: Round_half_away_from_zero

2. bankers' round: Round half to even or http://www.xbeat.net/vbspeed/i_BankersRounding.htm (Gaussian rounding, round to even, bankers' rounding)