This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Why does this return the value 55296.19000000006? How can I get 55296.19?
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
posted
0
Floating point numbers usually don't have exact representations. When you print out a double, you can use the DecimalFormat class.
Joe Vahabzadeh
Ranch Hand
Joined: Jan 05, 2005
Posts: 129
posted
0
I think the only case where you're guaranteed 100% accuracy is when the fractional parts of the values involved can be represented by sums of negative powers of 2.