WP-34S: # constant in exponent



Post: #2

In debugging a program, I found that I had used:

1
EEX
# nn

It did not do what I expected. Is there a specific reason why # constants cannot be used for exponents, or did it just not make it into the design?


Post: #3

I can guess why, but that question goes to Pauli.

d:-)

Post: #4

Marcel,

the #nnn shortcut enters an integer and quits digit entry before and after the command. Thus it cannot be combined with regular digit entry. So the sequence...

 1
EEX
#123
...does not return 1E123. Instead, it enters two different values: "1 EEX" equals 1 and #123 is, well, 123. So you will end up with 1 in Y and 123 in X. That's the way it is supposed to work. And it is consistent, since you cannot use...
 1
#234
...to enter 1234 either. Or even think of this one:
#123
#456
Of course this will not produce a six-digit integer like 123456. ;-)

By the way, your example can simply be coded as

 #001
SDR nn
That's even shorter.

Dieter

Post: #5

Dieter got it right.

Consider EEX [pi]. What should this do?

The # nnn commands are constants. They terminate command line input and raise the stack usually. The are not an extension of keyboard digit input.


- Pauli


Forum Jump: