+ 1
Floating and Double Data Types: assign a float output to a double
When I write this: float f = 9.87f; System.out.println(f); double w = f; System.out.println(w); ... The output is this: 9.87 9.869999885559082 How does the value change?
1 ответ
+ 8
The println method is doing that ;)
See
https://stackoverflow.com/questions/17504833/why-converting-from-float-to-double-changes-the-value