# HP 48gII Advanced User's Reference Manual Page 101

Graphing calculator.

nBASE program listing
Program:
«
1 CF 0 RND SWAP 0 RND
RCLF
 b n f
«
STD n LOG b LOG /
10 RND
IP n 0
 i m k
«
""
DO
'm' EVAL b i
'k' EVAL - ^
DUP2 MOD
IF DUP 0 ==
'm' EVAL b Š
AND
THEN 1 SF
END 'm' STO
/ IP
IF DUP 10 Š
THEN 55
ELSE 48
END + CHR
+ 'k' 1 STO+
Clear flag 1, round both arguments to
integers and recall flag settings.
Store the base, number and flag settings
in local variables.
Begin the outer local variable structure.
Sets "standard" display mode and
computes the ratio of the common
logarithms of number and base.
Rounds result to remove imprecision in
last decimal place.
Find the integer part of log ratio, recall
the original number, and initialize the
counter variable k for use in the
DO...UNTIL loop.
Store the values in local variables.
Begin inner local variable structure, enter
an empty string and begin the
DO...UNTIL...END loop.
Compute the decimal value of the
(i
k) th position in the string.
Makes a copy of the arguments and
computes the decimal value still
remaining that must be accounted for by
other positions.
Is the remainder zero and m b?
If the test is true, then set flag 1.
Store the remainder in m. Compute the
number of times the current position-
value goes into the remaining decimal
value. This is the "digit" that belongs in
the current position.
Is the "digit"
10?
Then convert the digit into a alphabetic
digit (such as A, B, C, ...).
Append the digit to the current result
string and increment the counter variable
k.
RPL Programming Examples 2-23

49g+