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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: orangejasmine at hotmail dot com
New email:
PHP Version: OS:

 

 [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: Fri Apr 19 10:01:28 2024 UTC