php-bignumbers icon indicating copy to clipboard operation
php-bignumbers copied to clipboard

Default value for $scale should not be null (arccos, arctan, arcsec, arccsc, tan, cotan etc.)

Open gregor-tb opened this issue 5 years ago • 0 comments

public function arccos(int $scale = null): Decimal

$scale is null here by default, but used like (int) 0. This is working in the additions $scale + 2 etc., but crashes on calling round(int) method, which does not accept null.

But later it is checked for explicit null value

$scale = ($scale === null) ? 32 : $scale;

gregor-tb avatar Aug 14 '19 14:08 gregor-tb