0
double n1 = -6.0;
double n2 = 6.78;
System.out.println(n1 + n2);

I received the out put as 0.7800000000000002 instead of 0.78.

Any idea why?

Sample

Jonny C
  • 1,930
  • 3
  • 18
  • 35
root
  • 1,573
  • 3
  • 23
  • 37

0 Answers0