#39262 [Opn]: intval(0.1+0.7) function failed

From: Date: Thu, 26 Oct 2006 08:48:04 +0000
Subject: #39262 [Opn]: intval(0.1+0.7) function failed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-103997@lists.php.net to get a copy of this message
 ID:               39262
 User updated by:  cjjer at hotmail dot com
-Summary:          intval function failed
 Reported By:      cjjer at hotmail dot com
 Status:           Open
 Bug Type:         Math related
 Operating System: windows2k
-PHP Version:      5.1.6
+PHP Version:      5.1.X
 New Comment:

[code]
for($i=0.0; $i<1;){
	echo intval(($i+0.10)*10.0).'<br/>'; 
	$i=$i+0.1;
}
[/code]


Previous Comments:
------------------------------------------------------------------------

[2006-10-26 08:43:33] cjjer at hotmail dot com

Description:
------------
intval function failed ;for intval((0.1+0.7)*10) not is 8 ,but 7.

Reproduce code:
---------------
1
2
3
4
5
6
7
7
9
9
10


Expected result:
----------------
1
2
3
4
5
6
7
8
9
9
10


Actual result:
--------------
1
2
3
4
5
6
7
7
9
9
10



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39262&edit=1


Thread (3 messages)

« previous php.bugs (#103997) next »