Coder-Spirit / php-bignumbers

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

[WIP] Fix `pow` behavior on negative numbers #24

Open castarco opened 9 years ago

castarco commented 9 years ago

Currently, making $a->pow($b) can produce errors if $a is a negative value. To fix the problem it's a good idea to solve the bugs #21 and #22 .

castarco commented 9 years ago

Partly done (negative numbers with integer exponents behave well), now depends on #22 (the exponent must be understood as if it's a rational number, check the divisor, and if it's even then throw an exception, but if it's odd, the pow can be computed).