Bug #51320 [NEW]: Modulus Fails with the number 2.32

From: Date: Thu, 18 Mar 2010 09:53:26 +0000
Subject: Bug #51320 [NEW]: Modulus Fails with the number 2.32
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148732@lists.php.net to get a copy of this message
From:             
Operating system: OSX, Linux
PHP version:      Irrelevant
Package:          *General Issues
Bug Type:         Bug
Bug description:Modulus Fails with the number 2.32

Description:
------------
Tested on the following PHP versions:

5.3.2 (OSX)
5.2.5 (Linux, Codepad.org)
5.2.4 (Ubuntu)

The following script improperly reports the modulus as "31" instead of
"32", but 
doesn't seem to happen with any other numbers.

Test script:
---------------
<?php

$number = 3.32; echo ($number * 100) % 100;

Expected result:
----------------
32

Actual result:
--------------
31

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



Thread (7 messages)

« previous php.bugs (#148732) next »