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.

[more good advice about the inexactness of floats]

That's true, but the result of ROUND is an integer. An IEEE double can store a large range of integers exactly (something like +/- 2^52).

Here's a nice concise reference for the format:
<http://stevehollasch.com/cgindex/coding/ieeefloat.html>

I'm sure there's a good reason (perhaps insufficient range in +/- 2^52) for ROUND not to return a double, but IEEE doubles do do pretty well for storing and retrieving a decent range of integers exactly.

--Steve

Reply via email to