Re: Float comparison
| From: | Rasmus Lerdorf | Date: | Fri, 02 May 2008 18:41:44 +0000 |
| Subject: | Re: Float comparison | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37409@lists.php.net to get a copy of this message | ||
Stefan Walk wrote:
And you'll quickly see that the "cast to string before comparision" is a bad idea, because: $ php -dprecision=1 -r 'var_dump((string)1.4 == (string)1.1);' bool(true) Having display settings affect comparisions seems like a really bad idea to me ;)Yup, it would be a fatal flaw in the language if that ever came to be. -Rasmus