Unfortunately, that's not the case. Floating point knows nothing about what numbers could be added as integers and what numbers can't. I.e. the int 2 and the float 2.0 behave quite differently, because the method for operating on them is different. If you want integer precision, you need to use integers.
That isn't to say that floating point numbers always result in error. For example, subtract 0.1 from the first operand and add it to the second in the original expression and the error goes away. The thing to remember is that error is always POSSIBLE with floating point arithmetic. cheers, barneyb On 12/6/05, Claude Schneegans <[EMAIL PROTECTED]> wrote: > >>Not a bug, just the nature of floating point arithmetic. > > Hmmm, I would not say so. > Approximation errors are frequent in all programming languages on all > computers WHEN there are approximations made. > In this occurrence, all numbers should be converted exactly to intenal > floating values, the result should be exact as well, > then the transcription to a string should again show no approximation error. > > On could get such errors in an expression like SIN(0) for instance, > because a trigonometric functions are obtained > through a serie calculation, but not with just sums of 3 or for digit > real values. > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 100 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226280 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

