This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I understand that dealing with floats is not an accurate science . But can I somehow specify that I need a correct precision upto 'n' digit after decimal point. How does 'rounding' work for floats? See the second example.
String s=5555.1234, Float.parseFloat(s)=5555.1235, Float.valueOf(s)=5555.1235 <===Note 5 at the end ?
String s=5555.6789, Float.parseFloat(s)=5555.6787, Float.valueOf(s)=5555.6787 <=== Note 7 at the end?
String s=5555.67898898098989797987987987987, Float.parseFloat(s)=5555.679, Float.valueOf(s)=5555.679 <== why only 3 digit at the end ?
I am using JDK1.5
B&S(2.3.1)<br />There are no stupid questions. Answers maybe