Re: .98 cents instead of .99
- From: "Stefan Schulz" <schulz.stefan@xxxxxxxxx>
- Date: 30 Jan 2006 03:33:22 -0800
You have run into a bad case of rounding error. doubles are not exactly
the number you wish to represent, and thus, amountPaid - totalCost may
be a tiny bit less then 9, which gets rounded down to 8 by the int cast.
.
- References:
- .98 cents instead of .99
- From: joshdalrymple2000
- .98 cents instead of .99
- Prev by Date: Re: Confused about how packages work.
- Next by Date: Re: extending abstract class
- Previous by thread: .98 cents instead of .99
- Next by thread: Re: .98 cents instead of .99
- Index(es):