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
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:
33 - 24 = ?
Subscribe to this entry?

 
 [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 Mar 28 15:01:29 2024 UTC