in my MS Excel I have different behavior of rounding operations for different data types:
In case of Single:
? Application.Round(6.575!, 2)
6.57
In case of Double:
? Application.Round(6.575#, 2)
6.58
Does anybody know why?
UPDATE: @paxdiablo gave an excellent answer, so just to reproduce it shortly in here:
In Single precision, 6.575 is 0 10000001 101001 0011 0011 0011 0011 in binary representation, or 6.57499980926513671875. And this rounds to 6.57
In Double precision more 0011 are added and their weight is enough to make the number slightly greater tham 6.575 (6.57500000000000017763568394003), and hence it rounds to 6.58
See Question&Answers more detail:os