Last active
August 29, 2015 14:22
-
-
Save wogsland/abcfc6d5157c5956412e to your computer and use it in GitHub Desktop.
PHP Floating Point Numbers Suck...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
var_dump((31 - 18.6)); | |
// float(12.4) | |
var_dump((31 - 18.6) > 12.4); | |
// bool(false) | |
var_dump((31 - 18.6) < 12.4); | |
// bool(true) WTF?!?!!? | |
var_dump((31 - 18.6) == 12.4); | |
// bool(false) Double WTF?!?!? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment