| Author |
difference between two double variables
|
rajanikanth bhagavan kanth
Ranch Hand
Joined: May 20, 2008
Posts: 78
|
|
it is giving me out put as :: 10.010000000000002 insted of 10.01
May i know why it is giving me like that??
Regards,
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16811
|
|
It's a very well known issue with floating point numbers -- the precision of floating point, for certain values, do not represent very well in Base 2, even though they are obvious in Base 10.
This is an issue related to the IEEE floating point standard, which is the standard used by Java, and practically every language and processor used today.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
rajanikanth bhagavan kanth
Ranch Hand
Joined: May 20, 2008
Posts: 78
|
|
|
Thnq very much
|
 |
 |
|
|
subject: difference between two double variables
|
|
|