I noticed an incomprehensible thing for me in static method round() in class Math
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
0.49999999999999999has too many significant digits and onedoublevariable cannot store them all. So implicit rounding happens during compilation. By the time you are callingMath.round(), the argument is already 0.5 (check yourself:0.49999999999999999 == 0.5yieldstrue).