C Example for different floating point values prediction
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
In this code, floating values are same, but their data types are different. The compiler checks and declares them ‘not equal’ on the basis of data types.
Output
"Both values are equal", you are thinking the same. But the output says just opposite. "Both are not equal" , this is because, in floating point number like float, double, long double, the values cannot be predict exactly, these are depending on the number of bytes. So the compiler differences between 21.2 and 21.2.
need an explanation for this answer? contact us directly to get an explanation for this answer