> Is there any reason why ROUND doesn't return a double?

Because the IEEE storage format most (all?) computers 
use to store floating point numbers is binary based, many
values that can be stored exactly in a base 10 system are 
rounded slightly to fit into the binary system. This is 
similar to the way the value 1/3 cannot be stored exactly 
in a base 10 system.

You can see an example of this rounding using sqlite:

sqlite> select (0.5 - 0.4) - 0.1;
-2.77555756156289e-17

This is, incidentally, why you should be very careful comparing 
floating point numbers in C using "==":

sqlite> select (0.5 - 0.4) == 0.1;
0

Google for "IEEE floating point format" if you require a coherent
explanation :)



                
__________________________________ 
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/

Reply via email to