aspose file tools
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 Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "float arithmetic" Watch "float arithmetic" New topic

float arithmetic

Manisha Abhyankar

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

Joined: Dec 14, 1998
Posts: 20791

Which assignment is this for?

permaculture Wood Burning Stoves 2.0 - 4-DVD set
I agree. Here's the link:
subject: float arithmetic