
×InformationFix Windows 10 Update Issues
Resolve Windows 10 related issues for your HP computers or printers by HP Windows 10 Support Center

×InformationFix Windows 10 Update Issues
Resolve Windows 10 related issues for your HP computers or printers by HP Windows 10 Support Center
 HP Community
 >
 Other Products
 >
 Calculators
 >
 Calculating the square of a negative number.
 Mark Topic as New
 Mark Topic as Read
 Float this Topic for Current User
 Bookmark
 Subscribe
 Mute
 Printer Friendly Page
Create an account on the HP Community to personalize your profile and ask a question
Calculating the square of a negative number.
09122017 12:26 PM
The HP 300s + Scientific Calculator incorrectly calculates the square of the negative number. After squaring the negative number, the result is negative. Mathematical nonsense.
Where am I making a mistake?
09122017 03:42 PM
I would beleive your problem is that the  is being applied in a lower priority then ^2
So your input is being interpreted as (5)^2 = (25)
You can see that this actually working by typing 5 =, then do x^2 to get Ans^2. Evaluating that does return 25 like you'd expect.
Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
09122017 08:32 PM
In case you are wondering whether only HP does this, please note that ALL modern calculators that let you enter 5² as 5² on a command line return 25 as the answer. I have a bunch of Casio and TI and Sharp calculators, and they all return 25, for the reason given by Tim above.
In fact, I'd go so far as to say that any calculator that returns positive 25 is buggy and not to be trusted, since it does not follow the standard order of operations (powers before negations).
Disclaimer: I don't work for HP. I'm just a calculator fanatic.
09122017 11:17 PM
Hello,
I understand the OP's frustration here. I have been struggeling with the same issue for a long time and have had to just accept this "modern" mathematic notation.
First let me abound in Joe's direction. The way the 300s does it is the standard way and is "correct" within the current math notation standards.
Here is how I rationalized it for myself.
Numbers can be positive or negative. In the past, the () key (or equivalent such as a normal  in front of the number that is not a negation operator) would be concidered as part of the number and indicate it's sign.
However, this is NOT how current math systems work anymore. They now concider the  as a prefix unary opeartor (ie an operation that operate on a single object and that is placed in front of said object). (² is a unary postfix opeartor. an operator that operates on a single object and placed after said object).
In lots of ways, this is way more powerfull than the old  as the operator can not apply to any type of mathematic object, including matrices, symbolic object, stuff in parenthesis...
However, there is a side effect in that priority of oeperators now affects the (). and it's priority is lower than that of ² (no clue why honnestly).
The net effect of this is what you are seeing here. 2²=4 and not 4! You can see it yourself using the leading math package: https://www.wolframalpha.com/input/?i=2%C2%B2
Now, in lots of waysn the choise of operator priority is arbitrary, and I honneslty do not know why this is the order that was chosen by the math comunity. It definitely feel strange in this case, but, as I said, this is the standard.
Cyrille
Didn't find what you were looking for? Ask the community