| Author |
double and float loosing precision - java core knowledge
|
Manuel Moons
Ranch Hand
Joined: Mar 05, 2002
Posts: 229
|
|
Hello, The output of this program is: 50.12333 0.12333000000000283 float ---------------------- 50.12333 0.12332916 Can anyone explain these values? I would expect no loss of precision with such small values!
|
 |
Jeroen Wenting
Ranch Hand
Joined: Oct 12, 2000
Posts: 5093
|
|
value doesn't matter when you're dealing with floating point arithmetic. There's no magical number after which suddenly you start to loose precision, no magic formula that will tell you if and if so how much precision will be lost at any point. http://docs.sun.com/source/806-3568/ncg_goldberg.html
|
42
|
 |
 |
|
|
subject: double and float loosing precision - java core knowledge
|
|
|