ISibboI / evalexpr

A powerful expression evaluation crate 🦀.
MIT License
313 stars 50 forks source link

Raising a number to a negative power does not work as expected #120

Closed 012e closed 1 year ago

012e commented 1 year ago

3^-2 is 0.111... but eval("3^-2") returns -9 However eval("3^(-2)") returns the right result

Sorry for my bad English!

ISibboI commented 1 year ago

Good point! I am happy to accept a pull request on this one.

On Mon, 27 Mar 2023, 17.56 Pham Nhat Huy, @.***> wrote:

3^2 is 9 3^-2 is 1/9 but eval("3^-2)" returns -9

— Reply to this email directly, view it on GitHub https://github.com/ISibboI/evalexpr/issues/120, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASATXWQ6P63BVQNBP5IN5DW6GTCHANCNFSM6AAAAAAWJIFJKU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ISibboI commented 1 year ago

Fixed in 9.0.0