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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

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 Nov 30 07:01:28 2024 UTC