|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #8250 % calculation error
Submitted: 2000-12-14 04:22 UTC Modified: 2000-12-14 04:55 UTC
From: erwinba at 163 dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.3 OS: Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: erwinba at 163 dot net
New email:
PHP Version: OS:


 [2000-12-14 04:22 UTC] erwinba at 163 dot net
Reference this program :
$bb = $aa % 1000000000;
echo "$aa,$bb<br>\n";
$cc = $aa - floor($aa/1000000000)*1000000000;
echo "$aa,$cc<br>\n";

The result like the following :

Because $aa is a bigint, so $bb will return a negative,
but the $cc is a normal result.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-14 04:55 UTC]
You cannot reliably do integer operations on numbers that do
not fit signed long. Use GMP extension for that.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 23:01:26 2023 UTC