2*-0.3+0.6 =1.1102230246252E-16 Who knows why?
孙博
孙博 2020-06-12 03:53:48
0
0
962

Displays -0.3*2 0.6=1.1102230246252E-16 instead of zero, who knows why? Please give me some advice

Screenshot from 2020-06-11 20-51-54.png##

$x = [3, 0, 2];

$tArr = [0.2, 0.3, - 0.3];

$s = 0;

foreach ($x as $k => $e) {

$s = $ e * $tArr[$k];

echo $s . PHP_EOL;

}

孙博
孙博

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template