Rowan Worth, on Monday, May 27, 2019 11:07 PM, wrote...
>On Mon, 27 May 2019 at 23:36, Jose Isaias Cabrera <jic...@outlook.com>
>wrote:
>
>> Ok, I think it happens even before the casting. This should be,
>> 3.2599999999999998, and yet, it's 3.26.
>>
>> sqlite> SELECT 0.005 + 3.2549999999999998;
>> 3.26
>>
>
>Note that no arithmetic is required to see these symptoms:
Yes. It has definitely been a learning experience. I actually thought that
using floating point was more accurate in every way possible. :-) I am also
understood why some of the dumps that I get from a reporting system have
numbers such as 3.2549999999999998, etc., when someone actually entered a
different and shorter number all together. I am the least in knowledge of this
group, and I appreciate the lovely responses from everyone. But, I have been
wondering in the past few days: why haven't more people complaint about it?
Math is math and decimal number is what most business run? Yes, there are many
other floating point application for engineers and such, but the amount of work
in daily business activity relies on decimal numbering system. Anyway, I
understand it now.
>This is all very subtle which is why some languages/software offer actual
>decimal arithmetic. sqlite does not, but there's also nothing to stop you
>from storing eg. strings in the DB and converting to/from decimal
>representations in your application.
Thanks Rowan for the reply. Yes, I will have to manage it this way from now on.
Back to creating a few arithmetic functions to manage these types of decimal
processing. It is sad, though, because it would be easier to be able to do
this right from SQLite, instead of outside. Now, I will have to bring the
records out, do the sum of the records, round, etc., etc. Thanks.
josé
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users