php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12615 Integer?
Submitted: 2001-08-07 06:48 UTC Modified: 2001-08-07 09:22 UTC
From: stjepan at novi-arcus dot hr Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.0.5 OS: Win2000
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: stjepan at novi-arcus dot hr
New email:
PHP Version: OS:

 

 [2001-08-07 06:48 UTC] stjepan at novi-arcus dot hr
<?php
for ($i=1; $i<=10; $i+=0.01) 
{
	print "<br>$i";
}
?>

and the output look like ...

1
1.01
1.02
1.03
.
.
.
.
4.3
4.31
4.32
4.33
4.34
4.35
4.36
4.37
4.38
4.3899999999999
4.3999999999999
4.4099999999999
4.4199999999999
4.4299999999999
4.4399999999999

.
.
.
.
.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-07 09:22 UTC] phildriscoll@php.net
Welcome to the world of floating point arithmetic on 
computers. Internal binary representations cannot exactly 
match the decimal values you require.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC