Equations, units and things.. (plus42)

General discussion about calculators, SwissMicros or otherwise
Thomas Okken
Posts: 1098
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Equations, units and things.. (plus42)

Post by Thomas Okken »

Thomas Okken wrote:
Tue Aug 16, 2022 4:23 pm
dm319 wrote:
Mon Aug 15, 2022 7:27 pm
2. Do variables and units need to be enclosed in brackets?

This doesn't work:

A=B_"km"/C_"h"

But this does:

A=B_"km"/(C_"h")
The underscore is a multiplicative operator, so it has the same precedence as * and /, that's why the parentheses are needed in your example. I should mention that in the documentation.
I made a simple code change, giving _ the same precedence as ^. With this change, code like A=B_"km"/C_"h" works as expected.

This change will be in the next release.

It would be even better if _ had even higher precedence, higher than ^, although this change will do what's expected in most cases, i.e. 10_"km"^2 will evaluate to 100_km^2 because in the HP equation language, exponentiation is left-associative. So I'm not completely sure if it's a problem to have _ and ^ at the same level of precedence.

Changing the precedence is tricky because the Plus42 parser is completely hand-written, that is, I didn't use a parser generator, and so changes to the grammar require non-trivial code changes, and I don't deal with parser logic often, so it tends to give me a headache. But if anyone can come up with examples of why _ should have higher precedence than ^, I will take care of it.
jwiede
Posts: 44
Joined: Mon Oct 18, 2021 11:17 pm
Location: San Jose, CA USA

Re: Equations, units and things.. (plus42)

Post by jwiede »

Thomas,

