Bug #55160 [NEW]: Unexpected result on bccomp when using any decimal comma locale
| From: | everton at faccat dot br | Date: | Fri, 08 Jul 2011 12:27:56 +0000 |
| Subject: | Bug #55160 [NEW]: Unexpected result on bccomp when using any decimal comma locale | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-161704@lists.php.net to get a copy of this message | ||
From:
Operating system: Linux Ubuntu
PHP version: trunk-SVN-2011-07-08 (snap)
Package: BC math related
Bug Type: Bug
Bug description:Unexpected result on bccomp when using any decimal comma locale
Description:
------------
Unexpected result on bccomp when using any decimal comma locale.
If an operand is a fraction, and the other is zero, the result seems to be
wrong.
Test script:
---------------
<?php
print setlocale(LC_ALL, "C")."\n";
print 1.1."\n";
print bccomp(1.1, 0)."\n";
//changing locale to a country which uses decimal comma
print setlocale(LC_ALL, "en_DK.UTF-8")."\n";
print 1.1."\n";
print bccomp(1.1, 0)."\n";
print setlocale(LC_ALL, "pt_BR.UTF-8")."\n";
print 1.1."\n";
print bccomp(1.1, 0)."\n";
?>
Expected result:
----------------
C
1.1
1
en_DK.UTF-8
1,1
1
pt_BR.UTF-8
1,1
1
Actual result:
--------------
C
1.1
1
en_DK.UTF-8
1,1
0
pt_BR.UTF-8
1,1
0
--
Edit bug report at https://bugs.php.net/bug.php?id=55160&edit=1
--
Try a snapshot (PHP 5.2): https://bugs.php.net/fix.php?id=55160&r=trysnapshot52
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55160&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55160&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55160&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55160&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55160&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55160&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55160&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55160&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55160&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55160&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55160&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55160&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55160&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55160&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55160&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55160&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55160&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55160&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55160&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55160&r=mysqlcfg
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55160&r=trysnapshot54