Take the 2-minute tour ×  I've been trying to find out the
reason, but I couldn't. Can anybody help me?  Look at the
following example.      float f;      f = 125.32f;
System.out.println("value of f = " + f);     double d = (double)
125.32f;      System.out.println("value of d = " + d);  This is
the output:  value of f = 125.32  value of d =
125.31999969482422  share|improve this question Can you provide
the specific example(s) that you are seeing this behavior in? It
would be better to show a SSCCE: sscce.org –  Shafik Yaghmour
Jul 6 '13 at 16:30 Example please. –  Devolus Jul 6 '13 at 16:30
One word: precision. Technically ... the values aren't
"changing" ;) –  Brian Roach Jul 6 '13 at 16:32 Afaik, that's
impossible. Doubles have both more precision and more range, so
you lose neither when casting in that direction. It may print
differently, though. –  harold Jul 6 '13 at 16:32 add comment  7
Answers    1. When you convert a float into a double, there is
no loss of information. Every float can be repres