Just a head's up: I posted bugs on the plus42destop repo area on github for the difficulties I'm having with 1.0.11 (completely unable to locate the new "A...F" function, neither in CATALOG nor ASSIGN, etc.) Also seeing some odd default behavior from top (blank) row of keys by default (they're mimicking the row "Σ+" through "XEQ").

Thanks in advance for any guidance!

-John W
DM42, DM16L, and a menagerie of HPs thanks to CAS (Calc Acq Syndrome)!
Thomas Okken
Posts: 1098
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Equations, units and things.. (plus42)

Post by Thomas Okken »

jwiede wrote:
Thu Oct 06, 2022 8:57 pm
(completely unable to locate the new "A...F" function, neither in CATALOG nor ASSIGN, etc.)
It's in CATALOG → MISC, but it will move to CATALOG → BASE, where it logically belongs, in the next release.
Note that CATALOG in Plus42 and Free42 is a multi-row menu; CATALOG → FCN only contains the original HP-42S set of functions, while all the additional functions are grouped in several submenus in the added rows at the top level of the CATALOG menu.

Also note that, if you're trying to XEQ or ASSIGN the A...F function, it should be spelled with three periods, not an ellipsis character.
jwiede wrote:
Thu Oct 06, 2022 8:57 pm
Also seeing some odd default behavior from top (blank) row of keys by default (they're mimicking the row "Σ+" through "XEQ").
That's intentional, or at least, not something I consider a bug:

https://thomasokken.com/plus42/#top-row
HPMike
Posts: 439
Joined: Fri Jul 21, 2017 11:01 pm
Location: DFW, Texas

Re: Equations, units and things.. (plus42)

Post by HPMike »

Thomas Okken wrote:
Thu Oct 06, 2022 9:28 pm
jwiede wrote:
Thu Oct 06, 2022 8:57 pm
(completely unable to locate the new "A...F" function, neither in CATALOG nor ASSIGN, etc.)
It's in CATALOG → MISC, but it will move to CATALOG → BASE, where it logically belongs, in the next release.
Note that CATALOG in Plus42 and Free42 is a multi-row menu; CATALOG → FCN only contains the original HP-42S set of functions, while all the additional functions are grouped in several submenus in the added rows at the top level of the CATALOG menu.

Also note that, if you're trying to XEQ or ASSIGN the A...F function, it should be spelled with three periods, not an ellipsis character.
jwiede wrote:
Thu Oct 06, 2022 8:57 pm
Also seeing some odd default behavior from top (blank) row of keys by default (they're mimicking the row "Σ+" through "XEQ").
That's intentional, or at least, not something I consider a bug:

https://thomasokken.com/plus42/#top-row
Thomas,

On your website the explanation for the top row keys reads:

"Why is the top row of the keyboard acting weird?

The top row of the standard Plus42 skins is actually mapped like the top row of the original Free42 and HP-42S keyboard. This means that when there is no active menu, the top row performs the same functions as the third row of the Plus42 standard keyboard. This is not a bug."

Did you mean "Free42" ?
DM15L, S/N 00548. DM42, SN: 00159. DM41X, SN: 00973. DM32, SN 00054.
Thomas Okken
Posts: 1098
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Equations, units and things.. (plus42)

Post by Thomas Okken »

No, I didn't. What I wrote is correct.
HPMike
Posts: 439
Joined: Fri Jul 21, 2017 11:01 pm
Location: DFW, Texas

Re: Equations, units and things.. (plus42)

Post by HPMike »

Thomas Okken wrote:
Thu Oct 06, 2022 10:33 pm
No, I didn't. What I wrote is correct.
OK, you lost me.
DM15L, S/N 00548. DM42, SN: 00159. DM41X, SN: 00973. DM32, SN 00054.
Thomas Okken
Posts: 1098
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Equations, units and things.. (plus42)

Post by Thomas Okken »

I'm sorry to hear that, but I assure you I'm at least as mystified about your complaint as you appear to be about what I wrote.
HPMike
Posts: 439
Joined: Fri Jul 21, 2017 11:01 pm
Location: DFW, Texas

Re: Equations, units and things.. (plus42)

Post by HPMike »

Thomas Okken wrote:
Thu Oct 06, 2022 11:06 pm
I'm sorry to hear that, but I assure you I'm at least as mystified about your complaint as you appear to be about what I wrote.
Not a complaint, I just don't understand what you are saying. I thought you were saying that the top (blank) row of the Plus42 keyboard is meant to replicate the top third row of the Free42/HP42S standard keyboard. I guess you simply meant that the Plus42 duplicates its third row on the top row when there are no menus present. If you had not mentioned the Free42/HP42s in the first place, then this would have been clear to me.
DM15L, S/N 00548. DM42, SN: 00159. DM41X, SN: 00973. DM32, SN 00054.
Thomas Okken
Posts: 1098
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Equations, units and things.. (plus42)

Post by Thomas Okken »

Yes, exactly. The top row of the Plus42 keyboard replicates the third row of the Plus42 keyboard when no menu is active.

The third row of the Plus42 keyboard, not of the Free42 keyboard.

I've re-read that FAQ entry several times now and I still don't see anything wrong with it. Changing the word you highlighted from Plus42 to Free42 would make it wrong.
HPMike
Posts: 439
Joined: Fri Jul 21, 2017 11:01 pm
Location: DFW, Texas

Re: Equations, units and things.. (plus42)

Post by HPMike »

Thomas Okken wrote:
Thu Oct 06, 2022 11:38 pm
Yes, exactly. The top row of the Plus42 keyboard replicates the third row of the Plus42 keyboard when no menu is active.

The third row of the Plus42 keyboard, not of the Free42 keyboard.

I've re-read that FAQ entry several times now and I still don't see anything wrong with it. Changing the word you highlighted from Plus42 to Free42 would make it wrong.
Why not just remove the top line referencing the Free42/HP42s keyboard, which is really irrelevant, confusing and unnecessary, and just say something like "When there is no active menu, the top row performs the same functions as the third row of the Plus42 standard keyboard. This is not a bug." ?
DM15L, S/N 00548. DM42, SN: 00159. DM41X, SN: 00973. DM32, SN 00054.
Post Reply