davidedc / Algebrite

Computer Algebra System in Javascript (Typescript)
http://algebrite.org
MIT License
966 stars 59 forks source link

fix #144: bug in rational powers of -1 #170

Open ksthicke opened 1 year ago

ksthicke commented 1 year ago

The previous code seemed to be assuming that the rational exponent a/b satisfied 0 <= a < 2*b, but of course this does not have to be true. I also removed the code that separated the 0 <= a <= b and b < a < 2b cases because I didn't see the reason for the difference. The output seems to always be the desired outcome with this new simplified code.