Why does -2^2 compute to -4 on my HP Prime?
|
02-09-2024, 01:30 PM
Post: #19
|
|||
|
|||
RE: Why does -2^2 compute to -4 on my HP Prime?
(02-08-2024 05:53 PM)chromos Wrote: 1) What is the result of the expression 0-2^2? If we add MOD operator to the mix, zero make a difference. Unary minus has higher precedence than binary minus, with MOD in-between. >>> 0-10%7, -10%7 (-3, 4) lua> 0-10%7, -10%7 -3 4 (02-09-2024 01:34 AM)john gustaf stebbins Wrote: I've learned to be generous with the use of explicit parentheses when working on the Prime. That's a good advice! For clarity, -10%7 should really be written as (-10)%7 Practical C Programming preface Wrote:This book stresses simple, practical rules. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)