> My mistake - hopefully this will make it more clear:
>
[quoted text clipped - 14 lines]
> epsilon. However, this is unacceptable - thus the statement of "Huge"
> in regards to the error.
Floats (4 byte) have only 7 digits of precision
subtracting 58331.2 from 58331.3 and ending up with 0.101563 is correct,
because the last part '1563' starts from the 8th digit of precision.
floats are simply too small for what you want to do. You should either use
doubles, or multiply your result by 10, truncate it to only its integer part
and then divide by 10 again.
Another symptom of this behaviour: if you have to add a collection of
floats, the order in which you add them determines the outcome.
starting with the smallest values first will yield the most precise answer.
doing it any other way will give larger errors.
These things are implied by the floating point standard itself. The fact
that VC6 yield other results is because it does floating point stuff
differently from later compilers. But both are correct as far as floating
point behavior is concerned.

Signature
Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"
loftusoft@yahoo.com - 02 Nov 2006 13:52 GMT
I understand now. Thank you for your help.
Mike
> > My mistake - hopefully this will make it more clear:
> >
[quoted text clipped - 39 lines]
> bruno_nos_pam_van_dooren@hotmail.com
> Remove only "_nos_pam"