I have this example
$x = 0.154 + 0.408; $y = 0.562; echo $x - $y;
You would think it’s 0 but it’s not ( well maybe it depends on your system and php version ).
Anyway for those who don’t see 0, what’s the correct way to do float operations ?
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.
1 Answer