Thanks, I made some tests after looking at
http://lxr.php.net/source/php-src/main/spprintf.c#712
At first glance, I am utterly confused,
ini_set('precision', 100);
setlocale(LC_ALL, 'fr_FR.UTF-8');
echo 0.3; //
0,299999999999999988897769753748434595763683319091796875
echo "\n";
echo (string)0.3; // 0.3
// expected: 0,3
echo "\n";
echo (float)(string)0.3; //
0,299999999999999988897769753748434595763683319091796875
// expected: 0,3
echo "\n";
echo sprintf('%G', 0.3); // 0,3
// expected: 0,3
echo "\n";
I'll dig more into the code... just thought I would share this (PHP 5.2.3)
-----Original Message-----
From: Stefan Walk [mailto:[EMAIL PROTECTED]
Sent: May 4, 2008 1:31 PM
To: Jonathan Bond-Caron
Cc: [email protected]
Subject: Re: [PHP-DEV] Float comparison
> If someone could point me to the float->string code, I'd really appreciate
http://lxr.php.net/source/ZendEngine2/zend_operators.c#1075
Regards,
Stefan
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php