Coder-Spirit / php-bignumbers

A robust library to handle immutable big numbers inside PHP applications
MIT License
131 stars 29 forks source link

abs method doesnt work with long negative numbers. #70

Open bnd170 opened 5 years ago

bnd170 commented 5 years ago

got this value -2.689785E + 23 and i need convert it to absolute before work with him.

When abs method is used, it returns0. I was checking why and it's about that abs checks if number is zero before calladditiveInverse, that method also check if value is zero.

The scale with that number is -1 automaticaly, then the check of isZero always returns true.