The parameter for index 5 needs to be 0 in below code.
But The value for echo($a[5])
comes 1.2325951644078E-32
.
The loop prints correct values for all other parameters except for 5th index (which needs to be 0 according to me).
Can anybody tell me why is that happening??
for($x=-2;$x<2.1;$x+=0.4){
$a[] = $x*$x;
}
echo($a[5]); //this is not printing 0 why?
Output is:-
Array
(
[0] => 4
[1] => 2.56
[2] => 1.44
[3] => 0.64
[4] => 0.16
[5] => 1.2325951644078E-32
[6] => 0.16
[7] => 0.64
[8] => 1.44
[9] => 2.56
[10] => 4
)