decimal - PHP Issue Adding 0.001 to 0.001? -


hi cannot seem able work out how incrementally add small number?

$val    = 0.000000001; $add    = 0.000000001; ($i=0; $i < 100; $i++) {     $val = bcadd($val, $add, 9);     echo $val.'<br>'; }  // echo // 0.000000000 // 0.000000000 // . . . 

can help??

<?php $val    = "0.000000001"; $add    = "0.000000001"; ($i=0; $i < 100; $i++) {     $val = bcadd($val, $add, 9);     echo $val.'<br>'; } exit;  ?> 

it works :) collegues explained bacadd needs arguments string.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -