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,943
  • 3
  • 20
  • 36
root
  • 1,573
  • 3
  • 23
  • 38

0 Answers0