On 5/24/19, Jose Isaias Cabrera <[email protected]> wrote:
>
> Dr. Hipp, how many more scenarios, where round gives the wrong answer,
> exist?  Thanks.
>

Consider these two queries:

   SELECT round(3.255,2);
   SELECT round(3.2549999999999998,2);

Do you expect them to give different answers?

If so, do you realize that 3.255 and 3.49999999999998 are in fact the
exact same floating point number?  That number in (unambiguous) hex
notation is 0x1.a0a3d70a3d70ap+1. So how is it that you would expect
the round() function to return different answers for two cases where
it is given bit-for-bit identical inputs?  How does it know which
answer to give?

-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to