This content has been marked as final. Show 3 replies
The name of the mathematical field you're asking about is "Numerical Analysis". What you're asking for doesn't fit into this little box here. And "get around" is the wrong attitude. It's a feature, not a bug.
Ok. Let me ask another question then: How am I supposed to know
whether the code I have just written is going to work the way I intended ?
Is the only way to be sure is to use BigDecimal ?
No. Using BigDecimal just because you don't understand how floating-point numbers work would be... um... short-sighted. And it wouldn't help, either. As soon as you divide 1 by 3 then you have to know how decimal numbers work, which is essentially the same problem.
Edit: I forgot the forum hasn't been automated to provide the mandatory link for people who ask this question. We still have to do it by hand.
Edited by: DrClap on Oct 11, 2007 3:02 PM