my dog learned polymorphism*
The moose likes Cattle Drive and the fly likes float arithmetic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "float arithmetic" Watch "float arithmetic" New topic
Author

float arithmetic

Manisha Abhyankar
Greenhorn

Joined: Jan 13, 2001
Posts: 1
I am trying to do float arithmetic for dollar amounts. The sum is not precise to the two decimal places of cents. It gets rounded up and the final total is different from the actual total by a few cents or a couple of dollars! Has anyone used float for accumulating totals precise to the two decimal places?
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20540
    ∞

Which assignment is this for?


permaculture Wood Burning Stoves 2.0 - 4-DVD set
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: float arithmetic