Why does this for loop stop before reaching the intended value?

firatkalyoncu

New Member
\[code\]for($i=0;$i<=2;$i+=0.1){ echo $i."<br>";}\[/code\]The result I wish is:\[code\]00.10.20.30.40.50.60.70.80.911.11.21.31.41.51.61.71.81.92\[/code\]What happens instead is the loop reaches \[code\]1.9\[/code\] and stops. Why?
 
Back
Top