This question has already been answered:
Instead of 27.0, Math.pow (3.0,3.0) returns 26.999999999999993. What is the problem?
This question has already been answered:
Instead of 27.0, Math.pow (3.0,3.0) returns 26.999999999999993. What is the problem?
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
This is not a problem, but a completely acceptable behavior. The fact is that the set of real numbers is not only infinite, but also continuous, therefore, no matter how many bits we take, we will inevitably encounter numbers that do not have an exact representation.
Therefore, you get a fairly accurate answer, which is close to 27.0
Source: https://ru.stackoverflow.com/questions/577509/
All Articles