Bug #61624 [NEW]: round

From: Date: Wed, 04 Apr 2012 17:06:35 +0000
Subject: Bug #61624 [NEW]: round
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-169239@lists.php.net to get a copy of this message
From:             
Operating system: win32
PHP version:      5.4.0
Package:          Math related
Bug Type:         Bug
Bug description:round

Description:
------------
<?php
echo round(33.29999999999999715783,4);  // fail
echo "-";
echo round(33.29999999999999715783,2); // fail
echo "-";
echo round(33.29999999999999715783);  //ok
echo "-";
echo round(33.29999999999999715783,-1); //ok
echo "-";
echo round(55533.29999999999999715783,-2); //ok
?>

Test script:
---------------
33.29999999999999715783-33.29999999999999715783-33-30-55500

Expected result:
----------------
33.3-33.3-33-30-55500

Actual result:
--------------
33.29999999999999715783-33.29999999999999715783-33-30-55500

-- 
Edit bug report at https://bugs.php.net/bug.php?id=61624&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=61624&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=61624&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=61624&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=61624&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61624&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=61624&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=61624&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=61624&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=61624&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=61624&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=61624&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=61624&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=61624&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=61624&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=61624&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61624&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=61624&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=61624&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=61624&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=61624&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=61624&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#169239) next »