You see that the result is close enough to 144, that the value is displayed when converting it to a string, but it's not exactly 144, so you get "NO" on the penultimate line.
This is the same issue with floating point numbers that people run over and over again.
Neither 171.36 nor 1.19 can be represented exactly in binary floating-point types. Therefore, PHP uses a very close approximation to them. When you do arithmetic, the result will be as accurate as possible, given the limitations of the associated data types and source data (i.e., not exactly what you expected).
Bottom line: Do not compare floating point values ββfor equality directly, except in special circumstances. It is usually best to test them within a certain tolerance (for example, this value is between 144-0.00001 and 144 + 0.00001).
Jon skeet
source share