[fpc-pascal] math round vs banker's round

David Emerson dle3ab at angelbase.com
Tue Aug 13 23:47:29 CEST 2013


Hi all,

I have just discovered that the system.round function has this very odd 
behavior of rounding towards an even number when the fractional part is 
.5 -- in the system.round documentation this is described as "banker's 
rounding"

I do not like this behavior. How can I use a more 
mathematically-traditional round function, which always rounds .5 up, 
and everything below .5 down?

Do I need to write this function myself?

Thanks!
~David




More information about the fpc-pascal mailing list