#33584 [Opn->Fbk]: round problems
| From: | tony2001@php.net | Date: | Wed, 06 Jul 2005 10:27:04 +0000 |
| Subject: | #33584 [Opn->Fbk]: round problems | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81457@lists.php.net to get a copy of this message | ||
ID: 33584
Updated by: tony2001@php.net
Reported By: ruslan_y at list dot ru
-Status: Open
+Status: Feedback
Bug Type: Math related
Operating System: Linux Fedore Core 4
PHP Version: 4.3.11
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-07-06 11:27:04] ruslan_y at list dot ru
Description:
------------
It's something wrong with round() and number_format() function on "new"
Fedora Core 4.
I'm try to compile php4.4.0RC2 on the same box but get just the same
result.
Configure options:
'./configure' '--prefix=/usr/local' '--program-suffix=4'
'--with-config-file-path=/etc/php4' '--enable-memory-limit'
'--enable-versioning' '--enable-bcmath'
'--with-apxs=/usr/local/httpd/bin/apxs' '--disable-cgi'
'--enable-sigchild' '--with-zlib' '--enable-calendar'
'--with-dom'
'--with-zlib-dir' '--with-dom-xslt' '--with-gd'
'--with-jpeg-dir'
'--with-png-dir' '--with-ttf' '--with-freetype-dir'
'--enable-gd-native-ttf' '--with-iconv' '--with-mysql'
'--with-oci8'
'--enable-xslt' '--with-xslt-sablot' '--with-expat'
'--with-iconv-dir'
'--without-pear'
OS:
Linux - Linux localhost.localhost 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2
23:08:39 EDT 2005 i686
Automake: automake (GNU automake) 1.9.5
Autoconf: autoconf (GNU Autoconf) 2.59
Libtool: ltmain.sh (GNU libtool) 1.4.3 (1.922.2.111 2002/10/23
02:54:36)
Compiler:
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--host=i386-redhat-linux
Thread model: posix
gcc version 4.0.0 20050519 (Red Hat 4.0.0-8)
Bison: bison (GNU Bison) 2.0
Reproduce code:
---------------
<?php
echo "<br/>0.112=>".round(0.112, 2);
echo "<br/>0.115=>".round(0.115, 2);
echo "<br/>0.105=>".round(0.105, 2);
echo "<br/>0.107=>".round(0.107, 2);
?>
Expected result:
----------------
0.112=>0.11
0.115=>0.12
0.105=>0.11
0.107=>0.11
Actual result:
--------------
0.112=>0.11
0.115=>0.12
0.105=>0.1
0.107=>0.11
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33584&edit=1