#30655 [NEW]: mod bug with double
| From: | shejan at web dot de | Date: | Tue, 02 Nov 2004 08:31:39 +0000 |
| Subject: | #30655 [NEW]: mod bug with double | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-68612@lists.php.net to get a copy of this message | ||
From: shejan at web dot de
Operating system: Linux/Windows
PHP version: Irrelevant
PHP Bug Type: *General Issues
Bug description: mod bug with double
Description:
------------
mod (%) has problems with double.
with 2.01*100 mod isnt working
but 1.01*100 works fine.
chaning a double to int isnt working.
chaning a double to string and than int is working.
Reproduce code:
---------------
echo "201%100: ".(201%100)."<br>"; // 1 (that is right)
echo "(2.01*100)%100: ".((2.01*100)%100)."<br>"; // 0 (wrong)
echo "((int)(2.01*100))%100: ".(((int)(2.01*100))%100)."<br>"; // 0
(wrong)
echo "((int)(string)(2.01*100))%100:
".(((int)(string)(2.01*100))%100)."<br>"; // 1 (right)
Expected result:
----------------
201%100: 1
(2.01*100)%100: 0
((int)(2.01*100))%100: 0
((int)(string)(2.01*100))%100: 1
--
Edit bug report at http://bugs.php.net/?id=30655&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30655&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30655&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30655&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30655&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30655&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30655&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30655&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30655&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30655&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30655&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30655&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30655&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30655&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30655&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30655&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30655&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30655&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30655&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30655&r=mysqlcfg