Re: Bug #1259 Updated: Double in a string comparision bug after conve
| From: | Manuel Lemos | Date: | Tue, 23 Mar 1999 16:25:40 +0000 |
| Subject: | Re: Bug #1259 Updated: Double in a string comparision bug after conve | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-4743@lists.php.net to get a copy of this message | ||
Hello Bug,
On 23-Mar-99 12:41:11, you wrote:
>PHP's string conversion routines supress any trailing zeros, very
>much on purpose. If you want to force a certain amount of decimal
>digits, use printf() or sprintf() instead of echo or print.
Actually that is not the problem. Just compare the strings "1" and "1."
(echo "1"=="1.") and you'll see the bug. It seems PHP converts the strings
to numbers before comparing even though that's not what's meant because both
sides of the comparision are strings.
Regards,
Manuel Lemos
E-mail: mlemos@acm.org
URL: http://www.e-na.net/the_author.html
PGP key: finger://mlemos@zeus.ci.ua.pt
--
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net