Subject Re: [ib-support] Re: Wierd math???
Author Joe Martinez
>Then, -8.53483950180589E-16 isn't all that bas as an approximation of zero :-)

True, but I guess what I want is not an approximation of zero. What I'm
REALLY trying to do is put this sum in a Where clause to return master
records whose sum (of a detail table's column) is >= 0. The reason that
this came about is that my query was not returning this set, because
-8.53483950180589E-16 is actually less than zero. So, even though the sum
SHOULD be zero, -8.53483950180589E-16 fails my >= 0 test.

So, I guess my choices are to either test for a more likely value line >=
-.001, or do the cast, as in the previous post. I'll probably opt for the
cast.

I know the CORRECT solution is to use Numeric instead of Double
Precision. The reason that it's double precision now is because a few
years ago, when I converted from Paradox to Interbase, I used Data Pump to
convert the database. Data Pump converted all my Paradox numeric fields to
Double Precisions, so that's how it went. In hindsight, I should have
skipped Data Pump and redesigned my database from scratch the "right"
way. I will probably make many such improvements in the next major release
of my software.

Thanks for all the help, everyone.

-Joe