Post Reply 
(41) HP-16C+ - 16X=0? issue
06-16-2023, 04:29 PM
Post: #6
RE: (41) HP-16C+ - 16X=0? issue
Sorry, if I didn't explained it clearly.

Quote:Lines 02 - 05 in the TST program set the word size to 2, why is that intended??
I just choose the word size for simplicity, because there are only four numbers. In the one complement representation 00B and 11B are both zero, 01B is one and 10B is minus one. The outcome of the program itself is independent of word size if you set the starting value accordingly.

Quote:But X=0? returns "NO", which I believe it is correct because -0d is not the same as 0d
I just set the expected outcome (flag 05) to that of a physical HP-16C. Since 00B and 11B are both zero, on the HP-16C the "X=0?" test give true and the other "X...?" tests are consistent with that. Interestingly the "X=Y?" test with y: 11B and x: 00B on the stack results in "NO", which is correct also for the 16C-library.

Remark:
I don't use the one complement representation, myself. I was just curious how the HP-16C and the 16C-library behave for this special case.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (41) HP-16C+ - 16X=0? issue - Bernd Grubert - 06-16-2023 04:29 PM



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