Please be aware that 8.0 and 8 are the exact same numbers - they would have the same bitwise representation. They are indistinguishable. If you want to specify an *output format* that's a different matter.
– Jon SkeetJul 14 '17 at 10:35
but i have solve the hackerrank problem . where test case accept the 8.0 value not 8. he is not submit the answer
– Bilal SiddiqJul 14 '17 at 10:39
1
@BilalSiddiq I will repeat what already was said: you are having issue with specifying **output format**, and **not** with the actual precision of the number, as is suggested by the answer. In addition: if you can't understand what comments are saying, there's no need to tell us, that we don't know the answer.
– Algirdas PreidžiusJul 14 '17 at 10:54
The problem is **not** the addition; all of the values involved can be exactly represented as floating-point values. The problem is in how you **display** the result.
– Pete BeckerJul 14 '17 at 11:27