I get different results when try to division same numbers in PHP and C#:
PHP:
echo 1000/0.03475;
output:28776.9784173
C#:
1000/0.03475
output:28776,9784172662
Why? And how to get same results?
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.
But they do give the very same result, just rounded to different numbers of decimal places when displayed. If you were to look at the actual bits representing the floating-point number in memory, they ought to be identical (given the same architecture).