Curiosity about HP 50 and x^2 vs x^y
|
11-08-2023, 08:39 PM
Post: #1
|
|||
|
|||
Curiosity about HP 50 and x^2 vs x^y
Hi to all and sorry for my English.
I’m not a mathematician but I like to Collect old Calculators. I’ve found a HP 50g and I’m playing with it… I’ve got a question: Why the x^2 command evoke the SQ function and not a classic power of 2 (with the X^y I’ve got i.e. 3^2 written in the Classic way)? Sale result, no problem about that, it’s Just a bit difficult to identify a power of two written in this way but I suppose it’s Just a matter of habit… Thanks and have a nice day! |
|||
11-09-2023, 07:22 PM
(This post was last modified: 11-09-2023 07:23 PM by cdmackay.)
Post: #2
|
|||
|
|||
RE: Curiosity about HP 50 and x^2 vs x^y
welcome to the forum!
I'm not sure… The SQ() function has been around since the 28C, which also had the ^ power function. The reason for having both may relate to on which objects they operate. For example, the 28S manual suggests that SQ may be used on arrays/matrices, but ^ may not. I don't have batteries in my 28S right now, so can't test that. So that might be why a separate SQ function was introduced for ^2, versus ^n. The 50g ^ function will operate on matrices, so the distinction may no longer be required, but the SQ function would be retained for backward compatibility with older RPL programs. Or there may be better reasons I'm forgetting… Cambridge, UK 41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot/C47 Casio, Rockwell 18R |
|||
11-09-2023, 07:25 PM
Post: #3
|
|||
|
|||
RE: Curiosity about HP 50 and x^2 vs x^y
Also, of course the SQ function needs only one stack level, versus 2 for the ^ power function. But that's not a big deal on RPL units.
Cambridge, UK 41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot/C47 Casio, Rockwell 18R |
|||
11-09-2023, 07:51 PM
(This post was last modified: 11-09-2023 08:03 PM by John Keith.)
Post: #4
|
|||
|
|||
RE: Curiosity about HP 50 and x^2 vs x^y
One major reason seems to be speed. On my 50g, applying SQ to a list of approximate numbers from 1..100 takes about 180 ms. Applying 2. ^ to the same list takes about 790 ms. This tells me that SQ is using a different method than the ^ function. I would guess that SQ is simply DUP * internally.
Edit: I just checked by changing 2. ^ to 3.1416 ^ and execution time only increased by about 5%. Thus I am guessing here that ^ uses exponentiation for any real arguments. |
|||
11-09-2023, 08:32 PM
(This post was last modified: 11-10-2023 02:40 AM by Johnh.)
Post: #5
|
|||
|
|||
RE: Curiosity about HP 50 and x^2 vs x^y
Just from the user's perspective, for most people, x^2 is used much more often than x^y, so more direct access to it is valuable. That being said, with x^2 as a shifted function, and y^x as a primary function on a button, both may be two key strokes. (eg on a 15c and many others, it's g, x^2, compared to 2, y^x)
|
|||
11-09-2023, 11:59 PM
(This post was last modified: 11-10-2023 12:05 AM by carey.)
Post: #6
|
|||
|
|||
RE: Curiosity about HP 50 and x^2 vs x^y
(11-09-2023 07:25 PM)cdmackay Wrote: Also, of course the SQ function needs only one stack level, versus 2 for the ^ power function. But that's not a big deal on RPL units. The above sounds reasonable. A different option of a superscript 2 would have used only one stack level and only one character, but would have needed 5 vertical pixels to be readable so wouldn't be clearly identifiable as a superscript on the screen in a program. SQ is an efficient two-character one stack level option on a screen with limited pixel character height. |
|||
11-10-2023, 02:59 AM
(This post was last modified: 11-10-2023 03:44 AM by DavidM.)
Post: #7
|
|||
|
|||
RE: Curiosity about HP 50 and x^2 vs x^y
There's lots of potential questions being answered here, but I'm wondering if we may have missed the meaning of what Camionsauro was actually asking
If the 50g is still set to the default algebraic mode (or you start editing an algebraic expression in either mode), pressing the \(x^2\) key results in "SQ()" being added to the command line instead of "^2" being appended to the previous object. Since SQ is a function, it places "SQ()" in the command line and leaves the cursor flashing between the parentheses. To see how different the treatment of the \(x^2\) and \(y^x\) keys are, try putting your 50g in algebraic mode, or simply start building an algebraic expression (using tick marks) with those keys. Since most of us use RPN mode instead of algebraic, we aren't as likely to see the effect that Camionsauro is referring to. Then again, I may be the one who is confused here. But I believe Camionsauro may either have his 50g in algebraic mode, or perhaps he’s editing an algebraic. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: