php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4449 Mod computation error!
Submitted: 2000-05-15 04:48 UTC Modified: 2001-02-10 16:03 UTC
From: ukustar at kimo dot com dot tw Assigned:
Status: Closed Package: Other
PHP Version: 3.0.16 OS: FreeBSD
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: ukustar at kimo dot com dot tw
New email:
PHP Version: OS:

 

 [2000-05-15 04:48 UTC] ukustar at kimo dot com dot tw
$a=2.01;
echo ($a*100)%10;
//output is "0", but it should be "1"
$a=2.02;
echo ($a*100)%10;
//output is "2", this is correct!
//I found most float variable are correct, 
//but few are incorrect.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-10 16:03 UTC] jimw@php.net
rounding errors happen when doing floating point math, depending on your system.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC