Post Reply 
HP49-50G : Matrix & Strings
09-28-2022, 04:58 AM
Post: #2
RE: HP49-50G : Matrix & Strings
(09-27-2022 11:18 PM)Gil Wrote:  ...Because when executing now
« -105 CF { 2 2 } RANM INV DUP —>STR OBJ—> SAME
»
though apparently the same Matrixes, they are in fact somewhat different (SAME gives now 0).

Curiously the subtraction does not give zero when the elements are negative.

Could somebody tell me what is happening by adding strings and removing them?

This is an unintended consequence of how different parts of the calculator's firmware construct symbolic objects containing negative integers.

Consider that there are multiple ways for the simple rational -1/7 to be represented internally on the 50g. Here are two of them:

SYMBOL
ZINT -1
ZINT 7
x/
;


and

SYMBOL
Z1_
xNEG
Z7_
x/
;


These look the same on the stack, but the bit patterns are different between them, so SAME being executed on those two would result in 0.

In your specific example, converting the symbolic rational to a string, then performing OBJ-> to compile the string back into a symbolic, you start out with something like the former and end up with something like the latter.

This problem is not limited to SAME. Even replacing SAME with == won't get around this.

Note that I'm not trying to justify this, just to show what's happening. Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP49-50G : Matrix & Strings - Gil - 09-27-2022, 11:18 PM
RE: HP49-50G : Matrix & Strings - DavidM - 09-28-2022 04:58 AM
RE: HP49-50G : Matrix & Strings - Gil - 09-28-2022, 07:27 AM
RE: HP49-50G : Matrix & Strings - DavidM - 09-28-2022, 03:28 PM
RE: HP49-50G : Matrix & Strings - Gil - 09-28-2022, 09:56 PM
RE: HP49-50G : Matrix & Strings - DavidM - 09-28-2022, 10:35 PM



User(s) browsing this thread: 1 Guest(s)