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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
24 + 42 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 15:01:29 2024 UTC