davedelong / DDMathParser

String → Number
MIT License
854 stars 153 forks source link

Updated to fix -neg num for cube root #173

Closed ysriser closed 4 years ago

ysriser commented 4 years ago

Hi there, I was working on an app and realised that if I did ∛ any negative number, eg ∛-27, it will return NaN. However, using nthroot(-27,3) returns the correct result (-3).

Searched through past closed issues and realised that you have fixed the issue on nthroot but may have missed out the same change on ∛/cuberoot. I did some minor changes to the ∛ code based on the nthroot and it seemed to be working fine.

Submitting a pull request to help everyone.

Also, would like to take the chance to thank you for the amazing library :)

davedelong commented 4 years ago

Good catch! Thank you!!