Jump to content

Alfred calculator: negative exponent bug

Recommended Posts

When executing negative exponents in parenthesis numbers are often inconsistent. I guess it could be the notation's way of interpreting order of operations but I'd expect all of these to work the same way. At the very least, I'd expect the first screenshot here to be correct, ie. -2 to the power of 4 should equal 16.





Not sure if this helps, but it could be that the interpreter is evaluating the negative sign as a subtraction operator and putting precedence on the exponent operation first. ie. it's trying to respect PEMDAS but the negative symbol should not be treated an operator, per se. It should applied to any int/float directly following it before executing operations in normal PEMDAS order.


In case anyone's not familiar with the acronym:










Edited by sudopeople
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...