[algogeeks] System.out.println(2.0-1.10)

2010-08-13 Thread navin
this statement System.out.println(2.0-1.10); produces 0.8999 can anyone explain. Mathematically result has to be 0.9 but it gives 0.8999 why? Thanks. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

Re: [algogeeks] System.out.println(2.0-1.10)

2010-08-13 Thread Mihai Donțu
On Friday 13 August 2010 16:40:41 navin wrote: this statement System.out.println(2.0-1.10); produces 0.8999 can anyone explain. Mathematically result has to be 0.9 but it gives 0.8999 why? Thanks. A classic floating point problem. A quick search in Google gave me