ID:               27064
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ngaugler at ngworld dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Math related
 Operating System: FreeBSD 4.9 / Linux 2.4.23
 PHP Version:      4.3.4
 New Comment:

Yes, you're dealing with floats. Of course fmod() works.
(try doing 'var_dump(2190988683);'...)




Previous Comments:
------------------------------------------------------------------------

[2004-01-27 15:35:06] ngaugler at ngworld dot net

Description:
------------
When performing a % (mod) function on two numbers, PHP returns negative
values when it should not.  Example:

PHP:
(2190988683 % 3) returns -1
fmod(2190988683,3) returns 0

Perl:
(2190988683 % 3) returns 0

Reproduce code:
---------------
<?
echo "(2190988683 % 3) = " . (2190988683 % 3). "<br>\n";
echo "fmod(2190988683,3) = " . fmod(2190988683,3) . "<br>\n";
?>

Expected result:
----------------
(2190988683 % 3) = 0
fmod(2190988683,3) = 0

Actual result:
--------------
(2190988683 % 3) = -1
fmod(2190988683,3) = 0


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27064&edit=1

Reply via email to