Two previous tickets have resolved other division by zero issues in the innerLog10 method, however we've encountered another when dealing with Decimals created from floats when the precision is being calculated to a higher value than the 'length'. This results in a negative $value_log10_approx which triggers a division by zero warning in \bcdiv:
To replicate:
$x = Decimal::fromFloat(1.001);
// PHP Warning: bcdiv(): Division by zero in /vendor/litipk/php-bignumbers/src/Decimal.php on line 1159
$x->div(Decimal::fromFloat(1.0));
Two previous tickets have resolved other division by zero issues in the innerLog10 method, however we've encountered another when dealing with Decimals created from floats when the precision is being calculated to a higher value than the 'length'. This results in a negative
$value_log10_approx
which triggers a division by zero warning in\bcdiv
:To replicate: