HP 50g Graphing manual Converting Between Number Bases, `Oaply K, Techniques used in nBASE

Models: 50g Graphing 48gII Graphing

1 693
Download 693 pages 23.18 Kb
Page 102
Image 102

 

Program:

Comments:

 

 

 

 

NEXT

Repeat loop for the next row.

 

n →LIST

Gather rows into a list, forming a list of lists

 

 

(symbolic pseudoarray).

 

»

Close the local variable structure and end the

 

END 1 CF

IFERR…THEN…END structure. Clear flag 1

 

 

before exiting the program.

 

»

 

 

»

 

 

`OAPLY K

Stores the program in APLY.

 

 

Checksum: # 11132d

 

Bytes:

314

 

Example: Apply the function, f(x) = Ax37 to each element x of the vector [ 3 2 4 ].

32W†4` ‚Å 3 QA *7 -

`J %APLY% H#DISP ˜˜

(select small stack display to see all vector elements.)

Converting Between Number Bases

nBASE converts a positive decimal number (x) into a tagged string representation of the equivalent value in a different number base (b). Both x and b must be real numbers. nBASE automatically rounds both arguments to the nearest integer.

Level 2

Level 1

Level 1

 

 

 

 

x

b

x baseb: "string"

 

 

 

 

Techniques used in nBASE

String Concatenation and Character Manipulation. nBASE makes use of several string and character manipulation techniques to build up the result string.

Tagged Output. nBASE labels (“tags”) the output string with its original arguments so that the output is a complete record of the command.

Indefinite Loops. nBASE accomplishes most of its work using indefinite loops — both DO...UNTIL...END and WHILE...REPEAT...END loops.

222 RPL Programming Examples

Page 102
Image 102
HP 50g Graphing, 48gII Graphing manual Converting Between Number Bases, `Oaply K, Ô3†2W†4` ‚Å 3 QA *7 `J %APLY% H#DISP ˜˜