Re: Serious Bug?

From: Date: Wed, 18 Sep 2002 14:06:49 +0000
Subject: Re: Serious Bug?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-88359@lists.php.net to get a copy of this message
Le Mardi 17 Septembre 2002 02:32, Jeff Buck a écrit : > here's the code: > > http://www.umci.com/testcode.phps That's not a bug, but a common behaviour of float numbers. Your code: if ($test!=$test2) is not written the good way. if you _REALLY_ need to compare two floats, you should write them as if ( (string)$test !== (string)$test2 ) or if ( "$test" !== "$test2" ) which could help by transtyping values. The best thing would be using real integer math.

« previous php.dev (#88359) next »