Hello
In BcNumber::int() at line 141, is the following code
if (bccomp(strval(PHP_INT_MAX), $this->value, 0) === 1) {
throw new \DomainException('Stored BcNumber cannot be converted to signed PHP integer, exceeds PHP_INT_MAX');
}
bccomp will return 1 if the first parameter is larger that the second parameter. So in this code, an exception will be thrown if PHP_INT_MAX is greater than $value, which does not make sense.
Should it perhaps be comparing to -1?
if (bccomp(strval(PHP_INT_MAX), $this->value, 0) === -1) {
Thank you for your efforts.
Regards, Jason.
Hello
In
BcNumber::int()at line 141, is the following codebccompwill return 1 if the first parameter is larger that the second parameter. So in this code, an exception will be thrown if PHP_INT_MAX is greater than $value, which does not make sense.Should it perhaps be comparing to -1?
Thank you for your efforts.
Regards, Jason.