Subject | Re[2]: [ib-support] Wierd math??? |
---|---|
Author | Daniel Rail |
Post date | 2003-02-20T21:49:34Z |
Hi,
Take into account the exponential value of -16 and the value would
translate into: 0.00000000000000085348.....
And, how the rounding of float values are handled, by either one of
them.
what the exact cause of the problem is.
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)
> Joe,If you read the value properly, it is slightly off 0.
> Nando and Martijn raise valid points about floating point math and
> database storage issues.
> However, I agree that in your particular situation, one should at the very
> minimum get
> some value just slightly off 0 (since with so few values, you couldn't get
> that much
> accumulated rounding error).
Take into account the exponential value of -16 and the value would
translate into: 0.00000000000000085348.....
> So I took a quick sec to run a test. I created a dummy table with an intIt could also depend on the processor of the computer and the OS.
> field and
> a double-precision field (all you gave in your explanation), populated it
> with your given
> data, along with some interspersed records with key <> 5, and then ran your
> query. It gives
> the expected 0.00 result, no rounding error at all.
> That leads me to believe that your problem isn't weird math,
> but something else pertaining to indexes or corruption or some other thing.
> You should probably
> do a similar test yourself in a new dummy database to see if you get the
> screwy result or not.
And, how the rounding of float values are handled, by either one of
them.
> If you don't get the error, I'd try backing up and restoring the db...Anything can possibly help in finding the cause when you're unsure
what the exact cause of the problem is.
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)