php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51731 every numbers modulo by 4294967296.* will become 'division by zero' error
Submitted: 2010-05-03 21:29 UTC Modified: 2010-05-03 21:39 UTC
From: orangejasmine at hotmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.2 OS: Windows XP SP3
Private report: No CVE-ID: None
 [2010-05-03 21:29 UTC] orangejasmine at hotmail dot com
Description:
------------
every numbers modulo by 4294967296.* will become 'division by zero' error

Test script:
---------------
<?php
echo 1 % 4294967295; // ok
echo 1 % 4294967297; // ok
echo 1 % 4294967296; // error
echo 1 % 4294967296.5; // error
?>

Expected result:
----------------
0

Actual result:
--------------
PHP Warning: Division by zero

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-03 21:36 UTC] orangejasmine at hotmail dot com
sorry for a mistake

Expected result:
1
 [2010-05-03 21:39 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2010-05-03 21:39 UTC] pajoye@php.net
2^31 is the largest integer you can get on Windows.
 [2010-05-03 22:17 UTC] orangejasmine at hotmail dot com
oh i see...

% operator converts operands to int

sorry for my misunderstanding
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Aug 13 01:05:46 2022 UTC