Save the edited version of SPH in the variable. Then, to verify that the changes were saved, view SPH in the command line.

`J!%SPH% @%SPH% ˜ Press − to stop viewing. Creating Programs on a Computer It is convenient to create programs and other objects on a computer and then load them into the calculator. If you are creating programs on a computer, you can include “comments” in the computer version of the program.

To include a comment in a program: Enclose the comment text between two @ characters. or Enclose the comment text between one @ character and the end of the line. Whenever the calculator processes text entered in the command line — either from keyboard entry or transferred from a computer — it strips away the @ characters and the text they surround. However, @ characters are not affected if they’re inside a string.

Using Local Variables The program SPH in the previous example uses global variables for data storage and recall. There are disadvantages to using global variables in programs: After program execution, global variables that you no longer need to use must be purged if you want to clear the VAR menu and free user memory. You must explicitly store data in global variables prior to program execution, or have the program execute STO. Local variables address the disadvantages of global variables in programs. Local variables are temporary variables created by a program . They exist only while the program is being executed and cannot be used outside the program. They never appear in the VAR menu. In addition, local variables are accessed faster than global variables. (By convention, this manual uses lowercase names for local variables.) A compiled local variable is a form of local variable that can be used outside of the program that creates it. See “Compiled Local Variables” on page 110 for more information.

Creating Local Variables In a program, a local variable structure creates local variables.

To enter a local variable structure in a program: 1. Enter the → command (press @é). 2. Enter one or more variable names. 3. Enter a defining procedure (an algebraic or program object) that uses the names.

« → name 1 name 2 … name n ' algebraic ' » or « → name 1 name 2 … name n « program » »

When the → command is executed in a program, n values are taken from the stack and assigned to variables name 1 name 2, …. name n.

RPL Programming 17

Example: Enter a program SPH that calculates the volume of a spherical cap of height h within a sphere of radius R using values stored in variables H and R.

1 2 V = ---πh ()3r– h 3

In this and following chapters on programming, “stack diagrams” show what arguments must be on the stack before a program is executed and what results the program leaves on the stack. Here’s the stack diagram for SPH . Level 1 → Level 1

→ volume

The diagram indicates that SPH takes no arguments from the stack and returns the volume of the spherical cap to level 1. ( SPH assumes that you’ve stored the numerical value for the radius in variable R and the numerical value for the height in variable H. These are global variables — they exist outside the program.) Program listings are shown with program steps in the left column and associated comments in the right column. Remember, you can either press the command keys or type in the command names to key in the program. In this first listing, the keystrokes are also shown. Program: Keys: Comments: « @% Begins the program. '1/3 O1 /3 Begins the algebraic expression to calculate the volume.

*π*H^2 *!ì Multiplies by ̟h2. *H Q2 *(3*RH)' *!Ü Multiplies by 3 r h , completing 3 * R the calculation and ending the H ™™ expression.

→NUM @ï Converts the expression with π to a number. » Ends the program. ` Puts the program on the stack. OSPH K Stores the program in variable SPH .

RPL Programming 15

Fibonacci Numbers...... 21

FIB1 (Fibonacci Numbers, Recursive Version)...... 21 FIB2 (Fibonacci Numbers, Loop Version...... 22 FIBT (Comparing ProgramExecution Time) ...... 24 Entering and Executing Programs Displaying a Binary Integer...... 25 PAD (Pad with Leading Spaces)...... 25 A program is an object — it occupies one level on the stack, and you can store it in a variable. PRESERVE (Save and Restore Previous Status) ...... 26 BDISP (Binary Display)...... 27 To enter a program: Median of Statistics Data ...... 210 1. Press @%.The PRG annunciator appears, indicating programentry mode is active. %TILE (Percentile of a list)...... 210 2. MEDIAN (Median of Statistics Data)...... 211 Enter the commands and other objects (with appropriate delimiters) in order for the operations you want the Expanding and Collecting Completely...... 213 program to execute. MULTI (Multiple Execution) ...... 214 Press # to separate consecutive numbers. EXCO (Expand and Collect Completely) ...... 215 Press ™ to move past closing delimiters. Minimum and Maximum Array Elements...... 216 3. Optional: Press @ë (newline) to start a new line in the command line at any time. MNX (Minimum or Maximum Element—Version 1) ...... 216 4. Press ` to put the program on the stack. MNX2 (Minimum or Maximum Element—Version 2)...... 218 PRG Applying a Program to an Array...... 220 In Programentry mode ( annunciator on), command keys aren’t executed — they’re entered in the command Converting Between Number Bases ...... 222 line instead. Only nonprogrammable operations such as ƒ and J are executed. Verifying Program Arguments ...... 224 Line breaks are discarded when you press `. NAMES (Check List for Exactly Two Names) ...... 225 NAMES ...... 226 To enter commands and other objects in a program: Converting Procedures from Algebraic to RPN...... 227 Bessel Functions...... 229 Press the keyboard or menu key for the command or object. All commands can also be selected from the Animation of Successive Taylor’s Polynomials ...... 231 @ list. SINTP (Converting a Plot to a Graphics Object)...... 231 This guide assumes that Flag –117 is clear, so that you see menus rather than choose boxes wherever possible. Also RPN mode should Techniques used in SINTP ...... 231 be set. SETTS (Superimposing Taylor’s polynomials)...... 232 or TSA (Animating Taylor’s Polynomials)...... 233 Type the characters using the alpha keyboard. Programmatic Use of Statistics and Plotting...... 234 Refer to the calculator’s User’s Guide for how to use the alpha keyboard. Trace Mode ...... 237 In this guide an abbreviated convention is used whereby invocations of the alpha keyboard are not always shown. In the next example we InverseFunction Solver...... 238 show: Animating a Graphical Image...... 239 OVOL K where the alpha “VOL” can be entered as shown: 3. Full Command and Function Reference...... 31 O~~VOL ~K (assuming Flag –60 is clear). ABCUV...... 35 ABS...... 35 To store or name a program: ACK...... 35 ACKALL ...... 36 1. Enter the program on the stack. ACOS ...... 36 2. Enter the variable name (with ' delimiters) and press K. ACOS2S...... 37 ACOSH...... 38 You can choose descriptive names for programs. Here are some ideas of what the name can describe: ADD...... 39 The calculation or action. Examples: SPH (sphericalcap volume), SORTLIST (sort a list). ADDTMOD...... 39 The input and output. Examples: X→FX ( x to f (x) ), RH →V (radiusand height to volume). ADDTOREAL...... 310 The technique. Example: SPHLV (sphericalcap volume using local variables). ALGB...... 310 ALOG ...... 310 To execute a program: AMORT...... 311 AND...... 311 Press J then the menu key for the program name. ANIMATE...... 312 or ANS ...... 312 Enter the program name (with no delimiters) and press `. APPLY...... 313 or ARC...... 313 Put the program name in level 1 and press N. ARCHIVE...... 314 or ARG...... 314 Put the program object in level 1 and press N. ARIT...... 315 ARRY→...... 315

Contents 2 RPL Programming 13 1 →COL ...... 339 COL→ ...... 339 COL–...... 339 COL+...... 340 COLCT ...... 340 1. RPL Programming COLLECT...... 340 COLΣ...... 341 If you’ve used a calculator or computer before, you’re probably familiar with the idea of programs . Generally COMB...... 341 speaking, a program is something that gets the calculator or computer to do certain tasks for you — more than a CON...... 341 builtin command might do. In the HP 48gII, HP 49g+, and HP 50g calculators, a program is an object that does the COND ...... 342 same thing. CONIC ...... 343 CONJ ...... 343 CONLIB...... 344 Understanding Programming CONST...... 344 « » CONSTANTS ...... 344 A calculator program is an object with delimiters containing a sequence of numbers, commands, and other CONT ...... 345 objects you want to execute automatically to perform a task. CONVERT ...... 345 For example, a program that takes a number from the stack, finds its factorial, and divides the result by 2 would CORR...... 345 look like this: « ! 2 / » or COS ...... 346 COSH...... 346 « COV ...... 346 ! CR ...... 347 2 CRDIR ...... 347 CROSS ...... 347 / CSWP ...... 347 » CURL ...... 348

CYCLOTOMIC ...... 348 CYLIN ...... 348 The Contents of a Program C→PX...... 349 As mentioned above, a program contains a sequence of objects. As each object is processed in a program, the action C→R...... 349 depends on the type of object, as summarized below. DARCY...... 349 DATE...... 349 Actions for Certain Objects in Programs →DATE...... 350 Object Action DATE+...... 350 DBUG...... 350 Command Executed. DDAYS...... 351 Number Put on the stack. DEC...... 351 DECR...... 351 Algebraic or `Algebraic` Algebraic put on the stack. DEDICACE ...... 352 String Put on the stack. DEF...... 352 List Put on the stack. DEFINE...... 352 DEG...... 353 Program Put on the stack. DEGREE...... 353 Global name (quoted) Put on the stack. DELALARM ...... 353 DELAY...... 354 Global name (unquoted) Program executed . DELKEYS ...... 354 Name evaluated. DEPND...... 355 Directory becomes current. DEPTH...... 355 DERIV...... 356 Other object put on the stack. DERVX ...... 356 Local name (quoted) Put on the stack. DESOLVE...... 356 Local name (unquoted) Contents put on the stack DET...... 357 DETACH ...... 357 As you can see from this table, most types of objects are simply put on the stack — but builtin commands and DIAG→...... 358 programs called by name cause execution . The following examples show the results of executing programs containing →DIAG...... 358 different sequences of objects. DIAGMAP...... 358

Contents 4 RPL Programming 11

EXP2POW...... 379 BetaTesting ...... 63 EXPAN...... 379 CD →...... 63 EXPAND...... 380 →CD...... 64 EXPANDMOD...... 380 COMP →...... 64 EXPFIT ...... 381 CRC...... 64 EXPLN...... 381 CRLIB...... 64 EXPM ...... 381 ER...... 64 EYEPT...... 381 H→...... 64 F0λ ...... 382 FACT...... 382 →H...... 65 FACTOR ...... 382 H→A ...... 65 FACTORMOD ...... 383 H→S ...... 65 FACTORS...... 383 LC~C...... 65 FANNING...... 384 LR~R...... 65 FAST3D...... 384 →LST ...... 66 FCOEF ...... 385 MAKESTR ...... 66 FC?...... 385 PEEK...... 66 FC?C...... 385 PEEKARM...... 66 FDISTRIB...... 386 POKE...... 66 FFT...... 386 POKEARM ...... 67 FILER ...... 387 →PRG...... 67 FINDALARM ...... 387 →RAM ...... 67 FINISH...... 387 R~SB...... 67 FIX...... 387 SB~B...... 67 FLASHEVAL ...... 388 SERIAL...... 68 FLOOR...... 388 S→H ...... 68 FONT6 ...... 388 S~N...... 68 FONT7 ...... 389 SREV ...... 68 FONT8 ...... 389 →S2...... 68 FONT→...... 389 XLIB~ ...... 69 →FONT...... 389 CRLIB – Create Library Command ...... 69 FOR...... 390 Extension program...... 610 FOURIER ...... 391 MASD – The Machine Language and System RPL Compiler...... 611 FP...... 391 Introduction...... 611 FREE...... 391 Saturn ASM mode...... 619 FREEZE...... 391 ARM mode...... 630 FROOTS ...... 392 System RPL mode...... 635 FS?...... 392 Example of a Saturn assembly language program using the MASD compiler...... 638 FS?C...... 393 Example of an ARM assembly language program using the MASD compiler ...... 639 FUNCTION ...... 393 Disassemblers...... 641 FXND ...... 394 GAMMA...... 395 ASM →...... 641 GAUSS...... 395 ARM → ...... 641 GBASIS...... 395 The Entry Point Library: Extable ...... 642 GCD...... 396 nop...... 642 GCDMOD...... 396 GETNAME...... 642 GET...... 396 GETADR...... 642 GETI...... 397 GETNAMES...... 642 GOR...... 398 Library 257...... 642 GRAD...... 398 A. Error and Status Messages ...... A1 GRAMSCHMIDT ...... 399 B. Tables of Units and Constants...... B1 GRAPH ...... 399 C. System Flags...... C1 GREDUCE...... 399 D. Reserved Variables...... D1 GRIDMAP...... 3100 System Reserved Variables...... D1 →GROB...... 3100 Contents of the System Reserved Variables...... D2 GROB ...... 3101 αENTER...... D2

Contents 6 Contents 19

KER...... 3123 Series and Parallel C (2, 7) ...... 512 KERRM...... 3123 Series and Parallel L (2, 8)...... 513 KEY...... 3123 Capacitive Energy (2, 9)...... 513 KEYEVAL...... 3124 Inductive Energy (2, 10) ...... 513 →KEYTIME...... 3124 RLC Current Delay (2, 11) ...... 514 KEYTIME→...... 3125 DC Capacitor Current (2, 12) ...... 514 KGET ...... 3125 Capacitor Charge (2, 13) ...... 514 KILL...... 3125 DC Inductor Voltage (2, 14)...... 515 LABEL...... 3125 RC Transient (2, 15) ...... 515 LAGRANGE...... 3126 RL Transient (2, 16)...... 515 LANGUAGE→...... 3126 Resonant Frequency (2, 17)...... 516 →LANGUAGE...... 3126 Plate Capacitor (2, 18)...... 516 LAP...... 3127 Cylindrical Capacitor (2,19)...... 516 LAPL...... 3127 Solenoid Inductance (2, 20)...... 517 LAST ...... 3127 Toroid Inductance (2, 21)...... 517 LASTARG...... 3128 Sinusoidal Voltage (2, 22) ...... 518 LCD→ ...... 3128 Sinusoidal Current (2, 23)...... 518 →LCD ...... 3128 Fluids (3) ...... 518 LCM...... 3128 Pressure at Depth (3, 1) ...... 519 LCXM ...... 3129 Bernoulli Equation (3, 2) ...... 519 LDEC...... 3129 Flow with Losses (3, 3) ...... 520 LEGENDRE...... 3130 Flow in Full Pipes (3, 4)...... 521 LGCD ...... 3130 Forces and Energy (4)...... 521 LIBEVAL...... 3130 Linear Mechanics (4, 1)...... 522 LIBS...... 3130 Angular Mechanics (4, 2)...... 523 lim ...... 3131 Centripetal Force (4, 3) ...... 523 LIMIT...... 3131 Hooke’s Law (4, 4)...... 523 LIN ...... 3131 1D Elastic Collisions (4, 5)...... 524 LINE ...... 3132 Drag Force (4, 6)...... 524 ΣLINE...... 3132 Law of Gravitation (4, 7) ...... 524 LINFIT ...... 3132 MassEnergy Relation (4, 8) ...... 524 LININ...... 3133 Gases (5) ...... 525 LINSOLVE...... 3133 Ideal Gas Law (5, 1)...... 525 LIST→ ...... 3133 Ideal Gas State Change (5, 2)...... 526 →LIST ...... 3133 Isothermal Expansion (5, 3)...... 526 LIST...... 3134 Polytropic Processes (5, 4)...... 526 ΠLIST ...... 3134 Isentropic Flow (5, 5)...... 526 ΣLIST...... 3134 Real Gas Law (5, 6)...... 527 LN...... 3134 Real Gas State Change (5, 7)...... 527 LNAME...... 3136 Kinetic Theory (5, 8) ...... 528 LNCOLLECT ...... 3136 Heat Transfer (6) ...... 528 LNP1...... 3136 Heat Capacity (6, 1) ...... 529 LOCAL ...... 3137 Thermal Expansion (6, 2)...... 529 LOG ...... 3137 Conduction (6, 3) ...... 529 LOGFIT ...... 3138 Convection (6, 4)...... 530 LQ...... 3138 Conduction + Convection (6, 5) ...... 530 LR...... 3138 Black Body Radiation (6, 6)...... 531 LSQ...... 3139 Magnetism (7) ...... 531 LU ...... 3139 Straight Wire (7, 1)...... 532 LVAR ...... 3140 Force between Wires (7, 2)...... 532 MAD...... 3140 Magnetic (B) Field in Solenoid (7, 3)...... 533 MAIN...... 3141 Magnetic (B) Field in Toroid (7, 4) ...... 533 MANT...... 3141 Motion (8)...... 534 MAP...... 3141 Linear Motion (8, 1)...... 535 ↓MATCH...... 3141 Object in Free Fall (8, 2)...... 535 ↑MATCH...... 3142 Projectile Motion (8, 3) ...... 535

Contents 8 Contents 17

PA2B2 ...... 3162 UPDIR ...... 3265 PARAMETRIC ...... 3162 UTPC ...... 3265 PARITY...... 3163 UTPF...... 3266 PARSURFACE...... 3164 UTPN...... 3266 PARTFRAC ...... 3164 UTPT...... 3267 PATH...... 3165 UVAL...... 3267 PCAR...... 3165 V→ ...... 3267 PCOEF ...... 3165 →V2 ...... 3268 PCONTOUR...... 3166 →V3 ...... 3268 PCOV...... 3166 VANDERMONDE ...... 3269 PDIM ...... 3167 VAR...... 3269 PERINFO ...... 3167 VARS...... 3270 PERM...... 3167 VER...... 3270 PERTBL ...... 3168 VERSION...... 3270 PEVAL...... 3168 VISIT...... 3271 PGDIR...... 3168 VISITB...... 3271 PICK...... 3168 VPOTENTIAL ...... 3271 PICK3 ...... 3168 VTYPE...... 3272 PICT...... 3169 *W...... 3272 PICTURE...... 3169 WAIT ...... 3272 PINIT...... 3169 WHILE ...... 3273 PIX?...... 3170 WIREFRAME...... 3273 PIXOFF...... 3170 WSLOG...... 3274 PIXON...... 3170 ΣX...... 3275 PKT ...... 3170 ΣX2...... 3275 PLOT ...... 3171 ΣX^2 ...... 3276 PLOTADD ...... 3171 XCOL...... 3276 PMAX ...... 3171 XGET ...... 3276 PMIN ...... 3171 XMIT...... 3276 PMINI...... 3172 XNUM ...... 3277 POLAR ...... 3172 XOR ...... 3277 POLYNOMIAL...... 3173 XPON...... 3278 POP ...... 3173 XPUT ...... 3278 POS...... 3174 XQ ...... 3278 POTENTIAL ...... 3174 XRECV...... 3279 POWEXPAND...... 3174 XRNG...... 3279 POWMOD...... 3175 XROOT...... 3279 PR1 ...... 3175 XSEND...... 3280 PREDV...... 3176 XSERV...... 3280 PREDX...... 3176 XVOL...... 3281 PREDY...... 3177 XXRNG...... 3281 PREVAL...... 3177 ΣXY...... 3281 PREVPRIME...... 3178 ΣX*Y...... 3281 PRLCD...... 3178 ΣY...... 3282 PROMPT...... 3178 ΣY2...... 3282 PROMPTSTO ...... 3178 ΣY^2...... 3282 PROOT...... 3179 YCOL...... 3282 PROPFRAC...... 3179 YRNG...... 3283 PRST...... 3180 YSLICE...... 3283 PRSTC...... 3180 YVOL...... 3284 PRVAR...... 3180 YYRNG...... 3284 PSDEV...... 3181 ZEROS ...... 3284 PSI...... 3181 ZFACTOR ...... 3285 Psi...... 3181 ZVOL...... 3285 PTAYL...... 3182 ^ (Power) ...... 3285 PTPROP...... 3182 | (Where)...... 3286

Contents 10 Contents 15

RND...... 3205 SINH ...... 3226 RNRM...... 3206 SINV...... 3226 ROLL ...... 3206 SIZE ...... 3226 ROLLD...... 3206 SL ...... 3227 ROMUPLOAD...... 3206 SLB ...... 3227 ROOT ...... 3207 SLOPEFIELD...... 3227 ROT...... 3207 SNEG...... 3228 ROW– ...... 3207 SNRM...... 3228 ROW+ ...... 3208 SOLVE...... 3229 ROW→...... 3208 SOLVEQN ...... 3229 →ROW...... 3208 SOLVER...... 3230 RPL>...... 3209 SOLVEVX ...... 3230 RR ...... 3209 SORT...... 3230 RRB ...... 3209 SPHERE...... 3231 rref...... 3210 SQ ...... 3231 RREF...... 3210 SR...... 3231 RREFMOD...... 3211 SRAD ...... 3231 RRK...... 3211 SRB...... 3232 RRKSTEP ...... 3212 SRECV...... 3232 RSBERR ...... 3213 SREPL...... 3233 RSD ...... 3213 SST...... 3233 RSWP ...... 3214 SST↓...... 3233 RULES...... 3214 START ...... 3234 R→B...... 3214 STD ...... 3234 R→C...... 3215 STEP ...... 3235 R→D...... 3215 STEQ ...... 3235 R→I...... 3215 STIME...... 3235 SAME...... 3215 STO ...... 3236 SBRK...... 3216 STOALARM...... 3236 SCALE ...... 3216 STOF...... 3237 SCALEH...... 3216 STOKEYS...... 3237 SCALEW...... 3216 STORE...... 3238 SCATRPLOT...... 3217 STOVX...... 3238 SCATTER ...... 3217 STO+ ...... 3238 SCHUR ...... 3218 STO–...... 3239 SCI ...... 3218 STO* ...... 3239 SCLΣ ...... 3218 STO/...... 3239 SCONJ ...... 3219 STOΣ...... 3240 SCROLL ...... 3219 STR→...... 3240 SDEV ...... 3219 →STR...... 3240 SEND...... 3219 STREAM ...... 3241 SEQ ...... 3220 STRM ...... 3241 SERIES...... 3220 STURM...... 3241 SERVER...... 3221 STURMAB ...... 3242 SEVAL...... 3221 STWS...... 3242 SF ...... 3221 SUB...... 3242 SHOW...... 3222 SUBST...... 3243 SIDENS...... 3222 SUBTMOD...... 3243 SIGMA...... 3222 SVD ...... 3244 SIGMAVX ...... 3223 SVL...... 3244 SIGN...... 3223 SWAP...... 3244 SIGNTAB ...... 3224 SYSEVAL...... 3245 SIMP2...... 3224 SYLVESTER ...... 3245 SIMPLIFY...... 3225 SYST2MAT...... 3245 SIN...... 3225 %T ...... 3246 SINCOS...... 3225 TABVAL ...... 3246

Contents 12 Contents 13

Example: In the following program excerpt, the defining procedure for local variables d, e, and f calls a program that you previously created and stored in global variable P1 . Continue the program. Program: Comments: != « : Note that when program execution is suspended by PROMPT, you can execute calculator operations just as you did → a b c before you started the program. If the outer radius b of the torus in the previous example is measured as 0.83 feet, « you can convert that value to inches while the program is suspended for data input by pressing .83 `12 *, then a b + c + !=. → d e f Defines local variables d, e, f. 'P1+a/(d*e+f)' Local variables a, b, c and d, e, f are available Using DISP FREEZE HALT, CONT for Input in this procedure. The defining procedure executes the program stored in variable P1 . DISP FREEZE HALT lets you control the entire display during input, and allows the user to use normal keyboard operations during input. a c / » To enter DISP FREEZE HALT in a program: : 1. » Enter a string or other object to be displayed as a prompt. 2. Enter a number specifying the line to display it on. 3. Enter the DISP command (PRG OUT menu). The six local variables are not available in program P1 because they didn’t exist when you created P1 . The objects 4. Enter a number specifying the areas of the display to “freeze.” stored in the local variables are available to program P1 only if you put those objects on the stack for P1 to use or 5. Enter the FREEZE command (PRG OUT menu). store those objects in global variables. 6. Enter the HALT command (PRG OUT menu). Conversely, program P1 can create its own local variable structure (with any names, such as a, c, and f, for example) « … promptobject displayline DISP without conflicting with the local variables of the same name in the procedure that calls P1 . It is possible to create a freezearea FREEZE HALT … » special type of local variable that can be used in other programs or subroutines. This type of local variable is called a compiled local variable. DISP displays an object in a specified line of the display. DISP takes two arguments from the stack: an object from level 2, and a displayline number 1 through 7 from level 1. If the object is a string, it’s displayed without the "" Compiled Local Variables delimiters. The display created by DISP persists only as long as the program continues execution — if the program ends or is suspended by HALT, the calculator returns to the normal stack environment and updates the display. Global variables use up memory, and local variables can’t be used outside of the program they were created in. However, you can use FREEZE to retain the prompt display. Compiled local variables bridge the gap between these two variable types. To programs, compiled local variables FREEZE “freezes” display areas so they aren’t updated until a key press . Argument n in level 1 is the sum of the look like global variables, but to the calculator they act like local variables. This means you can create a compiled codes for the areas to be frozen: 1 for the status area, 2 for the stack/command line area, 4 for the menu area. local variable in a local variable structure, use it in any other program that is called within that structure, and when the program finishes, the variable is gone. HALT suspends program execution at the location of the HALT command and turns on the HALT annunciator. Calculator control is returned to the keyboard for normal operations. Compiled local variables have a special naming convention: they must begin with a ←. For example, « When execution resumes, the input remains on the stack as entered. → ←y To respond to HALT while running a program: 'IFTE(←y<0,BELOW,ABOVE)' 1. Enter your input — you can use keyboard operations to calculate the input. » 2. Press !=. The variable ←y is a compiled local variable that can be used in the two programs BELOW and ABOVE. Example: If you execute this program segment « "ABC DEF GHI" CLLCD 3 DISP 2 FREEZE HALT » Creating UserDefined Functions as Programs The display looks like this: The defining procedure for a local variable structure can be either an algebraic or program object. A program that consists solely of a local variable structure whose defining procedure is an algebraic expression is a userdefined function.

110 RPL Programming RPL Programming 139

If neither object is an algebraic or a name, returns 1. if the two objects are the same type and have the same value, or 0. otherwise. For example, if 6 is stored in X, X 5 < puts 6 and 5 on the stack, then removes them and returns 0.. (Lists and programs are considered to have same value if the objects they contain are identical. For Input strings, “less than” means “alphabetically previous.”) A program can stop for user input, then resume execution, or can use choose boxes or input forms (dialog boxes) If one object is an algebraic (or name) and the other object is an algebraic (or name) or a number, returns an for input. You can use several commands to get input: expression that must be evaluated to get a test result based on numeric values. For example, if 6 is stored in X, PROMPT ( !=to resume). 'X' 5 < returns 'X<5' , then →NUM returns 0.. DISP FREEZE HALT ( !=to resume). (Note that == is used for comparisons, while = separates two sides of an equation.) INPUT ( `to resume). SAME returns 1. (true) if two objects are identical. For example, 'X+3' 4 SAME returns 0. regardless of the value INFORM of X because the algebraic 'X+3' is not identical to the real number 4. Binary integers must have the same CHOOSE wordsize and the same value to be identical. For all object types other than algebraics, names, and binary integers, SAME works just like ==. Data Input Commands You can use any comparison function (except SAME) in an algebraic by putting it between its two arguments. For example, if 6 is stored in X, 'X<5' →NUM returns 0.. Key Command Description Using Logical Functions !°L %IN% : Logical functions return a test result based on the outcomes of one or two previously executed tests. Note that these four functions interpret any nonzero argument as a true result. %INFOR% INFORM Creates a userdefined input form. Logical Functions %NOVAL% NOVAL Place holder for the INFORM command. Returned when a value is not present in Keys Programmable Description an input form field. Command %CHOOS% CHOOSE Creates a userdefined choose box.

!°%TEST% L %KEY% KEY Returns a test result to level 1 and, if a key is pressed, the location of that key (level 2). %AND% AND Returns 1. (true) only if both %WAIT% WAIT Suspends program execution for a specified duration (in seconds, level 1). arguments are true (0. otherwise). %INPUT% INPUT Suspends program execution for data input. %OR% OR Returns 1. (true) if either or both arguments are true (0. otherwise). %PROMP% PROMPT Halts program execution for data input. %XOR% XOR Returns 1. (true) if either argument, but not both, is true (0. otherwise). Using PROMPT, CONT for Input %NOT% NOT PROMPT uses the status area for prompting, and allows the user to use normal keyboard operations during input. Returns 1. (true) if the argument is 0 (false); otherwise, returns 0. (false). To enter PROMPT in a program:

1. Enter a string ( with "" delimiters) to be displayed as a prompt in the status area. AND, OR, and XOR combine two test results. For example, if 4 is stored in Y, Y 8 < 5 AND returns 1.. First, 2. Enter the PROMPT command (PRG IN menu). Y 8 < returns 1. to the stack. AND removes 1. and 5 from the stack, interpreting both as true results, and returns 1. to the stack. « … " promptstring " PROMPT … » NOT returns the logical inverse of a test result. For example, if 1 is stored in X and 2 is stored in Y, X Y < NOT PROMPT takes a string argument from level 1, displays the string (without the "" delimiters) in the status area, and returns 0. halts program execution. Calculator control is returned to the keyboard. You can use AND, OR, and XOR in algebraics as infix functions. For example, '3<5 XOR 4>7' NUM When execution resumes, the input is left on the stack as entered. returns 1. To respond to PROMPT while running a program: You can use NOT as a prefix function in algebraics. For example, 'NOT Z‰4' →NUM returns 0. if Z = 2. 1. Enter your input — you can use keyboard operations to calculate the input. 2. Press !=. The message remains until you press `or − or until you update the status area.

112 RPL Programming RPL Programming 137

« … IF testclause Making an Error Trap THEN trueclause ELSE falseclause END … » You can construct an error trap with one of the following conditional structures: IF … THEN … ELSE … END executes either the trueclause sequence of commands if the testclause is true, or the falseclause sequence of commands if the testclause is false. If the testclause is an algebraic, it’s automatically evaluated IFERR … THEN … END. to a number — you don’t need →NUM or EVAL. IFERR … THEN … ELSE … END.

IF begins the testclause, which leaves a test result on the stack. THEN removes the test result from the stack. If the The IFERR THEN END Structure value is nonzero, the trueclause is executed — otherwise, the falseclause is executed. After the appropriate clause is The syntax for this structure is executed, execution resumes following END. See “Conditional Examples” on page 115. « … IFERR trapclause THEN errorclause END … » To enter IF THEN ELSE END in a program: The commands in the errorclause are executed only if an error is generated during execution of the trapclause. If Press !°%BRCH% @%#IF#% . an error occurs in the trapclause, the error is ignored, the remainder of the trapclause is skipped, and program execution jumps to the errorclause. If no errors occur in the trapclause, the errorclause is skipped and execution The IFTE Function resumes after the END command. The algebraic syntax for this function is 'IFTE( test , trueclause , falseclause )' To enter IFERR THEN END in a program: If test evaluates true, the trueclause algebraic is evaluated — otherwise, the falseclause algebraic is evaluated. Press !°LL %ERROR% !%IFERR% . You can also use the IFTE function with stack syntax. It takes three arguments: a testresult in level 3, a trueclause Example: The following program takes any number of vectors or arrays from the stack and adds them to the object in level 2, and a falseclause object in level 1. See “Conditional Examples” on page 115. statistics matrix. However, the program stops with an error if a vector or array with a different number of columns To enter IFTE in a program or in an algebraic: is encountered. In addition, if only vectors or arrays with the same number of columns are on the stack, the program stops with an error after the last vector or array has been removed from the stack. Press !°%BRCH% L!%IFTE% . « WHILE DUP TYPE 3 == REPEAT Σ+ END » The CASE END Structure In the following revised version, the program simply attempts to add the level 1 object to the statistics matrix until an error occurs. Then, it ends by displaying the message DONE . The syntax for this structure is « … CASE

testclause 1 THEN trueclause 1 END Program: Comments:

testclause 2 THEN truetclause 2 END « ... IFERR Starts the trapclause. testclause n THEN trueclause n END WHILE The WHILE structure repeats defaultclause (optional) 1 indefinitely, adding the vectors REPEAT and arrays to the statistics matrix END … » Σ+ END until an error occurs. The CASE … END structure lets you execute a series of testclause commands, then execute the appropriate true clause sequence of commands. The first test that returns a true result causes execution of the corresponding true THEN Starts the error clause. If an error clause, ending the CASE … END structure. Optionally, you can include after the last test a defaultclause that’s "DONE" 1 DISP occurs in the WHILE structure, 1 FREEZE executed if all the tests evaluate to false. If a testclause is an algebraic, it’s automatically evaluated to a number — displays the message DONE in you don’t need →NUM or EVAL. the status area. END Ends the error structure. When CASE is executed, testclause 1 is evaluated. If the test is true, trueclause 1 is executed, and execution skips to » END. If testclause 1 is false, execution proceeds to testclause 2. Execution within the CASE structure continues until a trueclause is executed, or until all the testclauses evaluate to false. If a default clause is included, it’s executed if all the testclauses evaluate to false. See “Conditional Examples” below.

114 RPL Programming RPL Programming 135

Example: Two Conditional Actions. This program takes a value x from the stack and calculates (sin x)/ x. At x SingleStep Operations = 0 the division would error, so the program returns the limit value 1 in this case. Key Programmable Description « → x « IF 'x‹0' THEN x SIN x / ELSE 1 END » » Command The following version uses IFTE algebraic syntax: !°LL%RUN% : « → x 'IFTE(x‹0,SIN(x)/x,1' » %DBUG% DBUG Starts program execution, then suspends it as if HALT were the first Example: Two Conditional Actions. This program multiplies two numbers together if they’re both nonzero — program comm and. Takes as its argument the program or program name otherwise, it returns the string “ZERO”. in level 1. Program: Comments: %SST% Executes the next object or command in the suspended program. « %SST°% Same as %SST% , except if the next program step is a subroutine, singlesteps → n1 n2 Creates the local variables. to the first step in that subroutine. « Starts the defining procedure. %NEXT% Displays the next one or two objects, but does not execute them. The IF Starts the test clause. display persists until the next keystroke. 'n1‹0 AND n2‹0' Tests n1 and n2 . %HALT% HALT Suspends program execution at the location of the HALT command in THEN If both numbers are nonzero, multiplies the two the program. n1 n2 * values. ELSE Otherwise, returns the string ZERO . %KILL% KILL Cancels all suspended programs and turns off the HLT annunciator. "ZERO" != CONT Resumes execution of a halted program. END Ends the conditional.

» Ends the defining procedure. » Example: Two Conditional Actions. This program tests if two numbers on the stack have the same value. If Trapping Errors so, it drops one of the numbers and stores the other in variable V1 — otherwise, it stores the number from level 1 in V1 and the number from level 2 in V2. If you attempt an invalid operation from the keyboard, the operation is not executed and an error message appears. For example, if you execute + with a vector and a real number on the stack, the calculator returns the message + Program: Comments: Error: Bad Argument Type and returns the arguments to the stack (if Last Arguments is enabled). « In a program, the same thing happens, but program execution is also aborted. If you anticipate error conditions, IF For the test clause, copies the numbers in levels 1 and your program can process them without interrupting execution. DUP2 2 and tests if they have the same value. SAME For simple programs, you can run the program again if it stops with an error. For other programs, you can design them to trap errors and continue executing. You can also create userdefined errors to trap certain conditions in THEN For the true clause, drops one of the numbers and programs. The error trapping commands are located in the PRG ERROR menu. DROP stores the other in V1 . 'V1' STO ELSE For the false clause, stores the level 1 number in V1 Causing and Analyzing Errors 'V1' STO and the level 2 number in V2 . 'V2' STO Many conditions are automatically recognized by the calculator as error conditions — and they’re automatically treated as errors in programs. END Ends the conditional structure. You can also define conditions that cause errors. You can cause a userdefined error (with a userdefined error message) » — or you can cause a builtin error. Normally, you’ll include a conditional or loop structure with a test for the error ` Puts the program on the stack. condition — and if it occurs, you’ll cause the userdefined or builtin error to occur. O K Stores it in TST . TST To cause a userdefined error to occur in a program: 1. Enter a string (with "" delimiters) containing the desired error message. 2. Enter the DOERR command (PRG ERROR menu). Enter the numbers 26 and 52, then execute TST to compare their values. Because the two numbers aren’t equal, the VAR menu now contains two new variables V1 and V2 . 26 `52 J %TST%

116 RPL Programming RPL Programming 133

The START NEXT Structure SingleStepping through a Program The syntax for this structure is « … start finish START loopclause NEXT … » It’s easier to understand how a program works if you execute it step by step, observing the effect of each step. Doing this can help you debug your own programs or understand programs written by others. START … NEXT executes the loopclause sequence of commands one time for each number in the range start to finish . The loopclause is always executed at least once. To singlestep from the start of a program: 1. Put the program or program name in level 1 (or the command line). Syntax Flowchart 2. Press !°LL%RUN% %DBUG% to start and immediately suspend execution. HLT appears in the status area. 3. Take any action: Start 1:Start To see the next program step displayed in the status area and then executed, press %SST% . finish 2:finish To display but not execute the next one or two program steps, press %NEXT% . To continue with normal execution, press !=. START counter=start To abandon further execution, press %KILL% . Store finish 4. Repeat the previous step as desired.

loop-clause Body of loop To turn off the HALT annunciator at any time: Press !°LL %RUN% %KILL% . counter = counter + 1 Example: Execute program TORSV step by step. Use a = 6 and b = 8.

NEXT Select the VAR menu and enter the data. Enter the program name and start the debugging. HLT indicates program Is yes execution is suspended. counter ≤ finish?

@ J6 `8 `O%TORSV% no !°LL%RUN% %DBUG% START NEXT Structure

START takes two numbers ( start and finish ) from the stack and stores them as the starting and ending values for a Display and execute the first program step. Notice that it takes the two arguments from the stack and stored loop counter. Then, the loopclause is executed. NEXT increments the counter by 1 and tests to see if its value is them in local variables a and b. less than or equal to finish. If so, the loopclause is executed again — otherwise, execution resumes following NEXT. %SST%

To enter START NEXT in a program:

Press !°%BRCH% !%START% .

Example: The following program creates a list containing 10 copies of the string "ABC" : « 1 10 START "ABC" NEXT 10 →LIST »

Continue singlestepping until the status area shows the current directory. Watch the stack and status area as you singlestep through the program. %SST% … %SST% .

118 RPL Programming RPL Programming 131

The FOR NEXT Structure To recall the current flag states: The syntax for this structure is Execute RCLF ( !°L %MODES% %FLAG% L%RCLF% ). « … start finish FOR counter loopclause NEXT … » RCLF returns a list containing four 64 binary integers representing the current states of the lower and upper FOR … NEXT executes the loopclause program segment one time for each number in the range start to finish, groups of system and user flags: using local variable counter as the loop counter. You can use this variable in the loopclause. The loopclause is { #nsystemlower #nuserlower #nsystemupper #nuserupper } always executed at least once. To change the current flag states: 1. Enter the flagstate argument — see below Syntax Flowchart 2. Execute STOF ( !°L %MODES% %FLAG% L%STOF% ). STOF sets the current states of flags based on the flagstate argument: Start 1:Start finish 2:finish #ns Changes the states of only the system flags.

{ #nslower #nulower #nsupper #nuupper } Changes the states of the system and user flags. FOR counter=start Store finish Example: The program PRESERVE on page 26 uses RCLF and STOF.

loop-clause Body of loop Using Subroutines counter = counter + 1 Because a program is itself an object, it can be used in another program as a subroutine. When program B is used by program A, program A calls program B, and program B is a subroutine in program A. Example: The program TORSA calculates the surface area of a torus of inner radius a and outer radius b. TORSA NEXT is used as a subroutine in a second program TORSV , which calculates the volume of a torus. Is yes counter ≤ finish?

no

FOR NEXT Structure FOR takes start and finish from the stack as the beginning and ending values for the loop counter, then creates the The surface area and volume are calculated by local variable counter as a loop counter. Then the loopclause is executed — counter can appear within the loopclause. 2 2 2 1 2 2 2 A = π ()b – a V = ---π ()b – a ()b– a NEXT increments counter by one, and then tests whether its value is less than or equal to finish . If so, the loopclause is 4 repeated (with the new value of counter ) — otherwise, execution resumes following NEXT. When the loop is exited, 2 2 2 counter is purged. (The quantity π () b – a in the second equation is the surface area of a torus calculated by TORSA .)

To enter FOR NEXT in a program: Here are the stack diagram and program listing for TORSA . Press !°%BRCH% ! %FOR% . Example: The following program places the squares of the integers 1 through 5 on the stack: Level 2 Level 1 → Level 1 « 1 5 FOR j j SQ NEXT » Example: The following program takes the value x from the stack and computes the integer powers i of x. For a b → surface area example, when x =12 and start and finish are 3 and 5 respectively, the program returns 12 3, 12 4 and 12 5. It requires as inputs start and finish in level 3 and 2, and x in level 1. ( → x removes x from the stack, leaving start and finish there as arguments for FOR.) « → x « FOR n 'x^n' EVAL NEXT » »

120 RPL Programming RPL Programming 129

Example: The following program takes n from the stack, and returns the series of numbers 1, 2, 4, 8, 16, …, n. If n Using Flags isn’t in the series, the program stops at the last value less than n. You can use flags to control calculator behavior and program execution. You can think of a flag as a switch that is « 1 SWAP FOR n n n STEP » either on ( set ) or off ( clear ). You can test a flag’s state within a conditional or loop structure to make a decision. The first n is the local variable declaration for the FOR loop. The second n is put on the stack each iteration of the Because certain flags have unique meanings for the calculator, flag tests expand a program’s decisionmaking loop. The third n is used by STEP as the step increment. capabilities beyond that available with comparison and logical functions.

Using Indefinite Loop Structures Types of Flags The DO UNTIL END Structure The calculator has two types of flags: The syntax for this structure is System flags. Flags –1 through –128. These flags have predefined meanings for the calculator. « … DO loopclause UNTIL testclause END … » User flags. Flags 1 through 128. User flags are, for the most part, not used by any builtin operations. What they mean depends entirely on how the program uses them. DO… UNTIL… END executes the loopclause sequence repeatedly until testclause returns a true (nonzero) result. Because the testclause is executed after the loopclause, the loopclause is always executed at least once. Appendix C lists the 128 system flags and their definitions. For example, system flag –40 controls the clock display — when this flag is clear (the default state), the clock is not displayed — when this flag is set, the clock is displayed. Syntax Flowchart (When you press %CLK% in the H%MISC% menu, you are setting or clearing flag –40.) Note that for these calculators, there are no display annunciators to indicate that user flags 1 through 5 are set, like the older HP 48Sseries and HP 48Gseries calculators. DO

Setting, Clearing, and Testing Flags loop-clause Body of loop Flag commands take a flag number from the stack — an integer 1 through 128 (for user flags) or –1 through –128 (for system flags). UNTIL TEST To set, clear, or test a flag: 1. Enter the flag number (positive or negative). test-clause 1: test result 2. Execute the flag command — see the table below.

Flag Commands Is test no END result non-zero? Key Programmable Description Command

!°%TEST% LL: yes %SF% SF Sets the flag. DO UNTIL END Structure %CF% DO starts execution of the loopclause. UNTIL marks the end of the loopclause. The testclause leaves a test CF Clears the flag. result on the stack. END removes the test result from the stack. If its value is zero, the loopclause is executed again %FS?% FS? Returns 1. (true) if the flag is set, or — otherwise, execution resumes following END. If the argument of END is an algebraic or a name, it’s 0. (false) if the flag is clear. automatically evaluated to a number. %FC?% FC? Returns 1. (true) if the flag is clear, To enter DO UNTIL END in a program: or 0. (false) if the flag is set. Press !°%BRCH% ! %DO% . %FS?C% FS?C Tests the flag (returns true if the flag is set), then clears the flag. %FC?C% FC?C Tests the flag (returns true if the flag is clear), then clears the flag.

122 RPL Programming RPL Programming 127

The WHILE REPEAT END Structure Using Loop Counters The syntax for this structure is For certain problems you may need a counter inside a loop structure to keep track of the number of loops. (This « … WHILE testclause REPEAT loopclause END … » counter isn’t related to the counter variable in a FOR … NEXT/STEP structure.) You can use any global or local WHILE … REPEAT … END repeatedly evaluates testclause and executes the loopclause sequence if the test is true. variable as a counter. You can use the INCR or DECR command to increment or decrement the counter value and Because the testclause is executed before the loopclause, the loopclause is not executed if the test is initially false. put its new value on the stack. The syntax for INCR and DECR is Syntax Flowchart « … ' variable ' INCR … » or « … ' variable ' DECR … » WHILE TEST To enter INCR or DECR in a program: test-clause Press !° #MEM# %ARITH% %INCR% or %DECR% . 1: test result The INCR and DECR commands take a global or local variable name (with ' delimiters) as their argument — the REPEAT variable must contain a real number. The command does the following: 1. Changes the value stored in the variable by +1 or 1. Is test 2. Returns the new value to the stack. result non-zero? Example: If c contains the value 5, then 'c' INCR stores 6 in c and returns 6 to the stack. no Example: The following program takes a maximum of five vectors from the stack and adds them to the current statistics matrix. yes Program: Comments: loop-clause Body of loop « END 0 → c Stores 0 in local variable c.

WHILE REPEAT END Structure « Starts the defining procedure. WHILE starts execution of the testclause, which returns a test result to the stack. REPEAT takes the value from WHILE Starts the test clause. the stack. If the value is nonzero, execution continues with the loopclauseotherwise, execution resumes following DUP TYPE 3 == Returns true if level 1 contains a vector. END. If the argument of REPEAT is an algebraic or a name, it’s automatically evaluated to a number. 'c' INCR Increments and returns the value in c. To enter WHILE REPEAT END in a program: 5 ‰ Returns true if the counter c≤5. Press !°%BRCH% ! %WHILE% . AND Returns true if the two previous test Example: The following program starts with a number on the stack, and repeatedly performs a division by 2 as results are true. long as the result is evenly divisible. For example, starting with the number 24, the program computes 12, then 6, REPEAT Adds the vector to ΣDAT . then 3. Σ+ « WHILE DUP 2 MOD 0 == REPEAT 2 / DUP END DROP » END Ends the structure. Example: The following program takes any number of vectors or arrays from the stack and adds them to the » Ends the defining procedure. statistics matrix. (The vectors and arrays must have the same number of columns.) » WHILE … REPEAT … END is used instead of DO … UNTIL … END because the test must be done before the addition. (If only vectors or arrays with the same number of columns are on the stack, the program errors after the last vector or array is added to the statistics matrix.) « WHILE DUP TYPE 3 == REPEAT Σ+ END »

124 RPL Programming RPL Programming 125

To include INPUT options: EXCO (Expand and Collect Completely) Use a list (with {} delimiters) as the commandline argument for INPUT. The list can contain one more of the following: EXCO repeatedly executes EXPAN on an algebraic until the algebraic doesn’t change, then repeatedly executes Commandline string (with "" delimiters). COLCT until the algebraic doesn’t change. In some cases the result will be a number. Cursor position as a real number or as a list containing two real numbers. Expressions with many products of sums or with powers can take many iterations of EXPAN to expand Operating options ALG , Œ, or V. completely, resulting in a long execution time for EXCO .

In its general form, the level 1 argument for INPUT is a list that specifies the content and interpretation of the command line. The list can contain one or more of the following parameters in any order: Level 1 → Level 1 'algebraic' → 'algebraic' { " commandline " cursorposition operatingoptions } 'algebraic' z → “Commandline ” Specifies the content of the command line when the program pauses. Embedded newline characters produce multiple lines in the display. (If not included, the Techniques used in EXCO command line is blank.) Subroutines. EXCO calls the program MULTI twice. It is more efficient to create program MULTI and simply call its name twice than write each step in MULTI two times. Cursorposition Specifies the position of the cursor in the command line and its type. (If not included, an insert cursor is at the end of the command line.) Required Programs A real number n specifies the nth character in the first row (line) of the command MULTI (Multiple Execution) repeatedly executes the programs that EXCO provides as arguments. line. Zero specifies the end of the commandline string. A positive number specifies the insert cursor — a negative number specifies the replace cursor. EXCO program listing A list {row character } specifies the row and character position. Row 1 is the first row (line) of the command line. Characters count from Program: Comments: the left end of each row — character 0 specifies the end of the row. A positive row « number specifies the insert cursor — a negative row number specifies the replace « EXPAN » Puts a program on the stack as cursor. the level 1 argument for MULTI . The program executes the operatingoptions Specify the input setup and processing using zero or more of these unquoted names: EXPAN command. MULTI ALG activates Algebraic/Programentry mode (for algebraic syntax). (If not Executes EXPAN until the included, Programentry mode is active.) algebraic object doesn’t change. Œ ( ~…a ) specifies alpha lock. (If not included, alpha is inactive.) « COLCT » Puts another program on the V verifies whether the result string (without the "" delimiters) is a valid object or stack for MULTI . The program sequence of objects. If the result string isn’t valid, INPUT displays the Invalid executes the COLCT command. Syntax message and prompts again for data. (if not included, syntax isn’t MULTI Executes COLCT until the checked.) algebraic object doesn’t change. » To design the commandline string for INPUT: Stores the program in EXCO . For simple input, use a string that produces a valid object: `OEXCO K Use an empty string Use a :label : tag. Checksum: # 41162d Use a @ text @ comment. Bytes: 65.5 For special input, use a string that produces a recognizable pattern. Example: Expand and collect completely the expression: After the user enters input in the command line and presses ` to resume execution, the contents of the 3x()4y+ z +()8x–5z 2 command line are returned to level 1 as the result string. The result string normally contains the original command Enter the expression. line string, too. If you design the commandline string carefully, you can ease the process of extracting the input data. O3 * X *

142 RPL Programming RPL Programming Examples 215

Execute TINPUT to calculate the surface area of a torus of inner radius a = 10 and outer radius b = 20. Program: Comments: J %TINPU% m →ARRY Combines all the medians into an melement vector. s STOΣ Restores ΣDAT to its previous value. » Ends the defining procedure. » Stores the program in MEDIAN . `OMEDIAN K

Key in the value for a, press ˜ to move the cursor to the next prompt, then key in the value for b. Checksum: # 256d Bytes: 140 10 ˜20 Example: Calculate the median of the following data.

18 12 4 7 3 2 11 1 31 48 20 17

Continue program execution. There are two columns of data, so MEDIAN will return a twoelement vector. ` Enter the matrix.

‚Ù%OK% %EDIT% Example: The following program executes INPUT to prompt for a social security number, then extracts two strings: the first three digits and last four digits. The level 1 argument for INPUT specifies: 18 `12 `˜šš A commandline string with dashes. 4 `7 ` The replace cursor positioned at the start of the prompt string ( –1). This lets the user “fill in” the command line ` ` string, using ™to skip over the dashes in the pattern. 3 2 By default, no verification of object syntax — the dashes make the content invalid as objects 11 `1 `

31 `48 ` Level 1 → Level 2 Level 1 → “last four digits“ “first three digits“ 20 `17 ` ` %OK% The matrix is now stored in ΣDAT. Calculate the median. J %MEDIA%

Clear approximate mode (set exact mode) before going on to the next example.

Expanding and Collecting Completely This section contains two programs: MULTI repeats a program until the program has no effect on its argument. EXCO calls MULTI to completely expand and collect an algebraic.

144 RPL Programming RPL Programming Examples 213

You can specify a help message and the type of data that must be entered in field by entering field specifications as Techniques used in %TILE lists. For example, { { "Name:" "Enter your name" 2 } } defines the Name field, displays Enter your name across the bottom of the input form, and accepts only object type 2 (strings) as input. FLOOR and CEIL. For an integer, FLOOR and CEIL both return that integer; for a noninteger, FLOOR and CEIL return successive integers that bracket the noninteger. To set up a choose box: SORT. The SORT command sorts the list elements into ascending order. 1. Enter a title string for the choose box. 2. Enter a list of items. If this is a list of twoelement lists, the first element is displayed in the choose box, and the %TILE program listing second element is returned to level 2 when OK is pressed. 3. Enter a position number for the default highlighted item. (0 makes a viewonly choose box.) Program: Comments: 4. Execute the CHOOSE command. « Example: Enter a title "FIRST ONE" `. SWAP SORT Brings the list to level 1 and sorts it. { ONE TWO THREE } ` Enter a list of items . DUP SIZE Copies the list, then finds its size. Enter a position number for default highlighted value 3 `. 1 + ROT % Execute CHOOSE ( !°L%IN% %CHOOS% ). Calculates the position of the specified percentile. DUP2 Makes a copy of the list and the percentile. Example: The following choose box appears: FLOOR Rounds the position to the lower integer. 1 MAX OVER SIZE MIN Ensures it is between 1 and the size of the list. GET Gets the corresponding number. ROT ROT Moves the list to level 1. CEIL Rounds the position to the upper integer. 1 MAX OVER SIZE MIN Ensures it is between 1 and the size of the list. GET Example: The following program uses input forms, choose boxes, and message boxes to create a simple phone list Gets the corresponding number. database. + 2 / Calculates the average of the two numbers. » Stores the program in %TILE . Program: Comments: `O%TILE K « Checksum: # 3805d 'NAMES' VTYPE Checks if the name list Bytes: 92.5 IF 1 == (NAMES) exists, if not, creates THEN { } 'NAMES' STO an empty one. END Example: Calculate the median of the list {8 3 1 5 2}. WHILE While cancel is not pressed, "PHONELIST OPTIONS:" creates a choose box that lists !ä8 3 1 5 2 ` { the database options. When { "ADD A NAME" 1 } J50 %©TILE% { "VIEW A NUMBER" 2 } OK is pressed, the second } 1 CHOOSE item in the list pair is returned to the stack. MEDIAN (Median of Statistics Data) REPEAT → c « Stores the returned value in c. MEDIAN returns a vector containing the medians of the columns of the statistics data. Note that for a sorted list with an odd number of elements, the median is the value of the center element; for a list with an even number of CASE c 1 == Case 1 (ADD name), while elements, the median is the average value of the elements just above and below the center. THEN cancel is not pressed, do the WHILE following: Level 1 → Level 1

→ [ x1 x2 xm ]

146 RPL Programming RPL Programming Examples 211

You can delete names and numbers by editing the NAMES variable. To improve upon this program, create a delete name routine. BDISP program listing

Beeping to Get Attention Program: Comments: « To enter BEEP in a program: « Begins the main nested program. 1. Enter a number that specifies the tone frequency in hertz. DUP 2. Enter a number that specifies the tone duration in seconds. Makes a copy of n. 3. Enter the BEEP command ( !°L%OUT% L menu). 55 CF Clears flag –55 to enable LASTARG. « … frequency duration BEEP … » IFERR Begins error trap. R→B Converts n to a binary integer. BEEP takes two arguments from the stack: the tone frequency from level 2 and the tone duration from level 1. THEN If an error occurs, do nothing (no commands in END Example: The following edited version of TPROMPT sounds a 440hertz, onehalfsecond tone at the prompt for the THEN clause). data input. → n Creates a local variable n and begins the defining « Program: Comments: program. CLLCD « Clears the display. "ENTER a, b IN ORDER:" Sounds a tone just « BIN » Nested program for BIN. 440 .5 BEEP before the prompt for « OCT » Nested program for OCT. PROMPT data input. TORSA « DEC » Nested program for DEC. « HEX » » Nested program for HEX. 1 4 Sets the counter limits. Stopping a Program for Keystroke Input FOR j Starts the loop with counter j. EVAL Executes one of the nested base programs A program can stop for keystroke input — it can wait for the user to press a key. You can do this with the WAIT (initially for HEX). and KEY commands. n →STR Makes a string showing n in the current base. Using WAIT for Keystroke Input PAD Pads the string to 22 characters. The WAIT command normally suspends execution for a specified number of seconds. However, you can specify j DISP Displays the string in the jth line. that it wait indefinitely until a key is pressed. NEXT Increments j and repeats the loop. To enter WAIT in a program » Ends the defining program. To stop without changing the display, enter 0 and the WAIT command (PRG IN menu). 3 FREEZE Freezes the status and stack areas. To stop and display the current menu, enter –1 and the WAIT command (PRG IN menu). » Ends the main nested program. WAIT takes the 0 or –1 from level 1, then suspends execution until a valid keystroke is executed. PRESERVE Stores the current flag status, executes the main For an argument of –1, WAIT displays the currently specified menu. This lets you build and display a menu of user nested program, and restores the status. choices while the program is paused. (A menu built with MENU or TMENU is not normally displayed until the » program ends or is halted.) `OBDISP K Stores the program in BDISP . When execution resumes, the threedigit key location number of the pressed key is left on the stack. This number indicates the row, column, and shift level of the key.

To respond to WAIT while running a program: Checksum: # 22884d Press any valid keystroke. (A prefix key such as !or ~ by itself is not a valid keystroke.) Bytes: 187

148 RPL Programming RPL Programming Examples 29

Labeling Output with Tags PRESERVE program listing To label a result with a tag: 1. Put the output object on the stack. Program: Comments: 2. Enter a tag — a string, a quoted name, or a number. « 3. Enter the →TAG command (PRG TYPE menu). RCLF Recalls the list of four 64bit « … object tag →TAG … » binary integers representing the status of the 128 system flags and →TAG takes two arguments — an object and a tag — from the stack and return a tagged object. 128 user flags.

→ f Stores the list in local variable f. Example: The following program TTAG is identical to TINPUT , except that it returns the result as AREA: value . « Begins the defining procedure. Program: Comments: IFERR Starts the error trap. « "Key in a, b" EVAL Executes the program placed on { ":a: :b:" {1 0} V } the stack as the level 1 argument. INPUT OBJ→ THEN If the program caused an error, TORSA f STOF ERRN DOERR restores flags, shows the error, and "AREA" Enters the tag (a string). aborts execution. →TAG Uses the program result END Ends the error routine. and string to create the f STOF Puts the list back on the stack, tagged object. then restores the status of all flags. » » Ends the defining procedure. Stores the program in `O ‰ » TTAG TTAG . Stores the program in `OPRESERVE K Execute TTAG to calculate the area of a torus of inner radius a = 1.5 and outer radius b = 1.85. The answer is PRESERVE . returned as a tagged object.

J %TTAG% ˜ ` 1.5 1.85 Checksum: # 26834d Bytes: 71 Labeling and Displaying Output as Strings To label and display a result as a string: PRESERVE is demonstrated in the program BDISP . 1. Put the output object on the stack. 2. Enter the →STR command (PRG TYPE menu). BDISP (Binary Display) 3. Enter a string to label the object (with "" delimiters). BDISP displays a real or binary number in HEX, DEC, OCT, and BIN bases. 4. Enter the SWAP + commands to swap and concatenate the strings. 5. Enter a number specifying the line to display the string on. 6. Enter the DISP command (PRG OUT menu). Level 1 → Level 1 « … object →STR label SWAP + line DISP … » # n → # n DISP displays a string without its "" delimiters. n → n

150 RPL Programming RPL Programming Examples 27

%OK% − You must acknowledge a message box by pressing or . Example: Calculate F 13 and compare the execution time for the two methods. Select the VAR menu and do the calculation. Using Menus with Programs J You can use menus with programs for different purposes: 13 %FIBT% Menubased input. A program can set up a menu to get input during a halt in a program and then resume executing the same program.

Menubased application. A program can set up a menu and finish executing, leaving the menu to start executing other related programs. F13 is 233. FIB2 takes fewer seconds to execute than FIB1 (far fewer if n is large). (The times required for the To set up a builtin or library menu: calculations depend on the contents of memory and other factors, so you may not get the exact times shown above.) 1. Enter the menu number. 2. Enter the MENU command (MODES MENU menu). Displaying a Binary Integer To set up a custom menu: This section contains three programs: 1. Enter a list (with { } delimiters) or the name of a list defining the menu actions. If a list of two element lists is PAD is a utility program that converts an object to a string for rightjustified display. given, the first element appears in the menu, but it is the second element that is returned to the stack when the PRESERVE is a utility program for use in programs that change the calculator’s status (angle mode, binary base, menu key is pressed. This second element can itself be a list with up to 3 objects, one for the menu key, one for the and so on). left shift menu key and one for the right shift menu key. 2. Activate the menu: BDISP displays a binary integer in HEX, DEC, OCT, and BIN bases. It calls PAD to show the displayed numbers rightjustified, and it calls PRESERVE to preserve the binary base. To save the menu as the CST menu, enter the MENU command (MODES MENU menu). To make the menu temporary, enter the TMENU command (MODES MENU menu). The menu isn’t displayed until program execution halts. PAD (Pad with Leading Spaces) Menu numbers for builtin menus are listed in Appendix H. Library menus also have numbers — the library PAD converts an object to a string, and if the string contains fewer than 22 characters, adds spaces to the beginning number serves as the menu number. So you can activate applications menus (such as the SOLVE and PLOT of the string till the string reaches 22 characters. menus) and other menus (such as the VAR and CST menus) in programs. The menus behave just as they do during When a short string is displayed with DISP, it appears leftjustified: its first character appears at the left end of the normal keyboard operations. display. By adding spaces to the beginning of a short string, PAD moves the string to the right. When the string You create a custom menu to cause the behavior you need in your program — see the topics that follow. You can (including leading spaces) reaches 22 characters, it appears rightjustified : its last character appears at the right end of the display. PAD has no effect on longer strings. save the menu as the CST menu, so the user can get it again by pressing !£. Or you can make it temporary — it remains active (even after execution stops), but only until a new menu is selected — and it doesn’t affect the contents of variable CST . To specify a particular page of a menu, enter the number as m.pp , where m is the menu number and pp is the page Level 1 → Level 1 number (such as 94.02 for page 2 of the TIME menu). If page pp doesn’t exist, page 1 is displayed (94 gives page 1 object → "object " of the TIME menu). 69 MENU Example: Enter to get page 1 of the MODES MISC menu. Enter 69.02 MENU to get page 2 of the MODES MISC menu. Techniques used in PAD To restore the previous menu: WHILE…REPEAT…END (indefinite loop). The WHILE clause contains a test that executes the REPEAT Execute 0 MENU. clause and tests again (if true) or skips the REPEAT clause and exits (if false). To recall the menu number for the current menu: String operations. PAD demonstrates how to convert an object to string form, count the number of characters, and combine two strings. Execute the RCLMENU command (MODES MENU menu).

Using Menus for Input

To display a menu for input in a program: 1. Set up the menu — see the previous section. 2. Enter a command sequence that halts execution (such as DISP, PROMPT, or HALT).

152 RPL Programming RPL Programming Examples 25

1.25 !æ FIB2 program listing

Example: The following program, EIZ , constructs a custom menu to emulate the HP Solve application for a Program: Comments: capacitive electrical circuit. The program uses the equation E = IZ , where E is the voltage, I is the current, and Z is « the impedance. → n Creates a local variable structure. Because the voltage, current, and impedance are complex numbers, you can’t use the HP Solve application to find « EIZ direct solutions. The custom menu in assigns a solution to the leftshifted menu key for each variable, and IF n 1 ‰ assigns store and recall functions to the unshifted and rightshifted keys — the actions are analogous to the HP Solve If n ≤ 1, application. The custom menu is automatically stored in CST , replacing the previous custom menu — you can press THEN n then F n = n; !£ to restore the menu. ELSE otherwise …

0 1 Puts F 0 and F 1 on the stack. 2 n From 2 to n does the following loop: Program: Comments: START « DUP Copies the latest F (initially F 1) DEG 15 SF 16 SF Sets Degrees mode. Sets flags –15 and –16 to ROT Gets the previous F (initially F 0) 2 FIX display complex numbers in polar form. Sets the display mode to 2 Fix. + Calculates the next F (initially F 2) { Starts the custom menu list. NEXT Repeats the loop.

{ "E" { « 'E' STO » Builds menu key 1 for E. SWAP DROP Drops F n1. « I Z * DUP 'E' STO Unshifted action: stores the object in E. Left END Ends the ELSE clause. "E: " SWAP + CLLCD shift action: calculates I × Z , stores it in E, and 1 DISP 3 FREEZE » » Ends the defining procedure. « E » } } displays it with a label. Rightshift action: recalls the object in E. » Stores the program in FIB2 . { "I" { « 'I' STO » Builds menu key 2. `O FIB2 K « E Z / DUP 'I' STO "I:"SWAP + CLLCD 1 DISP 3 FREEZE » « I » } } Checksum: # 23902d (press O%FIB2% !°#MEM# %BYTES% ) Bytes: 89 { "Z"{ « 'Z' STO » Builds menu key 3. « E I / DUP 'Z' STO "Z:" SWAP + CLLCD 1 DISP 3 FREEZE » Example: Calculate F 6 and F 10 . « Z » } } } Ends the list. Calculate F 6. MENU Displays the custom menu. J » 6 %FIB2% Stores the program in EIZ . `OEIZ ‰

Calculate F 10 . For a 10volt power supply at phase angle 0°, you measure a current of 0.37amp at phase angle 68°. Find the 10 %FIB2% impedance of the circuit using EIZ . @J%EIZ% Key in the voltage value. !Ü10 ~@6 0

154 RPL Programming RPL Programming Examples 23 2

2. RPL Programming Examples The programs in this chapter demonstrate basic programming concepts. These programs are intended to improve your programming skills, and to provide supplementary functions for your calculator. At the end of each program, the program’s checksum and size in bytes are listed to help make sure you typed the program in correctly. (The checksum is a binary integer that uniquely identifies the program based on its contents). To make sure you’ve keyed the program in correctly, store it in its name, put the name in level 1, then execute the BYTES command ( !°#MEM# %BYTES% ). This returns the program’s checksum to level 2, and its size in bytes to level 1. (If you execute BYTES with the program object in level 1, you’ll get a different byte count.) The examples in this chapter assume the calculator is in its initial, default condition — they assume you haven’t changed any of the calculator’s operating modes, with the exception of selecting RPN mode. (To reset the calculator to this condition, see “Memory Reset” in chapter 5 of the HP 48G Series User's Guide .) Each program listing in this chapter gives the following information: A brief description of the program. A syntax diagram (where needed) showing the program’s required inputs and resulting outputs. Discussion of special programming techniques in the program. Any other programs needed. The program listing. The program’s checksum and byte size.

Fibonacci Numbers This section includes three programs that calculate Fibonacci numbers: FIB1 is a userdefined function that is defined recursively (that is, its defining procedure contains its own name). FIB1 is short. FIB2 is a userdefined function with a definite loop. It’s longer and more complicated than FIB1 , but faster. FIBT calls both FIB1 and FIB2 and calculates the execution time of each subprogram.

FIB1 and FIB2 demonstrate an approach to calculating the nth Fibonacci number F n, where:

F0 = 0, F1 = 1, Fn = Fn1 + Fn2 FIB1 (Fibonacci Numbers, Recursive Version)

Level 1 → Level 1

n → Fn

RPL Programming Examples 21

Enter the matrix. View these graphs with domain and range reversed to see how the domain of COS is restricted to make an inverse function possible. Consider the vertical band in the lower graph as the restricted !² domain Z = (x, y ). COS sends this domain onto the whole complex plane in the range 12 `56 `˜šš W = (u, v) = COS( x, y ) in the upper graph. 45 `1 ` Access: !¾ ( ¾ is the leftshift of the T key). Flags: Principal Solution (–1), Numerical Results (–3), Angle Mode (–17, –18) 9 `14 ` ` Input/Output: Select the VAR menu and execute MNX . Level 1/Argument 1 Level 1/Item 1 J %MNX% z → acos z 'symb ' → 'ACOS(symb)' See also: ASIN, ATAN, COS, ISOL

Find the maximum element. %MAX%

MNX2 (Minimum or Maximum Element—Version 2) Given an array on the stack, MNX2 finds the minimum or maximum element in the array. MNX2 uses a different approach than MNX : it executes OBJ→ to break the array into individual elements on the stack for testing, rather than executing GETI to index through the array.

Level 1 → Level2 Level 1

[[ array ]] → [[ array ]] Zmax or Z min

Techniques used in MNX2 FOR…NEXT (definite loop). The initial counter value is 1. The final counter value is nm –1, where nm is the number of elements in the array. The loopclause contains the sort instructions. User flag for logic control. User flag 10 defines the sort: When flag 10 is set, MNX2 finds the maximum element; when flag 10 is clear, it finds the minimum element. You determine the status of flag 10 at the beginning of the program. ACOS2S Nested conditional. An IF…THEN…END conditional is nested in the FOR…NEXT loop, and determines the following: Type: Command Whether to maintain the current minimum or maximum element, or make the current element the new Description: Transforms an expression by replacing acos( x) in subexpressions with π/2–asin( x). minimum or maximum. Access: Trigonometry, …Ñ The sense of the comparison of elements (either < or >) based on the status of flag 10. Input: The expression to transform. Logical function. MNX2 executes XOR ( exclusive OR ) to test the combined state of the relative value of the two elements and the status of flag 10. Output: The transformed expression. Custom menu. MNX2 builds a custom menu that lets you choose whether to sort for the minimum or Flags: Exact mode must be set (flag –105 clear). maximum element. Key 1, labeled %MAX% , sets flag 10. Key 2, labeled %MIN% , clears flag 10. Numeric mode must not be set (flag –3 clear). Radians mode must be set (flag –17 set). Example: Simplify the following expression:

218 RPL Programming Examples Full Command and Function Reference 37

!² ABCUV

Type: Command 12 `56 `˜šš Description: Returns a solution in polynomials u and v of au+bv =c where a and b are polynomials in the 45 `1 ` current CAS independent variable, and c is a value. 9 `14 ` Access: Arithmetic, !Þ POLYNOMIAL ` Input: Level 3/Argument 1: The polynomial corresponding to a. Level 2/Argument 2: The polynomial corresponding to b. Select the VAR menu and execute MNX2 . Level 1/Argument 3: The value corresponding to c. J %MNX2% Output: Level 2/Item 1: The solution corresponding to u. Level 1/Item 2: The solution corresponding to v. Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). Find the minimum element. Radians mode must be set (flag –17 set). %MIN% Example: Find a solution in polynomials u and v for the following equation: 2 2 ()x +x + 1 u+() x + 4 V = 13 Command: ABCUV(X^2+X+1,X^2+4,13) Result: {(X+3),X+4} Applying a Program to an Array See also: IABCUV, EGCD

APLY makes use of list processing to transform each element of an array according to a desired procedure. ABS Type: Function The procedure applied to each element must be a program that takes exactly one argument (i.e. the element) and Description: Absolute Value Function: Returns the absolute value of its argument. returns exactly one result (i.e. the transformed element). ABS has a derivative (SIGN) but not an inverse. The procedure assumes flag –55 to be clear, and unexpected results could be returned if flag –55 is set. In the case of an array, ABS returns the Frobenius (Euclidean) norm of the array, defined as the square root of the sum of the squares of the absolute values of all n elements. That is:

n 2 Level 2 Level 1 → Level 1 ∑ zi i = 1

[ array ] « program » → [[ array ]] or {{ array }} Access: !Ê ( Ê is the leftshift of the /key). Flags: Numerical Results (–3) Techniques used in APLY Input/Output: Manipulating MetaObjects. Metaobjects are composite objects like arrays and lists that have been disassembled on the stack. APLY illustrates several approaches to manipulating the elements and dimensions of such objects. Level 1/Argument 1 Level 1/Item 1 Application of List Processing. APLY makes use of DOSUBS (although DOLIST might also have been used) x → |x| to perform the actual transformation of array elements. 2 2 (x,y) → x + y Using an IFERR…THEN…ELSE…END Structure. The entire symbolic pseudoarray case is handled within a error structure — triggered when the →ARRY command generates an error when symbolic elements are x_unit → |x|_unit present. [array] → ||array|| Using Flags. User flag 1 is used to track the case when the input array is a vector. 'symb ' → 'ABS(symb)' APLY program listing See also: NEG, SIGN

Program: Comments: ACK « Type: Command → a p Store the array and program in local variables. Description: Acknowledge Alarm Command: Acknowledges the oldest pastdue alarm. « Begin the main local variable structure. ACK clears the alert annunciator if there are both no other pastdue alarms and no other active alert sources (such as a low battery condition).

220 RPL Programming Examples Full Command and Function Reference 35

Computer Algebra System Commands and Functions Program: Comments: NEXT Repeat loop for the next row. The , or CAS, is a collection of operations that can be applied to algebraic expressions. n →LIST Gather rows into a list, forming a list of lists The calculator’s operations can be used with numbers to produce numeric results, or with symbols to produce (symbolic pseudoarray). algebraic expressions. Algebraic expressions and equations can be written using the Equation Writer too. Algebraic » Close the local variable structure and end the expressions and symbolic operations on them, called computer algebra operations, are introduced in Chapter 5 of END 1 CF IFERR…THEN…END structure. Clear flag 1 the User’s Manual. before exiting the program. Further explanations of computer algebra operations, are given in the User’s Guide, whereas this part of the » Advanced User’s Guide lists the computer algebra operations that can be applied to symbolic expressions, with a » description of each one listed. Stores the program in APLY . `OAPLY K These operations perform tasks such as rearrangement of trigonometric and logarithmic functions, or manipulation of polynomials, series and matrices. They are referred to as the “Computer Algebra System” or the CAS. Many of the CAS operations are of particular use in Linear Algebra applications and in Vector Algebra. The CAS on the Checksum: # 11132d calculator allows it to provide many of the features of the Computer Algebra Systems used on laptop and desktop Bytes: 314 computers. Note: The Computer Algebra System should not be confused with Algebraic mode, which is one of the calculator’s Example: Apply the function, f(x) = Ax 37 to each element x of the vector [ 3 2 4 ]. operating modes. The CAS works with algebraic (or symbolic) expressions, which can be entered and used in Algebraic mode or in RPN mode. !Ô3†2W†4` Classification of Operations ‚å 3 QA *7 - The command dictionary contains commands , functions , and analytic functions . Commands are calculator operations that %APLY% `J can be executed from a program. Functions are commands that can be included in algebraic objects. Analytic H#DISP ˜˜ functions are functions for which the calculator provides an inverse and a derivative. There are also four non programmable operations (DBUG, NEXT, SST, and SST↓) that are included with the programmable commands as a (select small stack display to see convenience because they are used interactively while programming. all vector elements.) When working with functions or commands within the Equation Writer: • When you apply a function to an expression, the function becomes part of the expression. You need to ensure Converting Between Number Bases that the expression is selected, then press N to apply the function to the selection. • When you apply a command to an expression in Equation Writer, it is evaluated immediately. 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 The definitions of the abbreviations used for argument and result objects are contained in the following table, nearest integer. “Terms Used in Stack Diagrams.” Often, descriptive subscripts are added to convey more information.

Level 2 Level 1 → Level 1 x b → x base b: "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 Full Command and Function Reference 33 3 Program: Comments: UNTIL 'm' EVAL 0 == Repeat the DO...UNTIL loop until m = 0 (i.e. all decimal value have been accounted for). 3. Full Command and Function Reference END Is flag 1 set? Clear the flag after the test. Introduction IF 1 FS?C This chapter details the calculator’s commands and functions. THEN "0" + Then add a placeholding zero to the result string. These listings include the following information: WHILE i 'k' EVAL Begin WHILE...REPEAT loop to a brief definition of what the command or function does 0 ‹ determine if additional placeholding additional information about how it works and how to use it zeros are needed. the key to press to gain access to it Loop repeats as long as i≠k. any flags that may affect how it works a stack diagram showing the arguments it requires (if any) REPEAT "0" + Add an additional placeholding zero and related commands or functions 1 'k' STO+ increment k before repeating the test

clause. How to Access Commands and Functions END End the WHILE...REPEAT...END Many of the commands and functions in this reference are not located on the calculator’s keyboard and are accessed END loop, the IF...THEN...END structure, … P » and the inner local variable structure. by pressing . This is the rightshifted function of the key, which is the fourth key from the left on the fourth row of keys from the top. Once accessed, the function or command’s name is found by pressing the " base" b + End the outermost ~key and then using the letter keys to spell out the function or command’s name. Usually, pressing the first letter n SWAP + →TAG IF...THEN...ELSE...END structure and of the command will move the catalog list close enough to the function to use the ˜key to find the function. create the label string and tag the result string using the original arguments. For functions or commands (or symbols) that are located on the calculator’s keyboard as shifted functions of other keys (such as … above), the proper shift key is shown followed by a font symbol indicating the function, f STOF Restore original flag settings. command or symbol written above the key. » ! H » In some cases, access is shown with two keys with an ampersand (&) in between, such as & . This notation means that you must press the first key and hold it down while then pressing the second key at the same time. Stores the program in nBASE . `OnBASE K The next few pages explain how to read the stack diagrams in the command reference, how commands are alphabetized, and the meaning of command classifications at the upper right corner of each stack diagram. Checksum: # 54850d Bytes: 433 How to Read Stack Diagrams

Example: Convert 1000 10 to base 23. Many entries in the command reference include a stack diagram . This is a table showing the arguments that the 1000 `23 J %NBASE% command, function, or analytic function takes from the stack in RPN mode or from the argument order in algebraic mode, and the results that it returns to the stack (in RPN mode) or displays (in algebraic mode; if there is more than one output, they are written to a list). The “→” character (pronounced “to” as in “to list” for →LIST) in the table separates the arguments from the results. The stack diagram for a command may contain more than one “argument Verifying Program Arguments → result” line, reflecting all possible combinations of arguments and results for that command. Consider this example: The two utility programs in this section verify that the argument to a program is the correct object type. ACOS NAMES verifies that a list argument contains exactly two names. Type: Analytic Function VFY verifies that the argument is either a name or a list containing exactly two names. It calls NAMES if the Input/Output: argument is a list. Level 1/Argument 1 Level 1/Item 1 You can modify these utilities to verify other object types and object content. z → acos z 'symb ' → 'ACOS(symb)' This diagram indicates that the analytic function ACOS ( Arc Cosine ) takes a single argument from level 1 and returns one result (to level 1). ACOS can take either a real or complex number or an algebraic object as its argument. In the

224 RPL Programming Examples Full Command and Function Reference 31

Example: Find the value of x for which X→FX equals 599.5. Use a guess in the vicinity of 1. Checksum: # 10752d Start by keying in X→FX : Bytes: 141.5 @å@é †O NAMES is demonstrated in the program VFY . x 3.7 *x Q3 +4.5 * x Q2 VFY (Verify Program Argument) +3.9 *x +5 ` VFY verifies that an argument on the stack is either a name or a list that contains exactly two names.

Level 1 → Level 1 Store the program in X→FX , then enter the program name, the yvalue 599.5, and the guess 1, and execute 'name' → 'name' ROOTR : { valid list } → { valid list } O X→FX K O J %X²FX% ` { invalid list } → { invalid list } (and error message in status area) 599.5 ` 1 %ROOTR% invalid object → invalid object (and error message in status area)

Techniques used in VFY Utility programs. VFY by itself has little use. However, it can be used with minor modifications by other programs to verify that specific object types are valid arguments. CASE…END case structure). VFY uses a case structure to determine if the argument is a list or a name. Animating a Graphical Image Structured programming. If the argument is a list, VFY calls NAMES to verify that the list contains exactly two names. Program WALK shows a small person walking across the display. It animates this custom graphical image by incrementing the image position in a loop structure. Local variable structure. VFY stores its argument in a local variable so that it can be passed to NAMES if necessary. Techniques used in WALK Logical function. VFY uses NOT to display an error message. Custom graphical image. (Note that the programmer compiles the full information content of the graphical image before writing the program by building the image interactively in the Graphics environment and then Required Programs returning it to the command line.) NAMES FOR…STEP (definite loop). WALK uses this loop to animate the graphical image. The ending value for the NAMES verifies that a list argument contains exactly two names. loop is MAXR. Since the counter value cannot exceed MAXR, the loop executes indefinitely.

VFY program listing WALK program listing

Program: Comments: Program: Comments: « « DUP GROB 9 15 E300 Puts the graphical image of the Copies the original argument to leave on 140015001C001400E300 the stack. walker in the command line. 8000C110AA0094009000 (Note that the hexadecimal DTAG Removes any tags from the argument for 4100220014102800 portion of the graphics object is subsequent testing. a continuous integer → argm Stores the argument in local variable argm . E300...2800 . The « Begins the defining procedure. linebreaks do not represent CASE Begins the case structure. spaces.) argm TYPE 5. SAME Tests if the argument is a list. → walk Creates local variable walk THEN If so, puts the argument back on the stack containing the graphics object. argm NAMES and calls NAMES to verify that the list is « END valid, then leaves the CASE structure. ERASE { # 0d # 0d } Clears PICT , then displays it. PVIEW

226 RPL Programming Examples RPL Programming Examples 239

Techniques used in →RPN Trace Mode Recursion. The →RPN program calls itself as a subroutine. This powerful technique works just like calling This section contains two programs, αENTER and ßENTER , which together provide “trace mode” for the another subroutine as long as the stack contains the proper arguments before the program calls itself. In this case calculator using an external printer. To turn on “trace mode,” set flag –63 and activate User mode. To turn off the level 1 argument is tested first to be sure that it is an algebraic expression before →RPN is called again. “trace mode,” clear flag –63 or turn off User mode. Object TypeChecking. →RPN uses conditional branching that depends on the object type of the level 1 object. Techniques used in αENTER and ßENTER Nested program Structures. →RPN nests IF…THEN…END structures inside FOR…NEXT loops inside a Vectored ENTER. Setting flag –63 and activating User mode turns on vectored ENTER. When vectored IF…THEN… ELSE…END structure. ENTER is turned on and variable αENTER exists, the commandline text is put on the stack as a string and αENTER is evaluated. Then, if variable ßENTER exists, the command that triggered the commandline List Concatenation. The result list of objects in RPN order is built by using the ability of the + command to sequentially append additional elements to a list. This is a handy technique for gathering results from a looping processing is put on the stack as a string and ßENTER is evaluated. procedure. αENTER program listing →RPN program listing Program: Comments: Program: Comments: « « PR1 Prints the command line text, OBJ→ Take the expression apart. OBJ→ then converts the string to an IF OVER If the argument count is nonzero, then object and evaluates it. THEN → n f store the count and the function. » « Begins local variable defining procedure. Stores the program in αENTER . `O αENTER K 1 n Begins FOR…NEXT loop, which (Press ~‚A to type α. You FOR i converts any algebraic arguments to lists. must use this name.) IF DUP TYPE 9. SAME Tests whether argument is an algebraic. Checksum: # 127d THEN →RPN If argument is an algebraic, convert it to a Bytes: 25.5 list first. ßENTER program listing END n ROLLD Roll down the stack to prepare for the next argument. Program: Comments: NEXT Repeat the loop for the next argument. « IF DUP TYPE 5. ‹ Tests to see if level 1 object is a list. PR1 DROP Prints the command that caused THEN 1 →LIST If not a list, then convert it to one. PRSTC the processing, then drops it and END Ends the IF…THEN…END structure. prints the stack in compact form. IF n 1 > Tests to see if there is more than one » argument. Stores the program in ßENTER . `O ßENTER K THEN 2 n Combine all of the arguments into a list. (Press ~‚B to type ß. You START + must use this name.) NEXT END f + Append the function to the end of the list. Checksum: # 31902d » End the local variable defining procedure. Bytes: 28 ELSE 1 →LIST SWAP DROP For functions with no arguments, converts to a simple list. END End the IF…THEN… ELSE…END structure. » `O→RPN K Stores the program in →RPN.

228 RPL Programming Examples RPL Programming Examples 237

BER program listing Program: Comments:

(66,32) 20 0 6.28 ARC Draws the circle.

Program: Comments: PICT RCL →LCD Displays the empty circle. « RCLΣ TOT / Recalls the statistics data matrix, → x Creates local variable x. computes totals, and calculates the « Begins outer defining procedure. proportions. DUP 100 * 'x/2' →NUM 2 1 Enters x/2, the first counter value, and Converts the proportions to → xover2 j sum the first term of the series, then creates percentages. local variables. → prcnts Stores the percentage matrix in prcnts . « Begins inner defining procedure. DO Begins the loop. « Multiplies the proportion matrix by 2 π →NUM * * 2π, and enters the initial angle (0). sum Recalls the old sum and calculates the 0 'sum+(1)^(j/2)* new sum. xover2^(2*j)/SQ(j!)' → prop angle Stores the angle matrix in prop and EVAL angle in angle . 2 'j' STO+ Increments the counter. « Sets up 1 to m as loop counter range. DUP 'sum' STO Stores the new sum. prop SIZE OBJ→ DROP SWAP UNTIL Ends the loop clause. FOR n == Tests the old and new sums. Begins loopclause. (66,32) prop n GET Puts the center of the circle on the END Ends the loop. 'angle' STO+ stack, then gets the nth value from sum Recalls the sum. the proportion matrix and adds it to » Ends inner defining procedure. angle . » Ends outer defining procedure. angle COS angle SIN Computes the endpoint and draws » R→C 20 * OVER + the line for the nth slice. LINE Stores the program in BER . `OBER K PICT RCL Recalls PICT to the stack. angle prop n GET For labeling the slice, computes the Checksum: # 15837d 2 / DUP DUP midpoint of the arc of the slice. Bytes: 203 COS SWAP SIN R→C 26 * (66,32) + Example: Calculate BER(3). SWAP Starts the CASE structure to test CASE J angle and determine the offset value for the label. 3 %BER% DUP 1.5 ‰ From 0 to 1.5 radians, doesn’t offset THEN the label. Calculate BER(2) in algebraic syntax. DROP END O %BER% !Ü2 DUP 4.4 ‰ From 1.5 to 4.4 radians, offsets the N THEN label 15 user units left. DROP 15 END 5 < From 4.4 to 5 radians, offsets the THEN label 3 units right and 2 units up. (3,2) + END END Ends the CASE structure.

230 RPL Programming Examples RPL Programming Examples 235

SETTS (Superimposing Taylor’s polynomials) SETTS superimposes successive Taylor’s polynomials on a sine curve and stores each graphics object in a list. TSA (Animating Taylor’s Polynomials) TSA displays in succession each graphics object created in SETTS . Techniques used in SETTS Techniques used in TSA Structured programming. SETTS calls SINTP to build a sine curve and convert it to a graphics object. Passing a global variable. Because SETTS takes several minutes to execute, TSA does not call SETTS . Instead, FOR…STEP (definite loop). SETTS calculates successive Taylor’s polynomials for the sine function in a you must first execute SETTS to create the global variable TSL containing the list of graphics objects. TSA definite loop. The loop counter serves as the value of the order of each polynomial. simply executes that global variable to put the list on the stack. Programmatic use of PLOT commands. SETTS draws a plot of each Taylor’s polynomial. ANIMATE. TSA uses the ANIMATE command to display in succession each graphics object from the list. Manipulation of graphics objects. SETTS converts each Taylor’s polynomial plot into a graphics object. Then it executes + to combine each graphics object with the sine curve stored in SINT , creating nine new graphics TSA program listing objects, each the superposition of a Taylor’s polynomial on a sine curve. SETTS then puts the nine new graphics objects, and the sine curve graphics object itself, in a list. Program: Comments: « SETTS program listing TSL OBJ→ Puts the list TSL on the Program: Comments: stack and converts it to 10 graphics objects and the list « count. SINTP Plots a sine curve and stores { { #0 #0 } .5 0 } + Set up the parameters for the graphics object in SINT . ANIMATE. 1 17 FOR n Sets the range for the FOR ANIMATE Displays the graphics in loop using local variable n. succession. 'SIN(X)' 'X' n TAYLR Plots the Taylor’s polynomial 11 DROPN Removes the graphics objects STEQ ERASE DRAW of order n. and list count from the stack. PICT RCL SINT + Returns the plot to the stack » as a graphics object and Stores the program in TSA . executes + to superimpose `OTSA K the sine plot from SINT . 2 STEP Increments the loop counter Checksum: # 24644d n by 2 and repeats the loop. Bytes: 92.5 SINT Puts the sine curve graphics Example: Execute SETTS and TSA to build and display in succession a series of Taylor’s polynomial 10 →LIST object on the stack, then approximations of the sine function. 'TSL' STO builds a list containing it and Ensure Radians mode is set and execute SETTS to build the list of graphics objects. ( SETTS takes several minutes the nine graphics objects to execute.) Then execute TSA to display each plot in succession. The display shows TSA in progress. created in the loop. Stores the list in TSL . !&H %!ANGLE% %!RAD% ( if necessary) » J %SETTS% Stores the program in `O K %TSA% SETTS SETTS .

Checksum: # 41304d Bytes: 130.5

SETTS is demonstrated in the program TSA . Press − to stop the animation. Press !&H %!ANGLE% %!DEG% to restore Degrees mode if desired.

232 RPL Programming Examples RPL Programming Examples 233

Flags: Exact mode must be set (flag –105 clear). →COL Numeric mode must not be set (flag –3 clear). Type: Command Radians mode must be set (flag –17 set). Description: Matrix to Columns Command: Transforms a matrix into a series of column vectors and returns Example: Express the result of the following addition in modulo 7. the vectors and a column count, or transforms a vector into its elements and returns the elements (x2+3 x+6)+(9 x+3) and an element count. Note: Before trying this example, use the CAS modes input form to set the modulo to 7. →COL introduces no rounding error. Command: ADDTMOD(X^2+3*X+6,9*X+3) Access: !´MATRIX COL →COL ( ´ is the leftshift of the Pkey). Result: X^22*X+2 !Ø CREATE COLUMN →COL ( Ø is the leftshift of the 5key).

ADDTOREAL Input/Output: Type: Command Level 1/Argument 1 Leveln+1/Item 1 ... Level 2/Item 2 Level 1/Item 3

Description: Adds specified global names to the reserved variable REALASSUME. This is a list of the global [[ matrix ]] → [ vector ]col1 [ vector ] coln ncolcount real variables that will be treated by some CAS operations as numbers when Complex mode is set. [ vector ] → element 1 element n nelementcount If a variable is already in the REALASSSUME list, this command removes any additional See also: COL→, →ROW, ROW →

assumptions made on it by ASSUME. Access: Catalog, … COL → Type: Command Input: Level 1/Item 1: The name of the global variable to be added to the REALASSUME list, or a list Description: Columns to Matrix Command: Transforms a series of column vectors and a column count into a of names. matrix containing those columns, or transforms a sequence of numbers and an element count into Output: No output in RPN mode, NOVAL in Algebraic mode. a vector with those numbers as elements. Flags: If the “all variables are real” flag is set (flag –128 set), ADDTOREAL will not add anything to the All vectors must have the same length. The column or element count is rounded to the nearest REALASSUME list, as all variables are assumed real anyway. In this case it will only remove integer. further assumptions made by ASSUME. Access: !´MATRIX COL COL → ( ´ is the leftshift of the Pkey). !Ø Ø 5 See also: ASSUME, DEF, STORE, UNASSUME, UNBIND CREATE COLUMN COL → ( is the leftshift of the key). Input/Output: ALGB Ln+1/A1 ... L2/A2 L1/An+1 Level 1/Item 1 Type: Command [ vector ] col1 [ vector ] coln ncolcount → [[ matrix ]] Description: Displays a menu or list of CAS algebraic operations. element 1 element n nelementcount → [ vector ] Access: … Catalog, L = Level; A = Argument; I = item Flags: If the CHOOSE boxes flag is clear (flag –117 clear), displays the operations as a numbered list. If See also: →COL, →ROW, ROW→

the flag is set, displays the operations as a menu of function keys. See also: ARIT, CONSTANTS, DIFF, EXP&LN, INTEGER, MAIN, MATHS, MATR, MODULAR, COL– POLYNOMIAL, REWRITE, TESTS, TRIGO Type: Command Description: Delete Column Command: Deletes column n of a matrix (or element n of a vector), and returns ALOG the modified matrix (or vector) and the deleted column (or element). Type: Analytic Function n is rounded to the nearest integer. Description: Common Antilogarithm Analytic Function: Returns the common antilogarithm; that is, 10 raised Access: !´MATRIX COL COL ( ´ is the leftshift of the Pkey). to the given power. !Ø Ø 5 For complex arguments: 10 (x,y) = ecx cos cy + i e cx sin cy where c = ln 10. CREATE COLUMN COL ( is the leftshift of the key). Access: ! (  is the leftshift of the V key). Input/Output: Flags: Numerical Results (–3) Level 2/Argument 1 Level 1/Argument 2 Level 2/Item 1 Level 1/Item 2 Input/Output: [[ matrix ]] 1 ncolumn → [[ matrix ]] 2 [ vector ] column Level 1/Argument 1 Level 1/Item 1 [ vector ] 1 nelement → [ vector ] 2 element n

z → 10 z See also: COL+, CSWP, ROW+, ROW– 'symb ' → 'ALOG(symb) ' See also: EXP, LN, LOG

310 Full Command and Function Reference Full Command and Function Reference 339

Input/Output: CLEAR Type: Command Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Description: Clear Command: Removes all objects from the stack or history.

#n1 #n2 → #n3 To recover a cleared stack or history, press … (the rightshift of the Mkey) before

“string 1” “string 2” → “string 3” executing any other operation. There is no programmable command to recover the stack or history. T/F 1 T/F 2 → 0/1 Access: … (is the rightshift of the ƒkey). T/F 'symb ' → 'T/F AND symb ' Input/Output: 'symb ' T/F → 'symb AND T/F '' Level n/Argument 1 ... Level 1/Argument n Level n/Item 1 ... Level 1/Item n 'symb 1' 'symb 2' → 'symb 1 AND symb 2' obj n ...obj 1 → See also: NOT, OR, XOR See also: CLVAR, PURGE ANIMATE Type: Command CLKADJ Description: Animate Command: Displays graphic objects in sequence. Type: Command ANIMATE displays a series of graphics objects (or variables containing them) one after the other. Description: Adjust System Clock Command: Adjusts the system time by x clock ticks, where 8192 clock ticks You can use a list to specify the area of the screen you want to animate (pixel coordinates #X and equal 1 second. If x is positive, x clock ticks are added to the system time. If x is negative, x clock #Y ), the number of seconds before the next grob is displayed ( delay ), and the number of times the ticks are subtracted from the system time. If X>10^12, it will be changed to 10^12 ticks (which is sequence is run ( rep ). If rep is set to 0, the sequence is played approximately one million times approximately 3.87 years). (1,048,575 cycles), or until you press − (the $ key). Access: …ÓTOOLS LLCLKADJ ( Ó is the rightshift of the 9 key). If you use a list on level 1, all parameters must be present. Input/Output: If the list specifier is not used, the delay between each grob will default to 0.1 second. Level 1/Argument 1 Level 1/Item 1 The animation displays PICT while displaying the grobs. The grobs and the animate parameters x → are left on the stack. See also: →TIME Access: !°LGROB LANIMATE ( °is the leftshift of the Nkey). Input/Output: CLLCD Type: Command Ln+1.../A1 L1/An+1 L1/I1 Description: Clear LCD Command: Clears (blanks) the stack display.

grob n...grob 1 ngrobs → same stack The menu labels continue to be displayed after execution of CLLCD. When executed from a program, the blank display persists only until the keyboard is ready for grob n...grob 1 { n {#X#Y } delay rep } → same stack input. To cause the blank display to persist until a key is pressed, execute FREEZE after executing CLLCD. (When executed from the keyboard, CLLCD automatically freezes the display.) L = Level, A = Argument, I = item Access: !°LOUT CLLCD ( °is the leftshift of the Nkey). Example: The following program draws half a cylinder and rotates it: « PARSURFACE { 'COS(X)' 'SIN(X)' Y } Input/Output: None STEQ Example: Evaluating « CLLCD 7 FREEZE » blanks the display (except the menu labels), then « I 180 I + XXRNG ERASE DRAW PICT RCL » freezes the entire display. I 0 359 8 SEQ OBJ ANIMATE DROPN » See also: DISP, FREEZE This program also illustrates the use of SEQ and PARSURFACE. You can adjust the increment value used with SEQ (8 is used here) to change the number of images drawn by the program, or CLOSEIO to use less memory. Type: Command See also: BLANK, →GROB Description: Close I/O Port Command: Closes the , and clears the input buffer and any error messages for KERRM. ANS When the calculator turns off, it automatically closes the serial port, but does not clear KERRM. Type: Command Therefore, CLOSEIO is not needed to close the port, but can conserve power without turning Description: Recalls the nth answer from history, where n is an integer, in algebraic mode only. When called off the calculator. directly from the keybard in RPN mode, it takes no input and performs the LASTARG Executing Kermit protocol commands automatically clears the input buffer; however, executing command. When the command name is typed manually in RPN mode, it performs PICK, with nonKermit commands (such as SRECV and XMIT) does not. the exception that any stack levels containing nulltagged expressions (surrounded by ` CLOSEIO also clears error messages from KERRM. This can be useful when debugging.

312 Full Command and Function Reference Full Command and Function Reference 337

Access: !°LPICT ARC ( °is the leftshift of the Nkey). Example: Find the Cholesky factorization of:

Flags: Angle Mode (–17 and –18). The setting of flags –17 and –18 determine the interpretation of xθ1 1 1 and xθ2 (degrees, radians, or grads). 1 5

Input/Output: 1 1  CHOLESKY  Level 4/Argument 1 Level 3/Argument 2 Level 2/Argument 3 Level 1/Argument 4 Level 1/Item 1 1 5  Command: (x, y) xradius xθ1 xθ2 → 1 1 { #n,#m } #n radius xθ1 xθ2 → 0 2 Result: Flags: Angle Mode (–17 and –18) See also: BOX, LINE, TLINE CHOOSE Type: Command ARCHIVE Description: Create UserDefined Choose Box Command: Creates a userdefined choose box. Type: Command CHOOSE creates a standard singlechoice choose box based on the following specifications: Description: Archive HOME Command: Creates a backup copy of the HOME directory (that is, all variables), Variable Function the userkey assignments, and the alarm catalog in the specified backup object (: nport :name ) in RAM or flash ROM. “prompt ” A message that appears at the top of choose box. If “ prompt ” is an The specified port number can be 0 through 3, where 3 is the SD card. (Port 3 only applies to the empty string (“”), no message is displayed. HP 50g and 49g+.) An error will result if there is not enough memory in the specified port to copy the HOME directory. {c1 … cn} Definitions that appear within the choose box. A choice definition If the backup object is “:IO:name”, then the copied directory is transmitted in binary via Kermit (cx) can have two formats. protocol through the current I/O port to the specified filename. • obj , any object To save flag settings, execute RCLF and store the resulting list in a variable. • { obj display obj result }, the object to be displayed followed by the result returned to the stack if that object is selected. Access: !°MEMORY LARCHIVE ( °is the leftshift of the Nkey). Flags: I/O Device (–33), I/O Messages (–39), I/O Device for Wire (–78) if the argument is “:IO:name”. npos The position number of an item definition. This item is highlighted Input/Output: when the choose box appears. If npos = 0, no item is highlighted, and the choose box can be used to view items only. Level 1/Argument 1 Level 1/Item 1 If you choose an item from the choose box and press OK , CHOOSE returns the result (or the

:nport :name → object itself if no result is specified) to level 2 and 1 to level 1. If you press −, CHOOSE :IO :name → returns 0. Also, if npos = 0, CHOOSE returns 0. See also: RESTORE Access: !°LIN CHOOSE ( °is the leftshift of the Nkey). Input/Output: ARG Type: Function L3/A1 L2/A2 L1/A3 L2/I1 L1/I2

Description: Argument Function: Returns the (real) polar angle θ of a complex number ( x, y). “prompt” { c 1 ... c n } npos → obj or result “1”

The polar angle θ is equal to: “prompt” { c 1 ... c n } npos → “0” • atan y/x for x ≥ 0 L = Level; A = Argument; I = item • atan y/x + π sign y for x < 0, Radians mode Example: CHOOSE with the following three lines as input would produce a threeline choose box: • atan y/x + 180 sign y for x < 0, Degrees mode "Select a Program" • atan y/x + 200 sign y for x < 0, Grads mode { { "Pie Chart" «PIE» } { "Inverse Function" «ROOTR» } A real argument x is treated as the complex argument ( x, 0). { "Animate Taylor" «TSA» } } Access: …Ë (Ë is the rightshift of the /key). 1 Flags: Angle mode (–17, –18) See also: INFORM, NOVAL Input/Output: CHR Level 1/Argument 1 Level 1/Item 1 Type: Command (x, y) → θ Description: Character Command: Returns a string representing the character corresponding to the character code n. 'symb ' → 'ARG(symb)' See also: ATAN

314 Full Command and Function Reference Full Command and Function Reference 335

The inverse of SIN is a relation , not a function, since SIN sends more than one argument to the CEIL same result. The inverse relation for SIN is expressed by ISOL as the general solution : Type: Function ASIN(Z)*(1)^n1+ π*n1 Description: Ceiling Function: Returns the smallest integer greater than or equal to the argument. The function ASIN is the inverse of a part of SIN, a part defined by restricting the domain of SIN Access: !´REAL LL CEIL ( ´ is the leftshift of the Pkey). such that: Flags: Numerical Results (–3) • each argument is sent to a distinct result, and Input/Output: • each possible result is achieved. Level 1/Argument 1 Level 1/Item 1 The points in this restricted domain of SIN are called the principal values of the inverse relation. ASIN in its entirety is called the principal branch of the inverse relation, and the points sent by x → n ASIN to the boundary of the restricted domain of SIN form the branch cuts of ASIN. x_unit → n_unit The principal branch used by the calculator for ASIN was chosen because it is analytic in the 'symb ' → 'CEIL(symb) ' regions where the arguments of the realvalued inverse function are defined. The branch cut for the

complexvalued arc sine function occurs where the corresponding realvalued function is See also: FLOOR, IP, RND, TRNC undefined. The principal branch also preserves most of the important symmetries. The graphs below show the domain and range of ASIN. The graph of the domain shows where CENTR the branch cuts occur: the heavy solid line marks one side of a cut, while the feathered lines mark Type: Command the other side of a cut. The graph of the range shows where each side of each cut is mapped Description: Center Command: Adjusts the first two parameters in the reserved variable PPAR, (xmin , ymin ) and under the function. These graphs show the inverse relation ASIN(Z)*(–1)^n1+π*n1 for the case (xmax, ymax ), so that the point represented by the argument ( x, y ) is the plot center. On the HP 50g n1 =0. For other values of n1 , the vertical band in the lower graph is translated to the right (for n1 and 49g+, the center pixel is in row 40, column 65 when PICT is its default size (131 × 80). On positive) or to the left (for n1 negative). Taken together, the bands cover the whole complex the 48gII, the center pixel is in row 32, column 65 when PICT is its default size (131 × 64). plane, which is the domain of SIN. If the argument is a real number x, CENTR makes the point ( x,0) the plot center. View these graphs with domain and range reversed to see how the domain of SIN is restricted to Access: …CENTR make an inverse function possible. Consider the vertical band in the lower graph as the restricted Input/Output: domain Z = (x, y ). SIN sends this domain onto the whole complex plane in the range Level 1/Argument 1 Level 1/Item 1 W = (u, v ) = SIN( x, y ) in the upper graph. (x, y ) → x → See also: SCALE

CF Type: Command Description: Clear Flag Command: Clears the specified user or system flag. User flags are numbered 1 through 128. System flags are numbered –1 through –128. See Appendix C for a listing of the calculator’s system flags and their flag numbers. Access: !°TEST LLCF ( °is the leftshift of the Nkey). Input/Output: Level 1/Argument 1 Level 1/Item 1

nflagnumber → See also: FC?, FC?C, FS?, FS?C, SF

%CH Type: Function Description: Percent Change Function: Returns the percent change from x to y as a percentage of x. If both arguments are unit objects, the units must be consistent with each other. The dimensions of a unit object are dropped from the result, but units are part of the calculation . For more information on using temperature units with arithmetic functions, refer to the keyword entry of +.

Access: !¼ ( ¼is the leftshift of the Skey). Access: !´REAL %CH ( ´ is the leftshift of the Pkey). Flags: Principal Solution (–1), Numerical Results (–3), Angle Mode (–17, –18) Flags: Numerical Results (–3)

316 Full Command and Function Reference Full Command and Function Reference 333

The principal branch used by the calculator for ASINH was chosen because it is analytic in the If # n ≥ # 1000000000000 (base 10), only the 12 most significant decimal digits are preserved in regions where the arguments of the realvalued function are defined. The branch cut for the the resulting mantissa. complexvalued ASINH function occurs where the corresponding realvalued function is Access: …ãB→R ( ãis the rightshift of the 3key). undefined. The principal branch also preserves most of the important symmetries. Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) The graph for ASINH can be found from the graph for ASIN (see ASIN) and the relationship Input/Output: asinh z = –i asin iz. Level 1/Argument 1 Level 1/Item 1 Access: …ÑHYPERBOLIC ASINH (Ñ is the rightshift of the 8key). Flags: Principal Solution (–1), Numerical Results (–3) #n → n Input/Output: See also: R→B

Level 1/Argument 1 Level 1/Item 1 C$ Type: Command z → asinh z Description: Counted String Command: Enters C$ on the command line to help with the manual entry of a 'symb ' → 'ASINH(symb)' string object. Must be followed by a number indicating the number of characters to include in the strings, or an additional $ to indicate that the rest of the command line is a single string. There See also: ACOSH, ATANH, ISOL, SINH

must be exactly one separator character after the second $ and before the body of the string. ASN If the declared length is greater than the number of characters actually available, the string is Type: Command automatically truncated to the correct length. Description: Assign Command: Defines a single key on the user keyboard by assigning the given object to the Access: None. Must be typed in. Example 1: C$ 3 a"b returns "a"b" on level 1. key xkey , which is specified as rc.pf . C$ 3abcdef "abc" 'def' The argument xkey is a real number rc.pf specifying the key by its row number r, column number c , Example 2: returns on level 2 and on level 1 (assuming def is undefined). shift plane p and shiftandhold flag f . A value of f=0 represents a normal shifted key assignment Example 3: C$ $ abcdef returns "abcdef" on level 1.

(where the shift is released prior to pressing the key); whereby f=1 corresponds to a shiftand hold key assignment indicated by “&” in the table below (where the shift is held while pressing C2P the key). The legal values for p and f are as follows: Type: Command

Value of Value Description: Takes a list of cycles as an argument, and returns the equivalent permutation. In other words, Shift Shift .pf of .pf finds a permutation from its cyclical decomposition.

Access: Arithmetic, !ÞPERMUTATION .00 or .10 Unshifted [key] Input: A list of cycles equivalent to a permutation. For example, the list {1,3,5} defines a cycle C, such .20 !(leftshifted) [key] .21 ! & [key] that C(1)=3, C(3)=5 and C(5)=1, while items 2 and 4 are not changed. This could be followed by {2,4} which defines a cycle C, such that C(2)=4, and C (4)=2. .30 …(rightshifted) [key] .31 … & [key] Output: A list representing the permutation equivalent to the cycles. Example: Convert the cycles given by {{1,3,5},{2,4}} into a permutation: .40 ~(alphashifted) [key] .41 ~& [key] Command: C2P({{1,3,5},{2,4}}) .50 ~!(alpha leftshifted) [key] .51 ~!& [key] Result: {3,4,5,2,1} See also: P2C, CIRC .60 ~…(alpha rightshifted) [key] .61 ~…& [key] CASCFG

Once ASN has been executed, pressing a given key in User or 1User mode executes the user Type: Command assigned object. The user key assignment remains in effect until the assignment is altered by ASN, Description: Restores the default CAS mode settings. This command is almost equivalent to pressing L STOKEYS, or DELKEYS. Keys without user assignments maintain their standard definitions. !RESET , then selecting “Reset all” and pressing !!OK!, when the CAS Modes input form is displayed. If the argument obj is the name SKEY, then the specified key is restored to its standard key The difference is that CASCFG sets the modulus value to 13, whereas “Reset all” sets the assignment on the user keyboard. This is meaningful only when all standard key assignments had modulus to 3. been suppressed (for the user keyboard) by the command S DELKEYS (see DELKEYS). Access: Catalog, … To make multiple key assignments simultaneously, use STOKEYS. To delete key assignments, use DELKEYS.

318 Full Command and Function Reference Full Command and Function Reference 331

Input: Level 1/Item 1: An expression giving the name of the global variable to be added to the BINS REALASSUME list, and the assumption to be placed on it, or a list of such assumptions. Type: Command Output: Level 1/Item 1: The input expression or list of expressions. Description: Sort into Frequency Bins Command: Sorts the elements of the independent column (XCOL) of the current statistics matrix (the reserved variable ΣDAT ) into ( nbins + 2) bins, where the left edge Example: Add the CAS assumption that the global variable Z is real and positive. Note that ASSUME will of bin 1 starts at value xmin and each bin has width xwidth . replace Z>0 with Z≥0, which does not guarantee that Z is positive, so Z≥MINR is used instead, which guarantees that Z is greater than or equal to the smallest positive number the calculator BINS returns a matrix containing the frequency of occurrences in each bin, and a 2element array recognizes. containing the frequency of occurrences falling below or above the defined range of xvalues. The array can be stored into the reserved variable ΣDAT and used to plot a bar histogram of the bin Command: ASSUME(Z ≥MINR) data (for example, by executing BARPLOT). Result: Z≥MINR For each element x in ΣDAT , the nth bin count nfreq bin n is incremented, where: See also: ADDTOREAL, UNASSUME x– x n = IP min ATAN freqb in n ------xwidth Type: Analytic Function for xmin ≤ x ≤ xmax , where xmax = xmin + ( nbins )( xwidth ). Description: Arc Tangent Analytic Function: Returns the value of the angle having the given tangent. … For a real argument, the result ranges from –90 to +90 degrees (–π/2 to +π/2 radians; –100 to Access: BINS +100 grads). Input/Output: The inverse of TAN is a relation , not a function, since TAN sends more than one argument to the L3/A1 L2/A2 L1/A3 L2/I1 L1/I2 same result. The inverse relation for TAN is expressed by ISOL as the general solution : xmin xwidth nbins → [[ nbin 1 ... nbin n ]] [ nbin L nbin R ] ATAN(Z)+π*n1 L = Level; A = Argument; I = item The function ATAN is the inverse of a part of TAN, a part defined by restricting the domain of Example: If the independent column of ΣDAT contains the following data: TAN such that: 7 2 3 1 4 6 9 0 1 1 3 5 13 2 6 9 5 8 5 1 2 5 BINS returns [[ 5 ][ 3 ][ 5 ][ 2 ][ 2 ]] and [ 1 1 ] • each argument is sent to a distinct result, and The data has been sorted into 5 bins of width 2, starting at xvalue 1 and ending at xvalue 11. • each possible result is achieved. The first element of the matrix shows that 5 xvalues (2 1 1 1 2) fell in bin 1, where bin 1 ranges The points in this restricted domain of TAN are called the principal values of the inverse relation. from xvalue 1 through 2.99999999999. The vector shows that one xvalue was less than xmin (0), ATAN in its entirety is called the principal branch of the inverse relation, and the points sent by and one was greater than xmax (13). ATAN to the boundary of the restricted domain of TAN form the branch cuts of ATAN. See also: BARPLOT, XCOL The principal branch used by the calculator for ATAN was chosen because it is analytic in the regions where the arguments of the realvalued inverse function are defined. The branch cuts for BLANK the complexvalued arc tangent function occur where the corresponding realvalued function is Type: Command undefined. The principal branch also preserves most of the important symmetries. Description: Blank Graphics Object Command: Creates a blank graphics object of the specified width and The graphs below show the domain and range of ATAN. The graph of the domain shows where height. the branch cuts occur: the heavy solid line marks one side of a cut, while the feathered lines mark Access: !°LGROB BLANK ( °is the leftshift of the Nkey). the other side of a cut. The graph of the range shows where each side of each cut is mapped Input/Output: under the function. Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 These graphs show the inverse relation ATAN(Z)+π*n1 for the case n1 = 0. For other values of

n1 , the vertical band in the lower graph is translated to the right (for n1 positive) or to the left (for #n width #m height → grob blank n1 negative). Together, the bands cover the whole complex plane, the domain of TAN. See also: →GROB, LCD→

View these graphs with domain and range reversed to see how the domain of TAN is restricted to BOX make an inverse function possible. Consider the vertical band in the lower graph as the restricted Type: Command Operation domain Z = (x, y). TAN sends this domain onto the whole complex plane in the range W = (u, v) = TAN(x, y) in the upper graph. Description: Box Command: Draws in PICT a box whose opposite corners are defined by the specified pixel or userunit coordinates. Access: !°LPICT BOX ( °is the leftshift of the Nkey).

320 Full Command and Function Reference Full Command and Function Reference 329

• ptype is a command name specifying the plot type. Executing the command BAR places the command name BAR in PPAR . ATANH Type: Analytic Function • depend is a name specifying a label for the vertical axis. The default value is Y. Description: Arc Hyperbolic Tangent Analytic Function: Returns the inverse hyperbolic tangent of the A bar is drawn for each element of the column in ΣDAT . Its width is specified by res and its argument. height is the value of the element. The location of the first bar can be specified by indep ; otherwise, the value in ( xmin , ymin ) is used. For real arguments | x| > 1, ATANH returns the complex result obtained for the argument ( x, 0). For a real argument x=±1, an Infinite Result exception occurs. If flag –22 is set (no error), the Access: …BAR sign of the result (MAXR) matches that of the argument. Input/Output: None The inverse of TANH is a relation , not a function, since TANH sends more than one argument to See also: CONIC, DIFFEQ, FUNCTION, GRIDMAP, HISTOGRAM, PARAMETRIC, the same result. The inverse relation for TANH is expressed by ISOL as the general solution ; PARSURFACE, PCONTOUR, POLAR, SCATTER, SLOPEFIELD, TRUTH, WIREFRAME, ATANH(Z)+π*i*n1 YSLICE

The function ATANH is the inverse of a part of TANH, a part defined by restricting the domain BARPLOT of TANH such that: Type: Command • each argument is sent to a distinct result, and Description: Draw Bar Plot Command: Plots a bar chart of the specified column of the current statistics matrix • each possible result is achieved. (reserved variable ΣDAT ). The points in this restricted domain of TANH are called the principal values of the inverse relation. The data column to be plotted is specified by XCOL and is stored as the first parameter in ATANH in its entirety is called the principal branch of the inverse relation, and the points sent by reserved variable ΣPAR . The default column is 1. Data can be positive or negative, resulting in ATANH to the boundary of the restricted domain of TANH form the branch cuts of ATANH. bars above or below the axis. The yaxis is autoscaled, and the plot type is set to BAR. The principal branch used by the calculator for ATANH was chosen because it is analytic in the When BARPLOT is executed from a program, the resulting plot does not persist unless regions where the arguments of the realvalued function are defined. The branch cut for the PICTURE, PVIEW (with an empty list argument), or FREEZE is subsequently executed. complexvalued ATANH function occurs where the corresponding realvalued function is undefined. The principal branch also preserves most of the important symmetries. Access: …BARPLOT The graph for ATANH can be found from the graph for ATAN (see ATAN) and the relationship Input: None atanh z = –i atan iz . Output: A bar chart based on ΣDAT . See also: FREEZE, HISTPLOT, PICTURE, PVIEW, SCATRPLOT, XCOL

Access: …ÑHYPERBOLIC ATAN (Ñ is the rightshift of the 8key). Flags: Principal Solution (–1), Numerical Results (–3), Infinite Result Exception (–22) BASIS Input/Output: Type: Command Level 1/Argument 1 Level 1/Item 1 Description: Determines the basis of a subspace of the nspace Rn.

z → atanh z Access: Matrices, !Ø LVECTOR 'symb ' → 'ATANH(symb)' Input: A list of vectors defining a vector subspace of Rn. See also: ACOSH, ASINH, ISOL, TANH Output: A list containing the vectors of a basis of the vector subspace.

ATICK Flags: Exact mode must be set (flag –105 clear). Type: Command Numeric mode must not be set (flag –3 clear). Description: Axes TickMark Command: Sets the axes tickmark annotation in the reserved variable PPAR . Example: Find the vectors that form a basis of the subspace defined by [1,2,3], [1,1,1], and [2,3,4] Given x, ATICK sets the tickmark annotation to x units on both the x and the yaxis. For Command: BASIS({[1,2,3],[1,1,1],[2,3,4]}) example, 2 would place tickmarks every 2 units on both axes. Result: {[1,0,1],[0,1,2]} Given #n , ATICK sets the tickmark annotation to #n pixels on both the x and the yaxis. For See also: IBASIS example, #5 would place tickmarks every 5 pixels on both axes. BAUD Given { x y }, ATICK sets the tickmark unit annotation for each axis individually. For example, Type: Command { 10 3 } would mark the xaxis at every multiple of 10 units, and the yaxis at every multiple of 3 units. Description: Baud Rate Command: Specifies bittransfer rate. Given { #n #m } ATICK sets the tickmark pixel annotation for each axis individually. For Legal baud rates are 2400, 4800, 9600, 14400, 19200, 38400, 57600 and 115200 (default). example, {#6 #2 } would mark the xaxis every 6 pixels, and the yaxis every 2 pixels. Access: …BAUD Access: …ATICK

322 Full Command and Function Reference Full Command and Function Reference 327

1 2 3 The argument for AXES (a complex number or list) is stored as the fifth parameter in the 4 5 6 reserved variable PPAR . How the argument is used depends on the type of object it is: Result: • If the argument is a complex number, it replaces the current entry in PPAR . AUTO • If the argument is a list containing any or all of the above variables, only variables that are Type: Command specified are affected. Description: Autoscale Command: Calculates a yaxis display range, or an x and yaxis display range. atick has the same format as the argument for the ATICK command. This is the variable that is The action of AUTO depends on the plot type as follows: affected by the ATICK command. Plot Type Scaling Action The default value for AXES is (0,0). Axes labels are not displayed in PICT until subsequent execution of LABEL. FUNCTION Samples the equation in EQ at 40 values of the independent variable, equally spaced through the xaxis plotting range, discards Access: …AXES points that return ± ∞, then sets the yaxis display range to include Input/Output: the maximum, minimum, and origin. Level 1/Argument 1 Level 1/Item 1 CONIC Sets the yaxis scale equal to the xaxis scale. (x, y ) →

{ (x, y) atick “xaxis label” “yaxis label” } → POLAR Samples the equation in EQ at 40 values of the independent variable, equally spaced through the plotting range, discards points that return ± ∞, then sets both the x and yaxis display Example: The command sequence ranges in the same manner as for plot type FUNCTION. { (0,0) 2 "t" "y" } AXES LABEL specifies an axes intersection at (0,0), tickmark annotation every 2 units, and puts the labels t and y PICT. The labels are positioned to identify the horizontal and vertical axes respectively. PARAMETRIC Same as POLAR. See also: ATICK, DRAW, DRAX, LABEL

TRUTH No action. AXL

BAR Sets the xaxis display range from 0 to the number of elements in Type: Command ΣDAT , plus 1. Sets the yrange to the minimum and maximum of Description: Converts a list to an array, or an array to a list. the elements. The xaxis is always included. Access: Convert, !Ú MATRIX CONVERT , or matrices !Ø OPERATIONS HISTOGRAM Sets the xaxis display range to the minimum and maximum of Input: A list or an array. the elements in ΣDAT . Sets the yaxis display range from 0 to the Output: If the input is a list, returns the corresponding array. If the input is an array, returns the number of rows in ΣDAT . corresponding list. Example: Convert the following matrix to a list: SCATTER Sets the xaxis display range to the minimum and maximum of 0 1 the independent variable column (XCOL) in ΣDAT . Sets the y 1 0 axis display range to the minimum and maximum of the dependent variable column (YCOL). Command: AXL([[0,1][1,0]]) Result: {{0,1},{1,0}} AUTO does not affect 3D plots. AUTO actually calculates a yaxis display range and then expands that range so that the menu See also: AXM, AXQ

labels do not obscure the resultant plot. AXM AUTO does not draw a plot — execute DRAW to do so. Type: Command Access: …AUTO Description: Converts a numeric array (object type 3) to a symbolic matrix (object type 29), or a symbolic Input/Output: None matrix to a numeric array. See also: DRAW, SCALEH, SCALE, SCLΣ, SCALEW, XRNG, YRNG Access: !Ø OPERATIONS Matrices, AXES Input: A numeric array or a symbolic matrix. Type: Command Output: The corresponding symbolic matrix or numeric array. Description: Axes Command: Specifies the intersection coordinates of the x and yaxes, tickmark annotation, and the labels for the x and yaxes. This information is stored in the reserved variable PPAR .

324 Full Command and Function Reference Full Command and Function Reference 325

The constant value is a real or complex number taken from argument 2/level 1. The resulting Input/Output: array is either a new array, or an existing array with its elements replaced by the constant, L2 L1 L4 L3 L2 L1 depending on the object in argument 1/level 2.

• Creating a new array: If argument 1/level 2 contains a list of one or two integers, CON returns obj 2 obj 1 → obj 2 obj 1 obj 2 obj1 a new array. If the list contains a single integer ncolumns , CON returns a constant vector with n L = Level elements. If the list contains two integers nrows and mcolumns , CON returns a constant matrix with See also: DUP, DUPN, PICK n rows and m columns. • Replacing the elements of an existing array: If argument 1/level 2 contains an array, CON DUPDUP returns an array of the same dimensions, with each element equal to the constant. If the Type: RPL Command constant is a complex number, the original array must also be complex. Description: Duplicates an object twice. Same as DUP DUP. • If argument 1/level 2 contains a name, the name must identify a variable that contains an array. In this case, the elements of the array are replaced by the constant. If the constant is a complex Access: !°STACK LL DUPDUP ( °is the leftshift of the Nkey). number, the original array must also be complex. ISTACK LL DUPDUP Access: !´MATRIX MAKE CON ( ´ is the leftshift of the Pkey). Input/Output : !Ø CREATE CON ( Ø is the leftshift of the 5key). Level 1 Level 3 Level 2 Level 1 Input/Output: obj → obj obj obj Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 See also: DUP, NDUPN, DUPN, DUP2

{ n columns } zconstant → [ vector constant ] DUPN Type: RPL Command { n rows m columns } zconstant → [[ matrix constant ]] Description: Duplicate n Objects Command: Takes an integer n from level 1 of the stack, and returns copies of

[ Rarray ] xconstant → [ Rarray constant ] the objects on stack levels 2 through n + 1.

[ Carray ] zconstant → [ Carray constant ] Access: !°STACK LL DUPN ( °is the leftshift of the Nkey).

'name ' zconstant → ISTACK LL DUPN Example 1: { 2 2 } 6 CON returns the matrix [[ 6 6 ][ 6 6 ]] . Input/Output: Example 2: [ (2,4) (7,9) ] 3 CON returns the complex vector [ (3,0) (3,0) ] . Li+ 1 Li …L 3 L2 L1 Li+n Li+n–1 ... L 2 L1 See also: IDN

1 2 i–1 i → 1 2 i–1 i COND obj obj … obj obj n obj obj ... obj obj Type: Command L = Level See also: DUP, DUP2, PICK Description: Condition Number Command: Returns the 1norm (column norm) condition number of a square matrix. D→R The condition number of a matrix is the product of the norm of the matrix and the norm of the Type: Function inverse of the matrix. COND uses the 1norm and computes the condition number of the matrix Description: Degrees to Radians Function: Converts a real number representing an angle in degrees to its without computing the inverse of the matrix. equivalent in radians. The condition number expresses the sensitivity of the problem of solving a system of linear This function operates independently of the angle mode. equations having coefficients represented by the elements of the matrix (this includes inverting Access: !´REAL LL D →R ( ´ is the leftshift of the Pkey). the matrix). That is, it indicates how much an error in the inputs may be magnified in the outputs Flags: Numerical Results (–3) of calculations using the matrix. Input/Output: In many linear algebra computations, the base 10 logarithm of the condition number of the matrix is an estimate of the number of digits of precision that might be lost in computations using that Level 1/Argument 1 Level 1/Item 1 matrix. A reasonable rule of thumb is that the number of digits of accuracy in the result is x → (π/180)x approximately MIN(12,15–log 10 (COND)). 'symb ' → 'D→R(symb) ' Access: !´MATRIX NORMALIZE COND ( ´ is the leftshift of the Pkey). See also: R→D !Ø OPERATIONS COND ( Ø is the leftshift of the 5key). Input/Output: e Type: Function Level 1/Argument 1 Level 1/Item 1 Description: e Function: Returns the symbolic constant e or its numerical representation, 2.71828182846.

[[ matrix ]] m×n → xconditionnumber

342 Full Command and Function Reference Full Command and Function Reference 371

Input/Output: DROITE

Level 1/Argument 1 Level 1/Item 1 Type: Function Description: Returns an equation for the line through two given points in a plane. For more than two points, x → x LAGRANGE will fit a polynomial. (x, y) → (x, –y) Access: Catalog, … [ Rarray ] → [ Rarray ] Input: Level 2/Argument 1: The first point, in the form a+b *i, or ( a,b), where a and b must be numbers,

[ Carray ] 1 → [ Carray ] 2 or variables or expressions that evaluate to numbers. 'symb ' → 'CONJ(symb) ' Level 1/Argument 2: The second point, in the form c+d *i, or ( c,d), where c and d must be Example 1: [ (3,4) (7,2) ] CONJ returns [ (3,4) (7,2) ] numbers, or variables or expressions that evaluate to numbers. Example 2: A square matrix A containing complex elements is said to be Hermitian if AH = A, where AH is Output: Level 1/Item 1: An equation for the straight line through the two points. The general form is the same as a normal transpose except that the complex conjugate of each element is used. The Y=( db)/( ca)*(Xa)+ b. following program returns 1 if the input matrix is Hermitian, and a 0 if it is not. Flags: Numeric mode must not be set (flag –3 clear). « DUP TRN CONJ SAME » Complex mode must be set (flag –103 set). See also: ABS, IM, RE, SCONJ, SIGN In algebraic mode, if any of a, b, c, d are variables, they will be converted to their numeric values, even if “argument to symbolic” mode is set (flag –3 clear). In RPN mode, they will be returned as CONLIB variables. If ALG mode is set and “constants to numeric” mode is selected (flag –2 set) ̟ and e Type: Command used in inputs will be converted to their real number approximations, otherwise they will be Description: Open Constants Library Command: Opens the Constants Library catalog. returned in symbolic form. Access: GCONSTANTS LIBRARY Example 1: Find an equation for the straight line through the points (1, 2), (3, 4). Input/Output: None Command: DROITE((1, 2), (3, 4)) See also: CONST Result: Y=X1.+2.

CONST Example 2: Find a symbolic equation for the straight line through the points (π, e), ( e, π). Type: Function Command: With “constants to symbolic ” mode selected and exact mode set, type: Description: Constant Value Command: Returns the value of a constant. DROITE( π+e*i, e+ π*i) CONST returns the value of the specified constant. It chooses the unit type depending on flag 60: Result: Y=( πe)/(eπ)*(Xπ)+e SI if clear, English if set, and uses the units depending on flag 61: units if clear, no units if set. See also: LAGRANGE See “Tables of Units and Constants” in appendix B of this reference for a list of the constants available in the Constants Library. DROP Access: …CONST Type: RPL Command Flags: Units Type (60), Units Usage (61) Description: Drop Object Command: Removes the level 1 object from the stack. Input/Output: Access: !°STACK DROP ( °is the leftshift of the Nkey).

Level 1/Argument 1 Level 1/Item 1 ISTACK DROP ƒ in RPN mode executes DROP when no command line is present. 'name ' → x Input/Output: See also: CONLIB

Level 1 Level 1 CONSTANTS obj → Type: Command See also: CLEAR, DROPN, DROP2 Description: Displays a menu or list of CAS symbolic constants. DROP2 Access: Catalog, … Type: RPL Command Flags: If the CHOOSE boxes flag is clear (flag –117 clear), displays the operations as a numbered list. If Description: Drop 2 Objects Command: Removes the first two objects from the stack. the flag is set, displays the operations as a menu of function keys. Access: !°STACK LL DROP 2 ( °is the leftshift of the Nkey). Input/Output: None ISTACK LL DROP 2 See also: ALGB, ARIT, DIFF, EXP&LN, INTEGER, MAIN, MATHS, MATR, MODULAR, POLYNOMIAL, REWRITE, TESTS, TRIGO

344 Full Command and Function Reference Full Command and Function Reference 369

COS command ENDSUB. Both of these commands return an Undefined Local Name error if Type: Analytic Function executed when DOSUBS is not active. Description: Cosine Analytic Function: Returns the cosine of the argument. DOSUBS returns the Invalid User Function error if the object at level 1/argument 3 is a user For real arguments, the current angle mode determines the number’s interpretation as an angle, program that does not contain only one command and does not have a userdefined function unless the angular units are specified. structure. DOSUBS also returns the Wrong Argument Count error if the object at level 1/argument 3 is a command that does not accept 1 to 5 arguments of specific types (DUP, ROT, For complex arguments, cos( x + iy ) = cos x cosh y – i sin x sinh y. or →LIST, for example). If the argument for COS is a unit object, then the specified angular unit overrides the angle mode Access: !°LIST PROCEDURES DOSUBS ° N to determine the result. Integration and differentiation, on the other hand, always observe the ( is the leftshift of the key). angle mode. Therefore, to correctly integrate or differentiate expressions containing COS with a Input/Output: unit object, the angle mode must be set to Radians (since this is a “neutral” mode). Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1

Access: T { list } 1 n « program » → { list } 2 Flags: Numerical Results (–3), Angle Mode (–17, –18) 1 → 2 Input/Output: { list } n command { list }

Level 1/Argument 1 Level 1/Item 1 { list } 1 n name → { list } 2

cos z z → { list } 1 « program » → { list } 2

→ 'symb ' 'COS(symb) ' { list } 1 command → { list } 2

x_unit angular → cos (x_unit angular ) { list } 1 name → { list } 2 See also: ACOS, SIN, TAN Example 1: { A B C D E } « » DOSUBS returns { 'AB' 'BC' 'CD' 'DE' } COSH . Type: Analytic Function Example 2: { A B C } 2 « DUP * * » DOSUBS returns Description: Hyperbolic Cosine Analytic Function: Returns the hyperbolic cosine of the argument. { 'A*(B*B)' 'B*(C*C)' } . For complex arguments, cosh( x + iy ) = cosh x cos y + i sinh x sin y. Example 3: Entering Access: …ÑHYPERBOLIC COSH (Ñ is the rightshift of the 8key). { 1 2 3 4 5 } « → a b « CASE 'NSUB==1' THEN a END !´HYPERBOLIC COSH ( ´is the leftshift of the Pkey). 'NSUB==ENDSUB' THEN b END Flags: Numerical Results (–3) 'a+b' EVAL END » » DOSUBS Input/Output: returns { 1 5 7 5 } . Level 1/Argument 1 Level 1/Item 1 See also: DOLIST, ENDSUB, NSUB, STREAM z → cosh z DOT → 'symb ' 'COSH(symb) ' Type: Command See also: ACOSH, SINH, TANH

Description: Dot Product Command: Returns the dot product A •B of two arrays A and B, calculated as the COV sum of the products of the corresponding elements of the two arrays. Type: Command Both arrays must have the same dimensions. Description: Covariance Command: Returns the sample covariance of the independent and dependent data Some authorities define the dot product of two complex arrays as the sum of the products of the columns in the current statistics matrix (reserved variable ΣDAT ). conjugated elements of one array with their corresponding elements from the other array. The The columns are specified by the first two elements in reserved variable ΣPAR , set by XCOL and calculator uses the ordinary products without conjugation. If you prefer the alternative definition, YCOL respectively. If ΣPAR does not exist, COV creates it and sets the elements to their default apply CONJ to one array before using DOT. values (1 and 2). The covariance is calculated with the following formula: Access: !Ø LVECTOR DOT ( Ø is the leftshift of the 5key). 1 n !´VECTOR DOT ( ´ is the leftshift of the Pkey). ------∑ ()xin – xn ()xin – xn n – 1i = 1 1 1 2 2 Input/Output:

x i n1 x i Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 where in 1 is the th coordinate value in column , in 2 is the th coordinate value in the column n2, is thex mean of the data in column n1, is thex nmean of the data in column n2, and n is the n1 2 [ array A ] [ array B ] → x number of data points. [ 1 2 3 ][ 4 5 6 ] DOT 32 Access: …COV Example: returns (by calculating 1 x 4 + 2 x 5 + 3 x 6). See also: CNRM, CROSS, DET, RNRM

346 Full Command and Function Reference Full Command and Function Reference 367

Access: !Ø CREATE COLUMN CSWP ( Ø is the leftshift of the 5key). Input/Output: !´MATRIX COL CSWP ( ´ is the leftshift of the Pkey). Level 1/Argument 1 Level 1/Item 1 Input/Output: DO → Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 UNTIL →

[[ matrix ]] 1 ncolumni ncolumnj → [[ matrix ]] 2 END T/F →

[ vector ] 1 nelementi nelementj → [ vector ] 2 Example: The following program counts down from 100 to 0 and leaves the integers 100 to 0 on the stack: « 100 'A' STO A DO 'A' DECR UNTIL 'A==0' END 'A' PURGE » See also: COL+, COL–, RSWP See also: END, UNTIL, WHILE CURL DOERR Type: Function Type: Command Description: Returns the curl of a threedimensional vector function. Description: Do Error Command: Executes a “userspecified” error, causing a program to behave exactly as if Access: Calculus, !ÖDERIV . & INTEG . a normal error had occurred during program execution. DOERR causes a program to behave exactly as if a normal error has occurred during program Input: Level 2/Argument 1: A threedimensional vector function of three variables. execution. The error message depends on the argument provided to DOERR: Level 1/Argument 2: An array comprising the three variables. • nerror or # nerror display the corresponding builtin error message. Output: The curl of the vector function with respect to the specified variables. • "error " displays the contents of the string. (A subsequent execution of ERRM returns " error ". Flags: Exact mode must be set (flag –105 clear). ERRN returns # 70000h.) Numeric mode must not be set (flag –3 clear). • 0 abandons program execution with an ‘interrupted’ error message (ERRN = #13Fh). Example: Find the curl of the following vector function: • 0 DOERR is equivalent to pressing −. 2 2 2 Access: !°LLERROR DOERR ( °is the leftshift of the Nkey). v = x yi + x yj + y zk ˜ ˜ ˜ Input/Output: Command: CURL([X^2*Y, X^2*Y, Y^2*Z],[X,Y,Z]) Level 1/Argument 1 Level 1/Item 1

Result: [Z*2*Y,0,Y*2*XX^2] nerror →

See Also: DIV, HESS, VPOTENTIAL #n error →

CYCLOTOMIC “error” → Type: Function 0 → Description: Returns the cyclotomic polynomial of order n. This is the polynomial whose roots are all the nth Example: The following program takes a number from the stack and returns an error if the number is roots of 1, except those that are also roots of 1 for smaller values of n. For example, if n is 4, the greater than 10: 4th roots of 1 are {1, i, 1, i}, but 1 is the 1 st root of 1 and –1 is a 2 nd root of 1, so only i and i are « → X « CASE 'X>10' THEN "X IS TOO BIG" DOERR END END » » left, giving the polynomial ( xi)( x+i) = x2+1. See also: ERRM, ERRN, ERR0 !Þ Access: Arithmetic, POLYNOMIAL DOLIST Input: A nonnegative integer n Type: Command Output: The cyclotomic polynomial of order n. Description: Do to List Command: Applies commands, programs, or userdefined functions to lists. n Flags: Exact mode must be set (flag –105 clear). The number of lists, , can be omitted when the first or level 1 argument is any of the following: Numeric mode must not be set (flag –3 clear). • A command. • A program containing exactly one command (e.g. « DUP ») Example: Find the 20th cyclotomic polynomial. • A program conforming to the structure of a userdefined function. Command: CYCLOTOMIC(20) The final argument 1 (or level 1 object) can be a local or global name that refers to a program or Result: X^8X^6+X^4X^2+1 command. All lists must be the same length l. The program is executed l times: on the ith iteration, n objects CYLIN each taken from the ith position in each list are entered on the stack in the same order as in their Type: Command original lists, and the program is executed. The results from each execution are left on the stack. Description: Cylindrical Mode Command: Sets Cylindrical coordinate mode. After the final iteration, any new results are combined into a single list. CYLIN clears flag –15 and sets flag –16. Access: !°LIST PROCEDURES DOLIST ( °is the leftshift of the Nkey). In Cylindrical mode, vectors are displayed as polar components. Therefore, a 3D vector would appear as [ R €θ Z ].

348 Full Command and Function Reference Full Command and Function Reference 365

Flags: Date Format (–42) Flags: Exact mode must be set (flag –105 clear). Input/Output: Numeric mode must not be set (flag –3 clear). Radians mode must be set (flag –17 set). Level 1/Argument 1 Level 1/Item 1 3 x + 4 → date ------x2 – 1 Example: If the current date is May 12, 2010, if flag –42 is clear, and if the display mode is Standard, DATE Example: Find the result of , modulo 3. returns 5.12201. (The trailing zeros are dropped.) Command: DIV2MOD(X^3+4,X^21) See also: DATE+, DDAYS, TIME, TSTR Result: {X X+1}

→DATE DIVIS Type: Command Type: Command Description: Set Date Command: Sets the system date to date . Description: Returns a list of divisors of a polynomial or an integer. date has the form MM.DDYYYY or DD.MMYYYY , depending on the state of flag –42. MM is Access: Arithmetic, !Þor PARITH month, DD is day, and YYYY is year. If YYYY is not supplied, the current specification for the year is used. The range of allowable dates is January 1, 2000 to December 31, 2090. Inputs Input: A polynomial or an integer. between January 1, 1991 and December 31, 1999 are silently rejected by →DATE ; no error is Output: A list containing the expressions or integers that exactly divide into the input. reported and the system date is left unchanged. Flags: Exact mode must be set (flag –105 clear). Access: …ÓTOOLS →DATE ( Ó is the rightshift of the 9 key). Numeric mode must not be set (flag –3 clear). …&9 →DATE Example: Find the divisors of the following polynomial: Flags: Date Format (–42) 2 Input/Output : x +3x + 2 DIVIS(X^2+3*X+2) Level 1/Argument 1 Level 1/Item 1 Command: Result: {1,X+1,X+2,X^2+3*X+2} date → See also: DIV2 Example: If flag –42 is set and the current system year is 2005, then 28.07 →DATE sets the system date as July 28, 2005. DIVMOD See also: →TIME Type: Function Description: Divides two expressions modulo the current modulus. DATE+ Type: Command Access: Arithmetic, !Þ MODULO Description: Date Addition Command: Returns a past or future date, given a date in argument 1/level 2 and a Input: Level 2/Argument 1: The dividend. number of days in argument 2/level 1. If xdays is negative, DATE+ calculates a past date. The Level 1/Argument 2: The divisor. range of allowable dates is October 15, 1582, to December 31, 9999. Output: The quotient of the terms modulo the current modulus. Access: …ÓTOOLS L DATE + ( Ó is the rightshift of the 9 key). Flags: Exact mode must be set (flag –105 clear). …&9 LDATE + Numeric mode must not be set (flag –3 clear). Flags: Date Format (–42) 2 2 Input/Output: Example: Modulo 3, divide 5 x +4x+2 by x +1. Command: DIVMOD(5*X^2+4*X+2,X^2+1) Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Result: ((X^2X+1)/X^2+1))

date 1 xdays → date new DIVPC See also: DATE, DDAYS Type: Command

DBUG Description: Returns a Taylor polynomial for the quotient of two polynomial expressions. Type: Operation Access: Calculus, !Ö LIMITS & SERIES Description: Debug Operation: Starts program execution, then suspends it as if HALT were the first program Input: command. Level 3/Argument 1: The numerator expression. Level 2/Argument 2: The denominator expression. DBUG is programmable. Level 1/Argument 3: The degree of the Taylor polynomial. !°LL ° N Access: RUN DBUG ( is the leftshift of the key). Output: The Taylor polynomial at x = 0 of the quotient of the two expressions, to the specified degree.

350 Full Command and Function Reference Full Command and Function Reference 363

DEDICACE for input. The FREEZE command can be used to cause the object to persist in the display until a key is pressed. Type: Function Access: !°LOUT DISP ( °is the leftshift of the Nkey). Description: Displays a greeting from the CAS team and dedication to all HP calculator users. Input/Output: Access: Catalog, … Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Example: In algebraic mode, the message can be extended. Try: DEDICACE(Salutations) obj n → DEF Example: The program Type: Function « "ENTER Data Now" 1 DISP 7 FREEZE HALT » Description: Defines a variable or a function. Works like the DEFINE command, except that it returns a result displays ENTER Data Now at the top of the display, “freezes” the entire display, and halts. and can be included in an algebraic expression. Given an expression as input, DEF stores the See also: DISPXY, FREEZE, HALT, INPUT, PROMPT expression, unlike STORE which evaluates the expression and stores the numerical value. DISPXY Access: Catalog, … Type: Command Input: Level 1/Argument 1: An expression of the form Description: Display Command: Displays obj at the specified screen coordinates using a specified font size. name =expression or The list argument expects exactly two binary integers to specify the X and Y coordinates. The name (name 1, … name n)= expression (name 1,… name n ) level one integer argument n will display the obj using a small font if n is 1 and using the system In the first case, name is the name of a variable, and expression is an expression or a number to be font if n is 2. stored in the variable. If the variable does not exist, it is created in the current directory. In the To facilitate the display of messages, strings are displayed without the surrounding " " delimiters. second case, name is the name of a variable that will be treated as a function, name 1 to name n are All other objects are displayed in the same form as would be used if the object were in level 1 in formal variables used to define inputs the function will take. the multiline display format. If the object display requires more than one display line, the display starts at coordinate #x #y, and continues down the display either to the end of the object or the Output: Level 1/Item 1: Unlike DEFINE, which returns NOVAL in Algebraic mode, and no result in bottom of the display. NOTE: DISPXY is not useful for displaying grobs. RPN mode, DEF returns the expression used as the input. The object displayed by DISPXY persists in the display only until the keyboard is ready for input. Flags: Exact mode must be set (flag –105 clear). The FREEZE command can be used to cause the object to persist in the display until a key is Numeric mode must not be set (flag –3 clear). pressed. Example 1: Define a new function that calculates: Access: !°LOUT DISPXY ( °is the leftshift of the Nkey). (ab)/( a+b) Input/Output :

Command: DEF(NEW(A,B)=(AB)/(A+B)) Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 Result: NEW(A,B)=(AB)/(A+B) obj { list } n → Example 2: Check that the newly defined function works: See also: DISP, FREEZE, HALT, INPUT, PROMPT Command: NEW(2,1) DISTRIB Result: 1/3 Type: Command See also: DEFINE, STORE Description: Applies one step of the distributive property of multiplication and division with respect to DEFINE addition and subtraction. Used for singlestepping through a multistep distribution. Type: Command Access: !Ú REWRITE Description: Define Variable or Function Command: Stores the expression on the right side of the = in the variable specified on the left side, or creates a userdefined function. Input: An expression. If the left side of the equation is name only, DEFINE stores exp in the variable name . Output: An equivalent expression that results from applying the distributive property of multiplication over addition one time. If the left side of the equation is name followed by parenthetical arguments name 1 … name n, DEFINE creates a userdefined function and stores it in the variable name . Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). Access: !à ( àis the leftshift of the 2key). Flags: Numerical Results (–3) Example: Expand (X+1)( X 1)( X +2). Command: DISTRIB((X+1)*(X1)*(X+2)) Result: X*(X1)*(X+2)+1*(X1)*(X+2) See also: FDISTRIB

352 Full Command and Function Reference Full Command and Function Reference 361

…&9 ALRM DELALARM 1 1  DIAGMAP, <<→ X<> >>  Input/Output: 0 2  Level 1/Argument 1 Level 1/Item 1 Command: or DIAGMAP([[1,1],[0,2]],exp(X)) nindex → See also: FINDALARM, RCLALARM, STOALARM EXP()1 – EXP()1 + EXP()2 0 EXP()2 Result: DELAY Type: Command DIFF Description: Delay Command: Specifies how many seconds the calculator waits between sending lines of information to the printer. Type: Command Setting flag –34 directs printer output to the serial port. In this case, flag –33 must be clear. Description: Displays a menu or list containing the CAS commands for differential calculus, including If flag –34 is set and transmit pacing is enabled (nonzero) in reserved variable IOPAR , then commands for working with series. XON/XOFF handshaking controls data transmission and the delay setting has no effect. Access: Catalog, … xdelay specifies the delay time in seconds. The default delay is 0 seconds. The maximum delay is 6.9 seconds. (The sign of xdelay is ignored, so –4 DELAY is equivalent to 4 DELAY.) Flags: If the CHOOSE boxes flag is clear (flag –117 clear), displays the operations as a numbered list. If The delay setting is the first parameter in the reserved variable PRTPAR. the flag is set, displays the operations as a menu of function keys. A shorter delay setting can be useful when the calculator sends multiple lines of information to See also: ALGB, ARIT, CONSTANTS, EXP&LN, INTEGER, MAIN, MATHS, MATR, MODULAR, your printer (for example, when printing a program). To optimize printing efficiency, set the delay POLYNOMIAL, REWRITE, TESTS, TRIGO

just longer than the time the printhead requires to print one line of information. DIFFEQ If you set the delay shorter than the time to print one line, you may lose information. Also, as the Type: Command batteries in the printer lose their charge, the printhead slows down, and, if you have previously Description: Differential Equation Plot Type Command: Sets the plot type to DIFFEQ. decreased the delay, you may have to increase it to avoid losing information. (Battery discharge When the plot type is DIFFEQ and the reserved variable EQ does not contain a list, the initial will not cause the printhead to slow to more than the 1.8second default delay setting.) value problem is solved and plotted over an interval using the Runge–Kutta–Fehlberg (4,5) Access: …DELAY method. The plotting parameters are specified in the reserved variable PPAR , which has the Flags: I/O Device (–33), Printing Device (–34), I/O Device for Wire (–78) following form:

Input/Output: { ( xmin , ymin ) ( xmax , ymax ) indep res axes ptype depend } Level 1/Argument 1 Level 1/Item 1 For plot type DIFFEQ, the elements of PPAR are used as follows:

delay → x • (xmin, ymin) is a complex number specifying the lower left corner of PICT (the lower left See also: CR, OLDPRT, PRLCD, PRST, PRSTC, PRVAR, PR1 corner of the display range). The default value is (–6.5,–3.1) for the HP 48gII and (–6.5,–3.9) for the HP 50g and 49g+. DELKEYS Type: Command • (xmax, ymax) is a complex number specifying the upper right corner of PICT (the upper right Description: Delete Key Assignments Command: Clears userdefined key assignments. corner of the display range). The default value is (6.5,3.2) for the HP 48gII and (6.5,4.0) for the HP 50g and 49g+. The argument xkey is a real number rc.p specifying the key by its row number, its column number, and its plane (shift). For a definition of plane, see ASN. • indep is a list, { X x0 xf }, containing a name that specifies the independent variable, and two numbers that specify the initial and final values for the independent variable. The default values Specifying 0 for xkey clears all user key assignments and restores the standard key assignments. for these elements are { X 0 xmax }. Specifying S as the argument for DELKEYS suppresses all standard key assignments on the user • res is a real number specifying the maximum interval, in userunit coordinates, between values of keyboard. This makes keys without user key assignments inactive on the user keyboard. (You can the independent variable. The default value is 0. If res does not equal zero, then the maximum make exceptions using ASN, or restore them all using STOKEYS.) If you are stuck in User mode interval is res . If res equals zero, the maximum interval is unlimited. — probably with a “locked” keyboard — because you have reassigned or suppressed the keys necessary to cancel User mode, do a system halt (“warm start”): press and hold ‡ and C • axes is a list containing one or more of the following, in the order listed: a complex number simultaneously, releasing C first. This cancels User mode. specifying the userunit coordinates of the plot origin, a list specifying the tickmark annotation, and two strings specifying labels for the horizontal and vertical axes. If the solution is real Deleted user key assignments still take up from 2.5 to 62.5 bytes of memory each. You can free valued, these strings can specify the dependent or the independent variable; if the solution is this memory by packing your user key assignments by executing RCLKEYS 0 DELKEYS vector valued, the strings can specify a solution component: STOKEYS. – 0 specifies the dependent variable ( X) Access: !&H KEYS DELKEYS – 1 specifies the dependent variable ( Y) !°L MODES KEYS DELKEYS ( °is the leftshift of the Nkey). – n specifies a solution component Yn Flags: UserMode Lock (–61) and User Mode (–62) affect the status of the user keyboard.

354 Full Command and Function Reference Full Command and Function Reference 359

See also: CLEAR, DROPN (See the description of d n and Chapter 16 of the User’s Guide for an explanation of the use of “d1” for a derivative.) DERIV Result: {Y(X)=(1/5*EXP(5*X)+cC0)*(1/EXP(X)^2)} Type: Function See also: dn, LDEC

Description: Returns the partial derivatives of a function, with respect to the specified variables. DET Access: Calculus, P CALCULUS or !ÖDERIV . & INTEG . Type: Command Input: Level 2/Argument 1: A function or a list of functions. Description: Determinant Function: Returns the determinant of a square matrix. Level 1/Argument 2: A variable, or a vector of variables. The variable or variables must not exist The argument matrix must be square. DET computes the determinant of 1 × 1 and 2 × 2 as variables stored in the current directory nor directories above it. matrices directly from the defining expression for the determinant. DET computes the Output: The derivative, or a vector of the derivatives, of the function or functions. determinant of a larger matrix by computing the Crout LU decomposition of the matrix and accumulating the product of the decomposition’s diagonal elements. Flags: Exact mode must be set (flag –105 clear). Since floatingpoint division is used to do this, the computed determinant of an integer matrix is Numeric mode must not be set (flag –3 clear). often not an integer, even though the actual determinant of an integer matrix must be an integer. Example: Find the gradient of the following function of the spatial variables x, y, and z: DET corrects this by rounding the computed determinant to an integer value. This technique is 2 2 2x y +3y z + zx also used for noninteger matrices with determinants having fewer than 15 nonzero digits: the Command: DERIV(2*X^2*Y+3*Y^2*Z+Z*X, [X,Y,Z]) computed determinant is rounded at the appropriate digit position to restore some or all of the EXPAND(ANS(1)) accuracy lost to floatingpoint arithmetic. Result: [4*Y*X+Z,2*X^2+6*Z*Y,X+3*Y^2] This refining technique can cause the computed determinant to exhibit discontinuity. To avoid this, you can disable the refinement by setting flag –54. See also: DERVX, d n, ∂, POTENTIAL Access: !Ø OPERATIONS DET ( Ø is the leftshift of the 5key). DERVX !´NORMALIZE DET ( ´ is the leftshift of the Pkey). Type: Function Flags: Tiny Element (–54) Description: Returns the derivative of a function with respect to the current variable. This variable must not Input/Output: exist as a variable stored in the current directory path. Level 1/Argument 1 Level 1/Item 1

Access: Calculus, !Ö or P CALCULUS or !ÖDERIV . & INTEG . [[ matrix ]] → xdeterminant Input: The function or list of functions to be differentiated. Example: For a square matrix A, the minor of element aij is the determinant of the submatrix that remains after deleting row i and column j from the original matrix. Given a square matrix in level 3, i in Output: The derivative, or a vector of the derivatives, of the function or functions. level 2, and j in level 1, the following program, MINOR determines the minor of the submatrix: Flags: Exact mode must be set (flag –105 clear). « → M row col Numeric mode must not be set (flag –3 clear). « M row ROW DROP col COL DROP DET » See also: DERIV, d n, ∂ » For example, entering [[ 1 2 3 ][ 4 5 6 ][ 7 8 9 ]] 2 3 MINOR DESOLVE returns 6. Type: Command See also: CNRM, CROSS, DOT, RNRM

Description: Solves certain firstorder ordinary differential equations with respect to the current variable. DETACH Access: Symbolic solve, !Î or calculus, !ÖDIFFERENTIAL EQNS . Type: Command Description: Input: Level 2/Argument 1: A firstorder differential equation. Detach Library Command: Detaches the library with the specified number from the current Level 1/Argument 2: The function to solve for. directory. Each library has a unique number. If a port number is specified, it is ignored. A library object attached to a nonHOME directory is automatically detached (without using Output: The solution to the equation, either y as a function of x or x as a function of y, or x and y as DETACH) whenever a new library object is attached there. functions of a parameter. Access: …DETACH Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). Input/Output: Example: Solve the following differential equation: Level 1/Argument 1 Level 1/Item 1 3x nlibrary → y′()x + 2y() x = e Command: DESOLVE(d1Y(X)+2*Y(X)=EXP(3*X),Y(X)) :n port :n library → See also: ATTACH, LIBS, PURGE

356 Full Command and Function Reference Full Command and Function Reference 357

See the IF, CASE, IFERR, DO, and WHILE keyword entries for more information. Access: !°LL RUN & DEBUG HALT ( °is the leftshift of the Nkey). Access: !°BRANCH IF /CASE /DO /WHILE END ( °is the leftshift of the Nkey). Input/Output: None Input/Output: None See also: CONT, KILL See also: IF, CASE, DO, ELSE, IFERR, REPEAT, THEN, UNTIL, WHILE HEAD ENDSUB Type: Command Type: Command Description: First Listed Element Command: Returns the first element of a list or string. Description: Ending Sublist Command: Provides a way to access the total number of sublists contained in the Access: !°LCHARS LHEAD ( °is the leftshift of the Nkey). list used by DOSUBS. !° L ° N Returns an Undefined Local Name error if executed when DOSUBS is not active. LIST ELEMEN HEAD ( is the leftshift of the key). …± LHEAD (± is the rightshift of the Nkey). Access: !°LIST PROCEDURES ENDSUB ( °is the leftshift of the Nkey). Input/Output: None Input/Output: Example: The following program subtracts the number of elements in a list from each element in the list Level 1/Argument 1 Level 1/Item 1

« → a « a 1 « ENDSUB » » DOSUBS » { obj 1, ... ,obj n } → obj 1 See also: DOSUBS, NSUB “string” → “element 1”

ENG Example 1: "Dead" HEAD returns "D" . Type: Command Example 2: The following program takes a list of coordinates { A B C } that define a right triangle, and finds Description: Engineering Mode Command: Sets the number display format to engineering mode, which the length of the hypotenuse AC: displays one to three digits to the left of the fraction mark (decimal point) and an exponent that is « DUP HEAD SWAP REVLIST HEAD ABS » a multiple of three. The total number of significant digits displayed is n + 1. For example, entering { (0,0) (0,3) (3,4) } returns 5. Engineering mode uses n + 1 significant digits, where 0 ≤ n ≤ 11. (Values for n outside this range See also: TAIL are rounded up or down.) A number is displayed or printed as follows: HEADER→ (sign ) mantissa E (sign ) exponent Type: Command where the mantissa is of the form ( nn )n.( n…) (with up to 12 digits total) and the exponent has one Description: Header size: Returns the current size of the header in lines. to three digits. Access: …HEADER → A number with an exponent of –499 is displayed automatically in scientific mode. Input/Output: Access: ! & H FMT ENG Level 1/Argument 1 Level 1/Item 1 !°L MODES FMT ENG ( °is the leftshift of the Nkey). → Header size Input/Output: See also: →HEADER Level 1/Argument 1 Level 1/Item 1 →HEADER n → Type: Command Example: The number 103.6 in Engineering mode with five significant digits ( n=4) would appear as Description: Header size: Sets the current size of the header in lines: to 0, 1, or 2 lines. 103.60E0. This same number with one significant digit ( n=0) would appear as 100.E0. See also: FIX, SCI, STD Access: …→HEADER Input/Output: EPSX0 Level 1/Argument 1 Level 1/Item 1 Type: Function Header size → Description: Replaces all coefficients in a polynomial that have an absolute value less than that held in the See also: HEADER→ CASDIR variable EPS, with 0. The default value of EPS is 1E10, which can be changed by

storing a new number in the variable EPS in the CASDIR directory; this must be less than 1. HELP Access: Catalog, … Type: Command Input: A polynomial. Description: Similar to CASCMD, displays a list of CAS operations. Selecting one with OK displays help for it, Output: The polynomial with conforming coefficients replaced with 0. an example of the operation, and the option to copy the example to the command line. More details are given in Appendix C and Appendix H of the User’s Guide. Flags: Exact mode must be set (flag –105 clear). Access: Catalog, …, or tools IL Numeric mode must not be set (flag –3 clear). See also: CASCMD

374 Full Command and Function Reference Full Command and Function Reference 3103

ERR0 Input/Output : Type: Command Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Description: Clear Last Error Number Command: Clears the last error number so that a subsequent execution obj ncharsize → grob of ERRN returns # 0h, and clears the last error message. Example: This program: Access: !°LLERROR ERR 0 ( °is the leftshift of the Nkey). « 'Y=3*X^2' 0 →GROB PICT STO { } PVIEW » Input/Output: None returns a graphics object to the stack representing the Equation Writer application picture of See also: DOERR, ERRM, ERRN 'Y=3*X^2', then stores the graphics object in PICT and shows it in the graphics display with

ERRM scrolling activated. Type: Command See also: →LCD, LCD→

Description: Error Message Command: Returns a string containing the error message of the most recent calculator error. GROB ERRM returns the string for an error generated by DOERR. If the argument to DOERR was 0, Type: Command the string returned by ERRM is ‘Interrupted’. Description: Enters GROB on the command line to help with the manual entry of a graphic object. Access: !°LL ERROR ERRM ( °is the leftshift of the Nkey). Access: …GROB

Input/Output: GROBADD Level 1/Argument 1 Level 1/Item 1 Type: Command → “error message” Description: Combines two graphic objects by appending the second argument onto the bottom of the first. Example: The program « IFERR + THEN ERRM END » returns "Bad Argument Type" to level 1 Access: PGRAPH GROBADD if improper arguments (for example, a complex number and a binary integer) are in levels 1 and 2. !ÖGRAPH GROBADD ( Ö is the leftshift of the 4key). See also: DOERR, ERRN, ERR0 Input/Output:

ERRN Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Type: Command

Description: Error Number Command: Returns the error number of the most recent calculator error. GROB 1 GROB 2 → GROB 3

If the most recent error was generated by DOERR with a string argument, ERRN returns #70000h. If the most recent error was generated by DOERR with a binary integer argument, GXOR ERRN returns that binary integer. (If the most recent error was generated by DOERR with a real Type: Command number argument, ERRN returns the binary integer conversion of the real number.) The only Description: Graphics Exclusive OR Command: Superimposes grob 1 onto grob target or PICT , with the upper left exceptions to these rules are 0 DOERR and #0 DOERR, both of which set ERRN to #31Fh and corner pixel of grob 1 positioned at the specified coordinate in grob target or PICT . ERRM to ‘Interrupted’. GXOR is used for creating cursors, for example, to make the cursor image appear dark on a light Access: !°LL ERROR ERRN ( °is the leftshift of the Nkey). background and light on a dark background. Executing GXOR again with the same image Input/Output: restores the original picture. Level 1/Argument 1 Level 1/Item 1 GXOR uses a logical exclusive OR to determine the state of the pixels (on or off) in the → #nerror overlapping portion of the argument graphics objects.

Any portion of grob 1 that extends past grob target or PICT is truncated. Example: The program « IFERR + THEN ERRN END » returns # 202h to level 1 if improper arguments (for example, a complex number and a binary integer) are in levels 1 and 2. If the first (level 3) argument (the target graphics object) is any graphics object other than PICT , See also: DOERR, ERRM, ERR0 then grob result is returned to the stack. If the first (level 3) argument is PICT , no result is returned to

the stack. EULER Access: !°L GROB GXOR ( °is the leftshift of the Nkey). Type: Function Input/Output:

Description: For a given integer, returns the number of integers less than the integer that are coprime with the Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 integer. (Euler’s Φ function.) grob target { #n , #m } grob 1 → grob result Access: !ÞINTEGER grob target (x, y) grob 1 → grob result Input: A nonnegative integer, or an expression that evaluates to a nonnegative integer. PICT { #n , #m } grob 1 →

Output: The number of positive integers, less than, and coprime with, the integer. PICT (x, y) grob 1 → Flags: Exact mode must be set (flag –105 clear). Example: This program: Numeric mode must not be set (flag –3 clear). « ERASE PICT NEG PICT { # 0d # 0d }

376 Full Command and Function Reference Full Command and Function Reference 3101

Access: Catalog, … Input/Output: None Input: An equation. See also: DEG, RAD

Output: Level 2/Item 1: The expression to the left of the “=” sign in the original equation, or, if the input GRAMSCHMIDT is an expression and not an equation, the independent variable. Type: Command Level 1/Item 2: The expression to the right of the “=” sign in the original equation, or, if the input is an expression, the expression. Description: Finds an orthonormal base of a vector space with respect to a given scalar product. Flags: Numeric mode must not be set (flag –3 clear). Access: Matrices, !Ø LVECTOR In Algebraic mode (flag –95 set), the output expressions are evaluated (variables are replaced by Input: Level 2/Argument 1: A vector representing a basis of a vector space. numeric values) before the result is returned. Level 1/Argument 2: A function that defines a scalar product in that space. This can be given as a Example: Split the following equation into its two component expressions: sin( x)=5 x+y program, or as the name of a variable containing the definition of the function. Command: EXLR(SIN(X)=5*X+Y) Output: An orthonormal base of the vector space with respect to the given scalar product. Result: {SIN(X), 5*X+Y} Flags: Exact mode must be set (flag –105 clear). See also: FXND Numeric mode must not be set (flag –3 clear). Radians mode must be set (flag –17 set). EXP&LN Example: Find an orthonormal base for the vector space with base [1, 1+X] with respect to the scalar Type: Command product defined by : 1 Description: Displays a menu or list of the CAS exponential and logarithmic operations. PQ⋅ = P() x ⋅ Q() x xd ∫–1 Access: Catalog, … Command: GRAMSCHMIDT([1,1+X], « → P Q « PREVAL(INTVX(P*Q),1,1) » ») Flags: If the CHOOSE boxes flag is clear (flag –117 clear), displays the operations as a numbered list. If the flag is set, displays the operations as a menu of function keys. 1 X ------1 See also: ALGB, ARIT, CONSTANTS, DIFF, INTEGER, MAIN, MATHS, MATR, MODULAR, 2 --- ⋅ 6 3 POLYNOMIAL, REWRITE, TESTS, TRIGO Result:

EXP GRAPH Type: Analytic Function Type: Command Description: Exponential Analytic Function: Returns the exponential, or natural antilogarithm, of the Description: Picture Environment Command: Selects the Picture environment argument; that is, e raised to the given power. GRAPH is provided for compatibility with the HP 28 series. GRAPH is the same as PICTURE; EXP uses extended precision constants and a special algorithm to compute its result to full 12 see its listing for details.

digit precision for all arguments that do not trigger an underflow or overflow error. GREDUCE EXP provides a more accurate result for the exponential than can be obtained by using e Q. Type: Command The difference in accuracy increases as z increases. For example: Description: Reduces a polynomial with respect to a Grœbner basis. z EXP( z) ez Access: Catalog, … 3 20.0855369232 20.0855369232 Input: Level 3/Argument 1: A vector of polynomials in several variables. 10 22026.4657948 22026.4657949 Level 2/Argument 2: A vector of polynomials that is a Grœbner basis in the same variables. 100 2.68811714182E43 2.68811714191E43 Level 1/Argument 3: A vector giving the names of the variables. 500 1.40359221785E217 1.40359221809E217 Output: Level 1/Item 1: A vector containing the input polynomial reduced with respect to the Grœbner basis, up to a constant; as with GBASIS, fractions in the result are avoided. 1000 1.9707111402E434 1.9707111469E434 Flags: Exact mode must be set (flag –105 clear). For complex arguments: e(x,y ) = e xcos y + ie xsin y Numeric mode must not be set (flag –3 clear). Access: !¸ ( ¸is the leftshift of the Qkey). Radians mode must be set (flag –17 set). Flags: Numerical Results (–3) Example: Reduce the polynomial: x2y – xy – 1 with respect to the Grœbner basis (obtained in the example for GBASIS): x, 2 y3 – 1 Command: GREDUCE(X^2*Y–X*Y–1, [X,2*Y^3–1], [X,Y])

378 Full Command and Function Reference Full Command and Function Reference 399

Flags: Numerical Results (–3), Exact Mode (–105) Access: !°LIST ELEMENTS GET ( °is the leftshift of the Nkey). Input/Output: Input/Output: Level 1/Argument 1 Level 1/Item 1 Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 x → x [[ matrix ]] nposition → zget 'symb 1' → 'symb 2' [[ matrix ]] { n row , m column } → zget (x, y) → (x, y) 'name matrix ' nposition → zget Example 1: 'A^(B+C)' EXPAN returns 'A^C*A^B'

Example 2: '(X+Y)^2' EXPAN returns 'X^2+2*Y*X+Y^2' 'name matrix ' { n row , m column } → zget

See also: COLCT, EXPAND, ISOL, QUAD, SHOW [ vector ] nposition → zget

EXPAND [ vector ] {n position } → zget

Type: Command 'name vector ' nposition → zget

Description: Expands and simplifies an algebraic expression. This command is similar to the EXPAN 'name vector ' {n position } → zget command (which is included to ensure backwardcompatibility with the HP 48series calculators), { list } nposition → obj get except that EXPAND does more a more indepth analysis and often does a better job at

simplifying an expression than EXPAN. { list } {n position } → obj get

Access: Algebra, …×or PALG 'name list ' nposition → obj get

Input: An expression, or an array of expressions. 'name list ' {n position } → obj get Output: The expanded and simplified expression or array of expressions. Example 1: [[ 2 3 7 ][ 3 2 9 ][ 2 1 3 ] { 2 3 } GET returns 9. Example 2: [[ 2 3 7 ][ 3 2 9 ][ 2 1 3 ] 8 GET returns 1. Flags: Exact mode must be set (flag –105 clear). { A B C D E } { 1 } GET 'A' Numeric mode must not be set (flag –3 clear). Example 3: returns . Radians mode must be set (flag –17 set). See also: GETI, PUT, PUTI

Example: Simplify the following expression: GETI ()x2 +2x + 1 Type: Command ------x + 1 Description: Get and Increment Index Command: Returns from the argument 1/level 2 array or list (or named Command: EXPAND((X^2+2*X+1)/(X+1)) array or list) the real or complex number zget or object obj get whose position is specified in argument 2/level 1, along with the first (level 2) argument and the next position in that argument. Result: X+1 For matrices, the position is incremented in row order. See also: EXPAN Access: !°LIST ELEMENTS GETI ( °is the leftshift of the Nkey). EXPANDMOD Flags: Index Wrap Indicator (–64) Type: Function Description: Expands and simplifies an algebraic expression, or an array of expressions, modulo the current modulus.

Access: !ÞMODULO Input: An expression, or an array of expressions. Output: The expanded and simplified expression, or array of expressions, modulo the current modulus. Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). Radians mode must be set (flag –17 set). Example: Expand the following expression and give the result modulo 3: (x + 3)(x + 4) Command: EXPANDMOD((X+3)*(X+4)) Result: X^2+X

380 Full Command and Function Reference Full Command and Function Reference 397

xpoint , ypoint , and zpoint are real numbers that set the x, y, and zcoordinates as the eyepoint from GAMMA which to view a 3D plot’s view volume. The ycoordinate must always be 1 unit less than the view Type: Function volume’s nearest point ( ynear of YVOL). These coordinates are stored in the reserved variable Description: Evaluate the Γ function at the given point. For a positive integer x, Γ(x) is equal to ( x +1) ! VPAR. GAMMA differs from the FACT and ! functions because it allows complex arguments. The Γ Access: …EYEPT function is defined by +∞ –t x – 1 Input/Output: Γ()x = ∫ e ⋅ t td 0 . Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 Access: !´LSPECIAL

xpoint ypoint zpoint → Input: A real or complex number, x. See also: NUMX, NUMY, XVOL, XXRNG, YVOL, YYRNG, ZVOL Output: Γ(x). If the input x is an integer greater than 100, returns the symbolic expression GAMMA( x). Flags: If the Underflow Exception (–20) or Overflow Exception (–21) flags are set then underflow or F0λ overflow conditions give errors, otherwise they give zero or the maximum real number the Type: Function calculator can express. Description: Black Body Emissive Power Function: Returns the fraction of total blackbody emissive power at Complex mode must be set (flag –103 set) if x is complex. temperature xT between wavelengths 0 and ylambda . If units are not specified, ylambda has implied See also: FACT, PSI, Psi, ! units of meters and xT has implied units of K.

F0λ returns a dimensionless fraction. GAUSS Access: … F 0λ Type: Command Flags: Numerical Results (–3) Description: Returns the diagonal representation of a quadratic form. Input/Output: Access: Matrices, !Ø QUADRATIC FORM Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Input: Level 2/Argument 1: The quadratic form.

ylambda xT → xpower Level 1/Argument 2: A vector containing the independent variables.

ylambda 'symb ' → 'F0 λ(y lambda ,symb) ' Output: Level 4/Item 1: An array of the coefficients of the diagonal. Level 3/Item 2: A matrix, P, such that the quadratic form is represented as P TDP, where the T → T 'symb ' x 'F0 λ(symb,x )' diagonal matrix D contains the coefficients of the diagonal representation.

'symb 1' 'symb 2' → 'F0 λ(symb 1,symb 2)' Level 2/Item 3: The diagonal representation of the quadratic form. Level 1/Item 4: The vector of the variables.

Flags: Exact mode must be set (flag –105 clear). FACT Numeric mode must not be set (flag –3 clear). Type: Command Radians mode must be set (flag –17 set). Description: Factorial (Gamma) Function: FACT is the same as ! and is provided for compatibility with the HP Example: 28. See !. Find the Gaussian symbolic quadratic form of the following: x2 + 2axy Access: …FACT Command: GAUSS(X^2+2*A*X*Y,[X,Y]) Flags: Numerical Results (–3), Underflow Exception (–20), Overflow Exception (–21) Input/Output: Result: {[1,A^2], [[1,A][0,1]], (A^2*Y^2)+(A*Y+X)^2,[X,Y]} Level 1/Argument 1 Level 1/Item 1 See also: AXQ, QXA

n → n! GBASIS x → Γ(x + 1) Type: Command 'symb ' → '(symb)! ' Description: Returns a set of polynomials that are a Grœbner basis G of the ideal I generated from an input set See also: COMB, PERM, ! of polynomials F. … FACTOR Access: Catalog, Type: Command Input: Level 2/Argument 1: A vector F of polynomials in several variables. Level 1/Argument 2: A vector giving the names of the variables. Description: Factorizes a polynomial or an integer: Output: • The function expresses a polynomial as the product of irreducible polynomials. Level 1/Item 1: A vector containing the resulting set G of polynomials. The command attempts • The function expresses an integer as the product of prime numbers. to order the polynomials as given in the vector of variable names. Access: Algebra, …×or PALG or !ÞPOLY

382 Full Command and Function Reference Full Command and Function Reference 395

FANNING !° LMODES FLAG FS ? ( °is the leftshift of the Nkey). Type: Function !& H FLAG FS ? Description: Fanning Friction Factor Function: Calculates the Fanning friction factor of certain fluid flows. Input/Output: FANNING calculates the Fanning friction factor, a correction factor for the frictional effects of Level 1/Argument 1 Level 1/Item 1 fluid flows having constant temperature, crosssection, velocity, and viscosity (a typical pipe flow, nflag number → 0/1 for example). xx/D is the relative roughness (the ratio of the conduit roughness to its diameter). yRe is the Reynolds number. The function uses different computation routines for laminar flow ( Re ≤ See also: CF, FC?, FC?C, FS?C, SF

2100) and turbulent flow ( Re > 2100). xx/D and yRe must be real numbers or unit objects that FS?C reduce to dimensionless numbers, and both numbers must be greater than 0. Type: Command Access: …FANNING Description: Flag Set? Clear Command: Tests whether the system or user flag specified by nflag number is set, and Flags: Numerical Results (–3) returns a corresponding test result: 1 (true) if the flag is set or 0 (false) if the flag is clear. After Input/Output: testing, clears the flag. Access: !°TEST LLFS ?C ( °is the leftshift of the Nkey). Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 !° LMODES FLAG FS ?C ( °is the leftshift of the Nkey). xx/D yRe → xfanning !& H FLAG FS ?C xx/D 'symb ' → 'FANNING(x x/D ,symb) ' Input/Output:

'symb ' yRe → 'FANNING(symb,y Re )' Level 1/Argument 1 Level 1/Item 1

1 2 → 1 2 'symb ' 'symb ' 'FANNING(symb ,symb )' nflag number → 0/1

See also: DARCY 44 FS?C 1 Example: If flag –44 is set, returns to level 1 and clears flag –44. FAST3D See also: CF, FC?, FC?C, FS?, SF Type: Command FUNCTION Description: Fast 3D Plot Type Command: Sets the plot type to FAST 3D. Type: Command When plot type is set to FAST3D, the DRAW command plots an image graph of a 3vector Description: Function Plot Type Command: Sets the plot type to FUNCTION. valued function of two variables. FAST3D requires values in the reserved variables EQ , VPAR , When the plot type is FUNCTION, the DRAW command plots the current equation as a real and PPAR . valued function of one real variable. The current equation is specified in the reserved variable EQ . VPAR is made up of the following elements: The plotting parameters are specified in the reserved variable PPAR , which has the form:

{ xleft ,xright , ynear , yfar ,zlow ,zhigh ,xmin ,xmax , ymin , ymax ,xeye , yeye ,zeye ,xstep , ystep } { ( xmin , ymin ) ( xmax , ymax ) indep res axes ptype depend } For plot type FAST3D, the elements of VPAR are used as follows: For plot type FUNCTION, the elements of PPAR are used as follows: • (xmin , ymin ) is a complex number specifying the lower left corner of PICT (the lower left corner • xleft and xright are real numbers that specify the width of the view space. of the display range). The default value is (–6.5,–3.1) for the HP 48gII and (–6.5,–3.9) for the • ynear and yfar are real numbers that specify the depth of the view space. HP 50g and 49g+. • zlow and zhigh are real numbers that specify the height of the view space. • (xmax , ymax ) is a complex number specifying the upper right corner of PICT (the upper right • xmin and xmax are not used. corner of the display range). The default value is (6.5,3.2) for the HP 48gII and (6.5,4.0) for the • ymin and ymax are not used. HP 50g and 49g+. • xeye , yeye , and z eye are are not used. • xstep and ystep are real numbers that set the number of xcoordinates versus the number of y • indep is a name specifying the independent variable, or a list containing such a name and two coordinates plotted. numbers specifying the minimum and maximum values for the independent variable (the The plotting parameters are specified in the reserved variable PPAR , which has this form: plotting range). The default value of indep is X. • res is a real number specifying the interval (in userunit coordinates) between plotted values of { ( xmin , ymin ),(xmax , ymax ),indep ,res ,axes ,ptype ,depend } the independent variable, or a binary integer specifying the interval in pixels. The default value is For plot type FAST3D, the elements of PPAR are used as follows: 0, which specifies an interval of 1 pixel. • (xmin , ymin ) is not used. • axes is a list containing one or more of the following, in the order listed: a complex number • (xmax , ymax ) is not used. specifying the userunit coordinates of the plot origin, a list specifying the tickmark annotation, • indep is a name specifying the independent variable. The default value of indep is X. and two strings specifying labels for the horizontal and vertical axes. The default value is (0,0). • res is not used. • ptype is a command name specifying the plot type. Executing the command FUNCTION places • axes is not used. the name FUNCTION in PPAR . • ptype is a command name specifying the plot type. Executing the command FAST3D places the • depend is a name specifying a label for the vertical axis. The default value is Y. name FAST3D in ptype . The current equation is plotted as a function of the variable specified in indep . The minimum and • depend is a name specifying the dependent variable. The default value is Y. maximum values of the independent variable (the plotting range) can be specified in indep ;

384 Full Command and Function Reference Full Command and Function Reference 393

Input/Output: FOURIER Level 1/Argument 1 Level 1/Item 1 Type: Function

nflag number → 0/1 Description: Returns the nth coefficient of a complex Fourier series expansion. The PERIOD variable must be in Example: If flag –44 is set, 44 FC?C returns 0 to level 1 and clears flag –44. the CAS directory, CASDIR, or in current path, and set to hold L, the period of the input See also: CF, FC?, FS? FS?C, SF function. The expression is expanded in terms of the current CAS variable. !Ö FDISTRIB Access: Calculus DERIV . & INTEG . Type: Command Input: Level 1/Argument 2: An expression in terms of the current variable Level 2/Argument 1: The number, n, of the coefficient to return. Description: Performs a full distribution of multiplication and division with respect to addition and subtraction in a single step. Output: The nth Fourier coefficient of the expression. Flags: Exact mode must be set (flag –105 clear). Access: !Ú REWRITE Numeric mode must not be set (flag –3 clear). Input: An expression. Radians mode must be set (flag –17 set). Output: An equivalent expression that results from fully applying the distributive property of Complex mode must be set, that is, flag –103 must be set. multiplication and division over addition and subtraction. Example: Obtain the Fourier coefficient as below, with the default value of 2π in the PERIOD variable in Flags: Exact mode must be set (flag –105 clear). CASDIR, and simplify it with EXPAND : Numeric mode must not be set (flag –3 clear). Command: FOURIER(X^2,0) EXPAND(ANS(1)) Example: Expand (X+1)(X1)(X+2) : Result: 4/3* π ^2 Command: FDISTRIB((X+1)*(X1)*(X+2)) Result: X*(X*X)+2*(X*X)+((X*(1*X))+(2*(1*X)))+ (X*(X*1)+2*(X*1)+ FP ((X*(1*1))+(2*(1*1)))) Type: Function Description: Fractional Part Function: Returns the fractional part of the argument. See also: DISTRIB The result has the same sign as the argument.

FFT Access: !´REAL LFP ( ´ is the leftshift of the Pkey). Type: Command Flags: Numerical Results (–3) Description: Discrete Fourier Transform Command: Computes the one or twodimensional discrete Fourier Input/Output: transform of an array. Level 1/Argument 1 Level 1/Item 1 If the argument is an Nvector or an N × 1 or 1 × N matrix, FFT computes the onedimensional x → y transform. If the argument is an M × N matrix, FFT computes the twodimensional transform. M x_unit → y_unit and N must be integral powers of 2. → The onedimensional discrete Fourier transform of an Nvector X is the Nvector Y where: 'symb ' 'FP(symb) ' Example 1: 32.3 FP returns .3 . 2πikn – 1 –------ Example 2: 32.3_m FP returns .3_m . Yk = ∑ Xne , i = –1 n = 0 See also: IP

for k = 0, 1, …, N – 1. FREE Type: Command The two dimensional discrete Fourier transform of an M × N matrix X is the M × N matrix Y Description: Do not use this command, a carryover from the HP 48SX for handling plugin RAM cards. where: Access: … FREE 2πikm 2πi ln M – 1 – 1 –------–------M Ykl = ∑ ∑ xmne e , i = –1 FREEZE m = 0 n = 0 Type: Command for k = 0, 1, …, M – 1 and l = 0, 1, …, N – 1. Description: Freeze Display Command: Freezes the part of the display specified by ndisplay area , so that it is not The discrete Fourier transform and its inverse are defined for any positive sequence length. updated until a key is pressed. However, the calculation can be performed very rapidly when the sequence length is a power of Normally, the stack display is updated as soon as the calculator is ready for data input. For two, and the resulting algorithms are called the fast Fourier transform (FFT) and inverse fast example, when HALT stops a running program, or when a program ends, any displayed messages Fourier transform (IFFT). are cleared. The FREEZE command “freezes” a part or all of the display so that it is not updated until a key is pressed. This allows, for example, a prompting message to persist after a program The FFT command uses truncated 15digit arithmetic and intermediate storage, then rounds the halts to await data input. result to 12digit precision. ndisplay area is the sum of the value codes for the areas to be frozen:

386 Full Command and Function Reference Full Command and Function Reference 391

Fix mode shows n digits to the right of the fraction mark (decimal point), where 0 ≤ n ≤ 11. Access: … FONT 6 (Values for n outside this range are rounded to the nearest integer.) A number is displayed or Input/Output: printed as ( sign ) mantissa, where the mantissa can be of any form. However, the calculator automatically displays a number in scientific mode if either of the following is true: Level 1/Argument 1 Level 1/Item 1 • The number of digits to be displayed exceeds 12. → Font object • A nonzero value rounded to n decimal places otherwise would be displayed as zero. See also: FONT7, FONT8, →FONT, FONT →

Access: ! & HFMT FIX FONT7 !°LMODES FMT FIX ( °is the leftshift of the Nkey). Type: Function Input/Output: Description: Font Function: Returns the system FONT7 object. You use this in conjunction with the →FONT command to set the system font to type 7. Level 1/Argument 1 Level 1/Item 1 Access: …FONT 7 n → Example: The number 103.6 in Fix mode to four decimal places would appear as 103.6000. Input/Output: See also: SCI, STD Level 1/Argument 1 Level 1/Item 1 → Font object FLASHEVAL Type: Command See also: FONT6, FONT8, →FONT, FONT →

Description: Evaluate Flash Function Command: Evaluates unnamed Flash functions. FONT8 Type: Function WARNING: Use extreme care when executing this function. Using FLASHEVAL with random addresses will almost always cause a memory loss. Description: Font Function: Returns the system FONT8 object. You use this in conjunction with the Do not use this function unless you know what you are doing. →FONT command to set the system font to type 8. Access: … FONT 8 #n function is of the form ffffbbbh , where bbb is the bank ID, and ffff is the function number. Input/Output: Access: …FLASHEVAL Level 1/Argument 1 Level 1/Item 1 Input/Output: → Font object Level 1/Argument 1 Level 1/Item 1 See also: FONT6, FONT7, →FONT, FONT → #n function → See also: EVAL, LIBEVAL, SYSEVAL FONT →

Type: Function FLOOR Description: Returns the current system font. Type: Function Access: … FONT → Description: Floor Function: Returns the greatest integer that is less than or equal to the argument. Input/Output: Access: !´REAL LL FLOOR ( ´ is the leftshift of the Pkey). Level 1/Argument 1 Level 1/Item 1 Flags: Numerical Results (–3) → Font object Input/Output: See also: FONT6, FONT7, FONT8, →FONT

Level 1/Argument 1 Level 1/Item 1 x → n →FONT Type: Function x_unit → n_unit Description: Set font Function: Sets the system font. You use this in conjunction with one of the three font 'symb ' → 'FLOOR(symb) ' commands to set the system font. Valid input is any font object (TYPE 30) of size 6, 7, or 8. 3.2 FLOOR Example 1: returns 3. Access: … →FONT 3.2 FLOOR Example 2: returns –4. Input/Output: See also: CEIL, IP, RND, TRNC Level 1/Argument 1 Level 1/Item 1

FONT6 Font object → Type: Function See also: FONT6, FONT7, FONT8, FONT → Description: Font Function: Returns the system FONT6 object. You use this in conjunction with the →FONT command to set the system font to type 6.

388 Full Command and Function Reference Full Command and Function Reference 389

• depend is a name specifying a label for the vertical axis. The default value is Y. For x = 0 or (0, 0), an Infinite Result exception occurs, or, if flag –22 is set, –MAXR is returned. The frequency of the data is plotted as bars, where each bar represents a collection of data points. The inverse of EXP is a relation , not a function, since EXP sends more than one argument to the The base of each bar spans the values of the data points, and the height indicates the number of same result. The inverse relation for EXP is the general solution : data points. The width of each bar is specified by res . The overall maximum and minimum values LN(Z)+2*π*i*n1 for the data can be specified by indep ; otherwise, the values in ( xmin , ymin ) and ( xmax , ymax ) are used. The function LN is the inverse of a part of EXP, a part defined by restricting the domain of EXP Access: … HISTOGRAM such that: each argument is sent to a distinct result, and each possible result is achieved. The points in this restricted domain of EXP are called the principal values of the inverse relation. Input/Output: None LN in its entirety is called the principal branch of the inverse relation, and the points sent by LN to See also: BAR, CONIC, DIFFEQ, FUNCTION, GRIDMAP, PARAMETRIC, PARSURFACE, the boundary of the restricted domain of EXP form the branch cuts of LN. PCONTOUR, POLAR, SCATTER, SLOPEFIELD, TRUTH, WIREFRAME, YSLICE The principal branch used by the calculator for LN was chosen because it is analytic in the regions realvalued HISTPLOT where the arguments of the inverse function are defined. The branch cut for the complexvalued natural log function occurs where the corresponding realvalued function is Type: Command undefined. The principal branch also preserves most of the important symmetries. Description: Draw Histogram Plot Command: Plots a frequency histogram of the specified column in the The graphs below show the domain and range of LN. The graph of the domain shows where the current statistics matrix (reserved variable ΣDAT ). branch cut occurs: the heavy solid line marks one side of the cut, while the feathered lines mark The data column to be plotted is specified by XCOL and is stored as the first parameter in the the other side of the cut. The graph of the range shows where each side of the cut is mapped reserved variable ΣPAR . If no data column is specified, column 1 is selected by default. The yaxis under the function. is autoscaled and the plot type is set to HISTOGRAM. These graphs show the inverse relation LN(Z)+2*π*i*n1 for the case n1 =0. For other values of HISTPLOT plots relative frequencies, using 13 bins as the default number of partitions. The RES n1 , the horizontal band in the lower graph is translated up (for n1 positive) or down (for n1 command lets you specify a different number of bins by specifying the bin width. To plot a negative). Taken together, the bands cover the whole complex plane, which is the domain of frequency histogram with numerical frequencies, store the frequencies in ΣDAT and execute BINS EXP. and then BARPLOT. When HISTPLOT is executed from a program, the graphics display, which shows the resultant plot, does not persist unless PICTURE, PVIEW (with an empty list argument), or FREEZE is subsequently executed. Access: … HISTPLOT Input/Output: None See also: BARPLOT, BINS, FREEZE, PICTURE, PVIEW, RES, SCATRPLOT, XCOL

HMS– Type: Command Description: HoursMinutesSeconds Minus Command: Returns the difference of two real numbers, where the arguments and the result are interpreted in hoursminutesseconds format. The format for HMS (a time or an angle) is H.MMSSs , where: • H is zero or more digits representing the integer part of the number (hours or degrees). • MM are two digits representing the number of minutes. • SS are two digits representing the number of seconds. • s is zero or more digits (as many as allowed by the current display mode) representing the decimal fractional part of seconds. Access: …ÓTools LHMS – ( Ó is the rightshift of the 9 key). …& 9LHMS – Input/Output: Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1

HMS 1 HMS 2 → HMS 1 – HMS 2

See also: HMS→, →HMS, HMS+ You can view these graphs with domain and range reversed to see how the domain of EXP is restricted to make an inverse function possible. Consider the vertical band in the lower graph as the HMS+ restricted domain Z = ( x,y). EXP sends this domain onto the whole complex plane in the range Type: Command W = ( u,v) = EXP( x,y) in the upper graph. Description: HoursMinutesSeconds Plus Command: Returns the sum of two real numbers, where the Access: …¹ (¹is the rightshift of the Qkey). arguments and the result are interpreted in hoursminutesseconds format. Flags: Principal Solution (–1), Numerical Results (–3), Infinite Result Exception (–22)

3106 Full Command and Function Reference Full Command and Function Reference 3135

HOME Input/Output: None Type: Command See also: BESTFIT, EXPFIT, LOGFIT, LR, PWRFIT Description: HOME Directory Command: Makes the HOME directory the current directory. LININ Access: … HOME Type: Function !& J Description: Linear Test Function: Tests whether an algebraic is structurally linear for a given variable. Input/Output: None If any two subexpressions containing a variable ( name ) are combined only with addition and subtraction, and any subexpression containing the variable is at most multiplied or divided by See also: CRDIR, PATH, PGDIR, UPDIR

another factor not containing the variable, the algebraic ( symb ) is determined to be linear for that HORNER variable. LININ returns a 1 if the algebraic is linear for the variable, and a 0 if not. Access: !°TEST !«LININ ( °is the leftshift of the Nkey). Type: Command Input/Output: Description: Executes a Horner scheme on a polynomial. That is, for a given polynomial P , and a number r, HORNER returns QUOT( P/( x–r)), r and also P(r) Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Access: Arithmetic, !ÞPOLY L 'symb ' 'name ' → 0/1 '(X+1)*(Y^2^Z)+(X/(3Z^3)' 'X' LININ 1 Input: Level 2/Argument 1: A polynomial, P. Example 1: returns . Level 1/Argument 2: A number, r. Example 2: '(X^21)/(X+1)' 'X' LININ returns 0. (Although this equation yields a linear equation when factored, LININ tests the equation as Output: Level 3/Item 1: QUOT( P/( x–r)) described above.)

Level 2/Item 2: r Level 1/Item 3: P(r), the remainder of the division process. LINSOLVE Flags: Exact mode must be set (flag –105 clear). Type: Command Numeric mode must not be set (flag –3 clear). Description: Solves a system of linear equations. Radians mode must be set (flag –17 set). !Î P !Ø Example: For r = 3, find the result of executing a Horner scheme on the following polynomial: Access: Symbolic solve, , SOLVE , LIN S 2 Input: Level 2/Argument 1: An array of equations. x +x + 1 Level1/Argument 2: A vector of the variables to solve for. Command: HORNER(X^2+X+1,3) Results: (X+4,3,13) Output: Level 3/Item 1: The system of equations, as a list containing the inputs as above. Level 2/Item 2: A list of the pivot points. i Level 1/Item 3: The solution. Type: Function Flags: Exact mode must be set (flag –105 clear). Description: i i Function: Returns the symbolic constant or its numerical representation, (0, 1). Numeric mode must not be set (flag –3 clear). Access: !¥ (¥is the leftshift of the Ikey). See also: DESOLVE, SOLVE, MSLV Flags: Symbolic Constants (–2), Numerical Results (–3) Input/Output: LIST→ Type: Command Level 1/Argument 1 Level 1/Item 1 Description: List to Stack Command: Takes a list of n objects and returns each object to a separate level, and → 'i' returns the total number of objects to item n+1 (stack level 1). → (0,1) The command OBJ→ also provides this function. See also: e, MAXR, MINR, π Access: … LIST → Input/Output:

IABCUV Level 1/Argument 1 Level n+1 /Item 1 ... Level 2/Item n Level 1/Item n+1 Type: Command { obj 1, ...,obj n } → obj 1 ... obj n n Description: Returns a solution in integers u and v of au + bv = c, where a, b, and c are integers. See also: ARRY→, DTAG, EQ→, →LIST, OBJ→, STR→ !Þ Access: Arithmetic, INTEGER →LIST Input: Level 3/Argument 1: the value of a. Type: Command Level 2/Argument 2: the value of b. Description: Stack to List Command: Takes n specified objects and returns a list of those objects. Level 1/Argument 3: the value of c. Access: !°TYPE →LIST ( °is the leftshift of the Nkey). !°LIST →LIST ( °is the leftshift of the Nkey).

3108 Full Command and Function Reference Full Command and Function Reference 3133

Flags: Exact mode must be set (flag –105 clear). Access: … LIBS Numeric mode must not be set (flag –3 clear). Input/Output: Radians mode must be set (flag –17 set). Level 1/Argument 1 Level 1/Item 1

Example: Use integration by parts to calculate the following: → {“title”, n lib , n port , ...,“title”, n lib , n port } xcos ( x) xd ∫ See also: ATTACH, DETACH

Command 1: Apply the IBP command in RPN mode: lim Level 2: X*COS(X) Type: Function Level 1: SIN(X) Result: Level 2: SIN(X)*X Description: Returns the limit of a function as its argument approaches a specified value. Expands and Level 1: SIN(X) simplifies an algebraic expression. Command 2: Apply the INTVX command to level 1, SIN(X) Access: Calculus, !Ö LIMITS &SERIES Result: Level 2: SIN(X)*X Input: Level 2/Argument 1: An expression. COS(X) Level 1: Level 1/Argument 2: An expression of the form x = y, where x is the variable and y is the value at Command 3: Press + to add the result to the value at level 2 to obtain the final result. which the limit is to be evaluated. If the variable approaching a value is the current CAS variable, Result: SIN(X)*(X)+COS(X) it is sufficient to give its value alone. The ∞ symbol provided by the calculator can be used to set the limiting value at plus or minus infinity. See also: INTVX, INT, PREVAL, RISCH Output: The limit of the expression at the limit point. ICHINREM Flags: Exact mode must be set (flag –105 clear). Type: Command Numeric mode must not be set (flag –3 clear). Description: Solves a system of two congruences in integers using the Chinese Remainder theorem. Radians mode must be set (flag –17 set). Access: Arithmetic, !ÞINTEGER Example: Find the following limit: n n lim x – y Input: Level 2/Argument 1: A vector of the first value and the modulus.   ------  x– y Level 1/Argument 2: A vector of the second value and the modulus. x→ y Output: A vector of the solution. Command: lim ((X^NY^N)/(XY), X=Y) Result: N*EXP(N*LN(Y))/Y Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). See also: SERIES

Radians mode must be set (flag –17 set). LIMIT Example: Solve the following system of congruences: Type: Function x ≡ 2 Modulo 3 x ≡ 1 Modulo 5 Description: Returns the limit of a function as its argument approaches a specified value. This function is identical to the lim function, described above, and is included to ensure backwardcompatibility Command: ICHINREM([2,3],[1,5]) with the HP 49G calculator. Results: [4, 15] Access: Catalog, … See also: CHINREM LIN IDN Type: Command Type: Command Description: Identity Matrix Command: Returns an identity matrix; that is, a square matrix with its diagonal Description: Linearizes expressions involving exponential terms. elements equal to 1 and its offdiagonal elements equal to 0. Access: …× or Exponential and logarithm, !Ð or PALG , or !Ú REWRITE , or The result is either a new square matrix, or an existing square matrix with its elements replaced by PLEXPLN . the elements of the identity matrix, according to the argument. Input: • Creating a new matrix: If the argument is a real number n, a new real identity matrix is returned, An expression. with its number of rows and number of columns equal to n. Output: The linearized expression. • Replacing the elements of an existing matrix: If the argument is a square matrix, an identity Flags: Exact mode must be set (flag –105 clear). matrix of the same dimensions is returned. If the original matrix is complex, the resulting Numeric mode must not be set (flag –3 clear). identity matrix will also be complex, with diagonal values (1,0). Radians mode must be set (flag –17 set).

3110 Full Command and Function Reference Full Command and Function Reference 3131

See also: ABCUV, EGCD, IABCUV Output: The least common multiple of the objects.

IF Flags: Exact mode must be set (flag –105 clear). Type: Command Operation Numeric mode must not be set (flag –3 clear). Description: IF Conditional Structure Command: Starts IF … THEN … END and IF … THEN … ELSE … Radians mode must be set (flag –17 set). END conditional structures. Example: Find the least common multiple of the following two expressions: 2 Conditional structures , used in combination with program tests, enable a program to make decisions. x – 1 • IF … THEN … END executes a sequence of commands only if a test returns a nonzero (true) x–1 result. The syntax is: Command: LCM(X^21,X1) IF testclause THEN trueclause END Results: X^21 IF begins the test clause, which must return a test result to the stack. THEN removes the test See also: GCD result from the stack. If the value is nonzero, the true clause is executed. Otherwise, program execution resumes following END. LCXM • IF … THEN … ELSE … END executes one sequence of commands if a test returns a true Type: Command (nonzero) result, or another sequence of commands if that test returns a false (zero) result. The Description: From a program with two arguments, builds a matrix with the specified number of rows and syntax is: columns, with aij = f(i,j). IF testclause THEN trueclause ELSE falseclause END … IF begins the test clause, which must return a test result to the stack. THEN removes the test Access: Catalog, result from the stack. If the value is nonzero, the true clause is executed. Otherwise, the false Input: Level 3/Argument 1: The number of rows you want in the resulting matrix. clause is executed. After the appropriate clause is executed, execution resumes following END. Level 2/Argument 2: The number of columns you want in the resulting matrix. In RPL mode, the test clause can be a command sequence (for example, A B ‰) or an algebraic Level 1/Argument 3: A program that uses two arguments. An expression with the two variables I, (for example, 'A‰B'). If the test clause is an algebraic, it is automatically evaluated to a number J can be used instead. (→NUM or EVAL isn’t necessary). Output: The resulting matrix. Access: !°BRANCH IF ( °is the leftshift of the Nkey). Flags: Exact mode must be set (flag –105 clear). Input/Output: Numeric mode must not be set (flag –3 clear).

Level 1/Argument 1 Level 1/Item 1 Example: Build a 2 × 3 matrix with a ij =i+2j. Command: LCXM(2,3,« →I J 'I+2*J'») IF → 3 5 7 → THEN T/F 4 6 8 Result: END IF LDEC THEN T/F → Type: Command ELSE → Description: Solves a linear differential equation with constant coefficients, or a system of first order linear differential equations with constant coefficients. END → Access: !Î PSOLVER !ÖDIFF See also: CASE, ELSE, END, IFERR, THEN Symbolic solve, or or Input: Level 2/Argument 1: For a single equation, the function forming the right hand side of the IFERR equation. For a system of equations, an array comprising the terms not containing the dependent Type: Command variables. Description: If Error Conditional Structure Command: Starts IFERR … THEN … END and IFERR … Level 1/Argument 2: For one equation, the auxiliary polynomial. For a system of equations, the THEN … ELSE … END error trapping structures. matrix of coefficients of the dependent variables. Error trapping structures enable program execution to continue after a “trapped” error occurs. Output: The solution. • IFERR … THEN … END executes a sequence of commands if an error occurs. The syntax of Flags: Exact mode must be set (flag –105 clear). IFERR … THEN … END is: Numeric mode must not be set (flag –3 clear). IFERR trapclause THEN errorclause END Radians mode must be set (flag –17 set). If an error occurs during execution of the trap clause: Example: Solve 2sin( x), with the auxiliary polynomial x2+1: 1 The error is ignored. Command: LDEC(2*SIN(X),X^2+1) 2 The remainder of the trap clause is discarded.

3112 Full Command and Function Reference Full Command and Function Reference 3129

Access: !´LFFT IFFT ( ´ is the leftshift of the Pkey). LAP Input/Output: Type: Function

Level 1/Argument 1 Level 1/Item 1 Description: Performs a Laplace transform on an expression with respect to the current default variable. Access: Calculus, !Ö DIFFERENTIAL EQNS [ array ] 1 → [ array ] 2 See also: FFT Input: An expression. Output: The Laplace transform of the expression. IFT Type: Command Flags: Exact mode must be set (flag –105 clear). Description: IFTHEN Command: Executes obj if T/F is nonzero. Discards obj if T/F is zero. Numeric mode must not be set (flag –3 clear). Radians mode must be set (flag –17 set). IFT lets you execute in stack syntax the decisionmaking process of the IF … THEN … END conditional structure. The “true clause” is obj in argument 2 (level 1). Example: Find the Laplace transform of e x. LAP(EXP(X)) Access: !°BRANCH IFT ( °is the leftshift of the Nkey). Command: Input/Output: Result: 1/(X1) See also: ILAP, LAPL Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 LAPL T/F obj → It depends! Type: Command Example: « X 0 > "Positive" IFT » puts "Positive" in level 1 if X contains a positive real number. Description: Returns the Laplacian of a function with respect to a list of variables. See also: IFTE Access: !Ö DERIV & INTEG L

IFTE Input: Level 2/Argument 1:An expression. Type: Function Level 1/Argument 2: A vector of variables. Description: IFTHENELSE Function: Executes the obj in argument 2 or level 2 if T/F is nonzero. Executes Output: The Laplacian of the expression with respect to the variables. the obj in argument 3 or level 1 if T/F is zero. Flags: Exact mode must be set (flag –105 clear). IFTE lets you execute in stack syntax the decisionmaking process of the IF … THEN … ELSE Numeric mode must not be set (flag –3 clear). … END conditional structure. The “true clause” is obj true in argument 2 or level 2. The “false Radians mode must be set (flag –17 set). clause” is obj false in argument 3 or level 1. Example: Find, and simplify, the Laplacian of the following expression: IFTE is also allowed in algebraic expressions, with the following syntax: x e cos ()zy IFTE( test,trueclause,falseclause ) Command: LAPL(EXP(X)*COS(Z*Y),[X,Y,Z]) When an algebraic containing IFTE is evaluated, its first argument test is evaluated to a test result. EXPAND(ANS(1)) If it returns a nonzero real number, trueclause is evaluated. If it returns zero, falseclause is evaluated. Result: ((Y^2+Z^21)*EXP(X)*COS(Z*Y)) Access: !°BRANCH LIFTE ( °is the leftshift of the Nkey). See also: LAP, ILAP Input/Output: LAST Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 Type: Command Description: Returns copies of the arguments of the most recently executed command. T/F obj true obj false → It depends! LAST is provided for compatibility with the HP 28S. LAST is the same as LASTARG. Example 1: The command sequence X 0 Š "Positive" "Negative" IFTE leaves Access: None. Must be typed in. "Positive" X "Negative" on the stack if contains a nonnegative real number, or if Flags: Last Arguments (–55) X contains a negative real number. Input/Output: Example 2: The algebraic 'IFTE(X‹0,SIN(X)/X,1)' returns the value of sin( x)/ x, even for x = 0, which would normally cause an Infinite Result error. Level 1 Level n Level 1

See also: IFT → obj n … obj 1

ILAP See also: ANS, LASTARG

Type: Function Description: Returns the inverse Laplace transform of an expression. The expression must evaluate to a rational fraction.

3114 Full Command and Function Reference Full Command and Function Reference 3127

INCR KEYTIME → Type: Command Type: Command Description: Increment Command: Takes a variable, adds 1, stores the new value back into the original Description: Displays the current keytime value. variable, and returns the new value. Keytime is the time after a keypress during which further keypresses will not be actioned. It is The value in name must be a real number or an integer. measured in ticks. If you experience key bounce, you can increase the value of keytime. Access: !°MEMORY ARITHMETIC INCR ( °is the leftshift of the Nkey). Access: … KEYTIME → Input/Output: Input/Output: Level 1/Argument 1 Level 1/Item 1 Level 1/Argument 1 Level 1/Item 1

'name ' → xincrement → time Example: If 35.7 is stored in A, 'A' INCR returns 36.7 . See also: →KEYTIME

See also: DECR KGET

INDEP Type: Command Type: Command Description: Kermit Get Command: Used by a local Kermit to get a Kermit server to transmit the named object(s). Description: Independent Variable Command: Specifies the independent variable and its plotting range. To rename an object when the local device gets it, include the old and new names in an embedded The specification for the independent variable name and its plotting range is stored as the third list. For example, {{ AAA BBB }} KGET gets the variable named AAA but changes its name to parameter in the reserved variable PPAR . If the argument to INDEP is a: BBB. {{ AAA BBB } CCC } KGET gets AAA as BBB and gets CCC under its own name. (If the • Global variable name, that name replaces the independent variable entry in PPAR . original name is not legal on the calculator, enter it as a string.) • List containing a global name, that name replaces the independent variable name but leaves Access: … KGET unchanged any existing plotting range. Flags: I/O Device (–33), RECV Overwrite (–36), I/O Messages (–39), I/O Device for Wire (–78) • List containing a global name and two real numbers, that list replaces the independent variable Input/Output: entry. • List containing two real numbers, or two real numbers from levels 1 and 2, those two numbers Level 1/Argument 1 Level 1/Item 1 specify a new plotting range, leaving the independent variable name unchanged. (LASTARG 'name ' → returns a list, even if the two numbers were entered separately.) “name” → The default entry is X. { name old name new } → Access: … INDEP { name 1 ... name n } → Input/Output: {{ name old name new } name ... } → Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 See also: BAUD, CKSM, FINISH, PARITY, RECN, RECV, SEND, SERVER, TRANSIO 'global ' → KILL { global } → Type: Command { global x start x end } → Description: Cancel Halted Programs Command: Cancels all currently halted programs. If KILL is executed within a program, that program is also canceled. {x start x end } → Canceled programs cannot be resumed.

xstart xend → KILL cancels only halted programs and the program from which KILL was executed, if any. See also: DEPND Commands that halt programs are HALT and PROMPT. Suspended programs cannot be canceled. Commands that suspend programs are INPUT and INFORM WAIT. Type: Command Access: !°LL RUN & DEBUG KILL ( °is the leftshift of the Nkey). Description: UserDefined Dialog Box Command: Creates a userdefined input form (dialog box). Input/Output: None INFORM creates a standard dialog box based upon the following specifications: See also: CONT, DOERR, HALT, PROMPT Variable Function LABEL “title” Title. This appears at the top of the dialog box. Type: Command Description: Label Axes Command: Labels axes in PICT with x and yaxis variable names and with the minimum and maximum values of the display ranges. The horizontal axis name is chosen in the following priority order: 1. If the axes parameter in the reserved variable PPAR is a list, then the xaxis element from that list is used.

3116 Full Command and Function Reference Full Command and Function Reference 3125

In its general form, the second argument (level 1) for INPUT is a list that specifies the content vector or a list of Jordan chains, each of them ending with an "Eigen:"tagged eigenvector). and interpretation of the command line. The list can contain one or more of the following Level 1/Item 4: An array of the eigenvalues, with multiplicities parameters, in any order : Flags: Exact mode must be set (flag –105 clear). • "commandline prompt ", whose contents are placed on the command line for prompting when the Numeric mode must not be set (flag –3 clear). program pauses. Radians mode must be set (flag –17 set). • Either a real number , or a list containing two real numbers , that specifies the initial cursor position on the command line: Example: Perform the following diagonalization: – A real number n at the nth character from the left end of the first row (line) of the command Command: JORDAN([1,1][1,1]) line. A positive n specifies the insert cursor; a negative n specifies the replace cursor. 0 specifies Result: {X^22*X, the end of the commandline string. X^22*X, – A list that specifies the initial row and column position of the cursor: the first number in the {0: [1,1]}, 2: [1,1]} list specifies a row in the command line (1 specifies the first row of the command line); the [0,2]} second number counts by characters from the left end of the specified line. 0 specifies the end of the commandline string in the specified row. A positive row number specifies the insert KER cursor; a negative row number specifies the replace cursor. Type: Command • One or more of the parameters ALG, α, or V, entered as unquoted names: Description: Computes the basis of the kernel of a linear application f. – ALG activates Algebraic/Programentry mode. – α specifies alpha lock. Access: Matrices, !Ø LINEAR APPL – V verifies if the characters in the result string "result", without the " delimiters, compose a Input: A matrix representing a linear application f in terms of the standard basis. valid object or objects. If the resultstring characters do not compose a valid object or objects, INPUT displays the Invalid Syntax warning and prompts again for data. Output: A list of vectors representing a basis of the kernel (also called the nullspace) of f. You can choose to specify as few as one of the argument 2 (level 1) list parameters. The default Flags: Exact mode must be set (flag –105 clear). states for these parameters are: Numeric mode must not be set (flag –3 clear). • Blank command line. • Insert cursor placed at the end of the commandline prompt string. 1 1 2 • Programentry mode. 2 1 3 • Result string not checked for invalid syntax. 3 1 4 Example: Find the kernel of If you specify only a commandline prompt string for the second argument (level 1), you don’t need to put it in a list. Command: KER([1,1,2][2,1,3][3,1,4]) Access: !°LIN INPUT ( °is the leftshift of the Nkey). Result: {[1,1,1]} Input/Output: See also: BASIS, IMAGE

Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 KERRM Type: Command “stack prompt” “commandline prompt” → “result” Description: Kermit Error Message Command: Returns the text of the most recent Kermit error packet.

“stack prompt” { list commandline } → “result” If a Kermit transfer fails due to an error packet sent from the connected Kermit device to the See also: PROMPT, STR → calculator, then executing KERRM retrieves and displays the error message. (Kermit errors not in packets are retrieved by ERRM rather than KERRM.) INT Access: … KERRM Type: Function Input/Output: Description: Calculates the antiderivative of a function for a given variable, at a given point. Level 1/Argument 1 Level 1/Item 1 … → “error message” Access: Catalog, Input: Level 3/Argument 1: A function. See also: FINISH, KGET, PKT, RECN, RECV, SEND, SERVER

Level 2/Argument 2: The variable to obtain the derivative with respect to. KEY Level 1/Argument 3: The point at which to calculate the antiderivative. This point can be a Type: Command variable or an expression. Description: Key Command: Returns a test result and, if a key is pressed, returns the rowcolumn location xn m Output: The antiderivative of the function for the given variable, at the point you specified. of that key. KEY returns a false result (0) to item 2 (stack level 1) until a key is pressed. When a key is pressed, Flags: Exact mode must be set (flag –105 clear). it returns a true result (1) to item 2 (stack level 1) and xn m to item 1 (stack level 2). The result xn m Numeric mode must not be set (flag –3 clear). is a two or threedigit number that identifies the row and column location of the key just pressed. Radians mode must be set (flag –17 set).

3118 Full Command and Function Reference Full Command and Function Reference 3123

Input/Output: Flags: Exact mode must be set (flag –105 clear). Level 1/Argument 1 Level 1/Item 1 Numeric mode must not be set (flag –3 clear). Radians mode must be set (flag –17 set). z → 1/z See also: QUOT, IDIV2 [[ matrix ]] → [[ matrix ]] –1 IREMAINDER 'symb ' → 'INV(symb) ' Type: Function x_unit → 1/x_1/unit Description: See also: SINV, / Returns the remainder of an integer division. Access: PARITH or Arithmetic, !ÞINTEGER L INVMOD Input: Level 2/Argument 1: The numerator. Type: Function Level 1/Argument 2: The denominator. Description: Performs modular inversion on an object modulo the current modulus. Output: The remainder. Access: Arithmetic, !ÞMODULO L Flags: Exact mode must be set (flag –105 clear). Input: An object. Numeric mode must not be set (flag –3 clear). Radians mode must be set (flag –17 set). Output: The modular inverse of the object. See also: IDIV2

Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). ISOL Example: Solve the following for x, modulo the default modulus, 13. Type: Command Description: symb 2 symb 1 (2x ≡ 1) Isolate Variable Command: Returns an algebraic that rearranges to “isolate” the first occurrence of variable global . Command: INVMOD(2) The result symb 2 is an equation of the form global = expression . If global appears more than once, Result: 6 then symb 2 is effectively the right side of an equation obtained by rearranging and solving symb 1 to IP isolate the first occurrence of global on the left side of the equation. Type: Function If symb 1 is an expression, it is treated as the left side of an equation symb 1 = 0. Description: Integer Part Function: Returns the integer part of its argument. If global appears in the argument of a function within symb 1, that function must be an analytic function, that is, a function for which the calculator provides an inverse. Thus ISOL cannot solve The result has the same sign as the argument. IP( x)=0 for x, since IP has no inverse. Access: !´ REAL L IP ( ´ is the leftshift of the Pkey). ISOL is identical to SOLVE. Flags: Numerical Results (–3) Access: !ÎISOL ( Îis the leftshift of the 7key). Input/Output: Flags: Principal Solution (–1), Numerical Results (–3) Level 1/Argument 1 Level 1/Item 1 Input/Output:

x → n Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 → x_unit n_unit 'symb 1' 'global ' → 'symb 2' 'symb ' → 'IP(symb) ' See also: COLCT, EXPAN, QUAD, SHOW, SOLVE 32.3_m IP 32_m Example: returns . ISOM See also: FP

Type: Command IQUOT Description: Determine the characteristics of a 2d or 3d linear isometry. Type: Function Access: Matrices, !Ø LINEAR APPL Description: Returns the integer quotient (or Euclidean quotient) of two integers. That is, given two integers, a Input: A square matrix representing a linear isometry. and b, returns the integer q, such that: a = qb + r, and 0 ≤ r < b Output: A vector and/or an angle that represent the symmetry of the matrix, and 1 (for a direct isometry) or –1 (for an indirect isometry). Access: PARITH or Arithmetic, !ÞINTEGER L Flags: Exact mode must be set (flag –105 clear). Input: Level 2/Argument 1: The dividend. Numeric mode must not be set (flag –3 clear). Level 1/Argument 2: The divisor. Radians mode must be set (flag –17 set). Output: The integer quotient.

3120 Full Command and Function Reference Full Command and Function Reference 3121

Input/Output: Access: … PCOV Level 1/Argument 1 Level 1/Item 1 Input/Output: z → log z Level 1/Argument 1 Level 1/Item 1

'symb ' → 'LOG(symb)' → xpcovariance See also: ALOG, EXP, ISOL, LN See also: COLΣ, CORR, COV, PREDX, PREDY, XCOL, YCOL

LOGFIT PDIM Type: Command Type: Command Description: Logarithmic Curve Fit Command: Stores LOGFIT as the fifth parameter in the reserved variable Description: PICT Dimension Command: Replaces PICT with a blank PICT of the specified dimensions. ΣPAR , indicating that subsequent executions of LR are to use the logarithmic curvefitting model. If the arguments are complex numbers, PDIM changes the size of PICT and makes the arguments LINFIT is the default specification in ΣPAR . the new values of ( xmin , ymin ) and ( xmax , ymax ) in the reserved variable PPAR . Thus, the scale of a Access: … LOGFIT subsequent plot is not changed. If the arguments are binary integers, PPAR remains unchanged, Input/Output: None so the scale of a subsequent plot is changed. See also: BESTFIT, EXPFIT, LINFIT, LR, PWRFIT PICT cannot be smaller than 131 pixels wide × 80 pixels high on the HP 50g and 49g+ (64 pixels

high on the HP 48gII) nor wider than 2048 pixels (height is unlimited). LQ Access: !°PICT PDIM ( °is the leftshift of the Nkey). Type: Command Input/Output: Description: LQ Factorization of a Matrix Command: Returns the LQ factorization of an m × n matrix. Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 LQ factors an m × n matrix A into three matrices: (x min , y min ) (x max , y max ) → • L is a lower m × n trapezoidal matrix. #n width #m height → • Q is an n × n orthogonal matrix. See also: PMAX, PMIN

• P is a m × m permutation matrix. Where P × A = L × Q. PERINFO Access: !Ø FACTORIZATION LQ ( Ø is the leftshift of the 5key). Type: Command !´ MATRIX FACTORS LQ ( ´ is the leftshift of the Pkey). Description: Displays the Periodic Table version and copyright information. It doesn’t affect the stack. Input/Output: Access: G PERIODIC TABLE PERINFO Input/Output: None Level 1/Argument 1 Level 3/Item 1 Level 2/Item 2 Level 1/Item 3 See also: MOLWT, PERTBL, PTPROP A L Q P [[ matrix ]] → [[ matrix ]] [[ matrix ]] [[ matrix ]] See also: LSQ, QR PERM Type: Function LR Description: Permutations Function: Returns the number of possible permutations of n items taken m at a Type: Command time. Description: Linear Regression Command: Uses the currently selected statistical model to calculate the linear The formula used to calculate P n,m is: regression coefficients (intercept and slope) for the selected dependent and independent variables in the current statistics matrix (reserved variable ΣDAT ). n! Pn, m = ------The columns of independent and dependent data are specified by the first two elements in the ()n– m ! reserved variable ΣPAR , set by XCOL and YCOL, respectively. (The default independent and The arguments n and m must each be less than 10 12 . If n < m, zero is returned. dependent columns are 1 and 2.) The selected statistical model is the fifth element in ΣPAR . LR stores the intercept and slope (untagged) as the third and fourth elements, respectively, in ΣPAR . Access: !´LPROBABILITY PERM ( ´ is the leftshift of the Pkey). The coefficients of the exponential (EXPFIT), logarithmic (LOGFIT), and power (PWRFIT) Flags: Numerical Results (–3) models are calculated using transformations that allow the data to be fitted by standard linear Input/Output: regression. The equations for these transformations appear in the table below, where b is the Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1

intercept and m is the slope. The logarithmic model requires positive xvalues (XCOL), the n m → Pn,m exponential model requires positive yvalues (YCOL), and the power model requires positive x 'symb n' m → 'PERM(symb n,m )' and yvalues. n 'symb m' → 'PERM(n, symb m)'

'symb n' 'symb m' → 'PERM(symb n,symb m)' See also: COMB, FACT, !

3138 Full Command and Function Reference Full Command and Function Reference 3167

Input/Output: Result: 1/2/(X1)+1/2/(X+1) Level 1/Argument 1 Level 3/Item 1 Level 2/Item 2 Level 1/Item 3 See also: PROPFRAC

[[ matrix ]] A → [[ matrix ]] L [[ matrix ]]U [[ matrix ]] P PATH See also: DET, INV, LSQ, / Type: Command Description: Current Path Command: Returns a list specifying the path to the current directory. LVAR The first directory is always HOME , and the last directory is always the current directory. Type: Command If a program needs to switch to a specific directory, it can do so by evaluating a directory list, such Description: Returns a list of variables in an algebraic object. Differs from LNAME above in that functions of as one created earlier by PATH. variables, such as COS(X) or LN(AB) are returned, instead of the variable names, X or AB. INV() Access: !°MEMORY DIRECTORY PATH ( °is the leftshift of the Nkey). and SQ() are not treated as functions. Compare the example here with the same example in Input/Output: LNAME. Level 1/Argument 1 Level 1/Item 1

Access: Catalog, … → { HOME directoryname 1 ... directoryname n } Input: An algebraic object. See also: CRDIR, HOME, PGDIR, UPDIR

Output: Level 2/Item 1: The algebraic object. PCAR Level 1/Item 2: A list which includes both the original expression and a vector containing the Type: Command variable names. Variable names include functions of variables, as described above. The names are sorted by length, longest first, and ones of equal length are sorted alphabetically. Description: Returns the characteristic polynomial of an n × n matrix. Flags: Exact mode must be set (flag –105 clear). Access: Matrices, !Ø L EIGENVECTORS Numeric mode must not be set (flag –3 clear). Input: A square matrix. Example: List the variables and function names in the expression COS(B)/2*A + MYFUNC(PQ) + 1/T. Output: The characteristic polynomial of the matrix. Command: LVAR(COS(B)/2*A + MYFUNC(PQ) + INV(T)) Flags: Exact mode must be set (flag –105 clear). Result: {COS(B)/2*A + MYFUNC(PQ) + 1/T, [MYFUNC(PQ),COS(B),A,T]} Numeric mode must not be set (flag –3 clear). See also: LNAME Example: Find the characteristic polynomial of the following matrix: MAD 5 8 16 Type: Command 4 1 8 –4 – 4 – 11 Description: Returns details of a square matrix, including the information needed to obtain the adjoint matrix. The adjoint matrix is obtained by multiplying the inverse matrix by the determinant. Command: PCAR([[5,8,16][4,1,8][4,4,11]]) X^3+5*X^2+3*X9 Access: Matrices, !Ø OPERATIONS L Result: See also: JORDAN, PMINI Input: A square matrix Output: Level 4/Item 1: The determinant. PCOEF Level 3/Item 2: The formal inverse. Type: Command Level 2/Item 3: The matrix coefficients of the polynomial, p, defined by Description: Monic Polynomial Coefficients Command: Returns the coefficients of a monic polynomial (a (xi –a)p(x)= m(x)i, where a is the matrix, and m is the characteristic polynomial of a. polynomial with a leading coefficient of 1) having specific roots. Level 1/Item 4: The characteristic polynomial. The argument must be a real or complex array of length n containing the polynomial’s roots. The result is a real or complex vector of length n+1 containing the coefficients listed from highest Flags: Exact mode must be set (flag –105 clear). order to lowest, with a leading coefficient of 1. Numeric mode must not be set (flag –3 clear). Access: !Þ POLYNOMIAL LL PCOEF ( Þis the leftshift of the 1key). Example: Obtain the adjoint matrix of: Input/Output: 0– 1 Level 1/Argument 1 Level 1/Item 1 1 0

[ array ] roots → [ array ] coefficients Command: MAD([[0, 1][1, 0]]) Example: Find the polynomial that has the roots 2, –3, 4, –5: Result: {1,[[0, 1][1, 0]],{[[1, 0][0, 1]], [[0, 1][1, 0]]}, X^2+1} The determinant is 1, so the adjoint is the second item [[0, 1][1, 0]] . Command: [ 2 –3 4 –5 ] PCOEF Result: [ 1 2 –25 –26 120 ] , representing the polynomial x4 + 2 x3 25 x2 26 x + 120. See also: LNAME See also: PEVAL, PROOT

3140 Full Command and Function Reference Full Command and Function Reference 3165

The pattern 'symb pat ' and replacement 'symb repl ' can be normal expressions; for example, you can • (xmax , ymax ) is a complex number specifying the upper right corner of PICT (the upper right replace .5 with 'SIN(π/6)'. You can also use a “wildcard” in the pattern (to match any corner of the display range). The default value is (6.5,3.2) for the HP 48gII and (6.5,4.0) for the subexpression) and in the replacement (to represent that expression). A wildcard is a name that HP 50g and 49g+. begins with &, such as the name '&A', used in replacing 'SIN(&A+&B)' with • indep is a list containing a name that specifies the independent variable, and two numbers 'SIN(&A)*COS(&B)+COS(&A)*SIN(&B)'. Multiple occurrences of a particular wildcard in a specifying the minimum and maximum values for the independent variable (the plotting range). pattern must match identical subexpressions. Note that the default value is X. If X is not modified and included in a list with a plotting ↓MATCH works from top down; that is, it checks the entire expression first. This approach range, the values in ( xmin , ymin ) and ( xmax , ymax ) are used as the plotting range, which generally works well for expansion. An expression expanded during one execution of ↓MATCH will leads to meaningless results. contain additional subexpressions, and those subexpressions can be expanded by another • res is a real number specifying the interval, in userunit coordinates, between values of the execution of ↓MATCH. Several expressions can be expanded by one execution of ↓MATCH independent variable. The default value is 0, which specifies an interval equal to 1/130 of the provided none is a subexpression of any other. difference between the maximum and minimum values in indep (the plotting range). Access: …↓MATCH • axes is a list containing one or more of the following, in the order listed: a complex number specifying the userunit coordinates of the plot origin, a list specifying the tickmark annotation, Input/Output : and two strings specifying labels for the horizontal and vertical axes. The default value is (0,0). Level 1/Item Level 2/Argument 1 Level 1/Argument 2 Level 2/Item 1 • ptype is a command name specifying the plot type. Executing the command PARAMETRIC places the name PARAMETRIC in PPAR .

'symb 1' { ' symb pat ' ' symb repl ' } → 'symb 2' 0/1 • depend is a name specifying a label for the vertical axis. The default value is Y. The contents of EQ must be an expression or program; it cannot be an equation. It is evaluated

'symb 1' { ' symb pat ' ' symb repl ' ' symb cond ' } → 'symb 2' 0/1 for each value of the independent variable. The results, which must be complex numbers, give the Example 1: .5 { .5 'SIN(π/6)' } ↓MATCH returns 'SIN(π/6)' to level 2 and 1 to level coordinates of the points to be plotted. Lines are drawn between plotted points unless flag –31 is 1. set. Example 2: 'SIN(U+V)' { 'SIN(&A+&B)' Access: … PARAMETRIC 'SIN(&A)*COS(&B)+COS(&A)*SIN(&B)' } ↓MATCH returns Flags: Simultaneous Plotting (–28), Curve Filling (–31) 'SIN(U)*COS(V)+COS(U)*SIN(V)' to level 2 and 1 to level 1. Input/Output: None See also: BAR, CONIC, DIFFEQ, FUNCTION, GRIDMAP, HISTOGRAM, PARSURFACE, 'SIN(5*Z)' { 'SIN(&A+&B)' Example 3: This sequence: PCONTOUR, POLAR, SCATTER, SLOPEFIELD, TRUTH, WIREFRAME, YSLICE

'Σ(K=0,&A,COMB(&A,K)*SIN(K*π)*COS(&B^(&AK)*SIN(&B)^K)' 'ABS(IP(&A))==&A' } ↓MATCH returns PARITY 'Σ(K=0,5,COMB(5,K)*SIN(K*π)*COS(Z^(5K)*SIN(Z)^K)' to level 2 Type: Command and 1 to level 1. Description: Parity Command: Sets the parity value in the reserved variable IOPAR . See also: ↑MATCH Legal values are shown below. A negative value means the calculator does not check parity on bytes received during Kermit transfers or with SRECV. Parity is still used during data ↑MATCH transmission, however. Type: Command nValue Meaning Description: BottomUp Match and Replace Command: Rewrites an expression. 0 no parity (the default value) ↑MATCH rewrites expressions or subexpressions that match a specified pattern 'symb pat '. An optional condition, 'symb cond ', can further restrict whether a rewrite occurs. A test result is also 1 odd parity returned to indicate if command execution produced a rewrite; 1 if it did, 0 if it did not. 2 even parity The pattern 'symb pat ' and replacement 'symb repl ' can be normal expressions; for example, you can replace 'SIN(π/6)' with '1/2'. You can also use a “wildcard” in the pattern (to match any 3 mark subexpression) and in the replacement (to represent that expression). A wildcard is a name that 4 space begins with &, such as the name '&A', used in replacing 'SIN(&A+π)' with '–SIN(&A)'. Multiple occurrences of a particular wildcard in a pattern must match identical subexpressions. For more information, refer to the reserved variable IOPAR in appendix D, “Reserved ↑MATCH works from bottom up; that is, it checks the lowest level (most deeply nested) Variables”. subexpressions first. This approach works well for simplification. A subexpression simplified Access: …PARITY during one execution of ↑MATCH will be a simpler argument of its parent expression, so the Input/Output: parent expression can be simplified by another execution of ↑MATCH. Level 1/Argument 1 Level 1/Item 1 Several subexpressions can be simplified by one execution of ↑MATCH provided none is a

subexpression of any other. nparity → Access: …↑MATCH See also: BAUD, CKSM, TRANSIO

3142 Full Command and Function Reference Full Command and Function Reference 3163

Example 1: 10 23 MAX returns 10 . bit 1 bit 2 bit 1 OR bit 2 Example 2: 10 23 MAX returns 10 . 0 0 0 Example 3: 1_m 9_cm MAX returns 1_m . 0 1 1 See also: MIN 1 0 1 1 1 1 MAXR • An argument that is a string is treated as a sequence of , using 8 bits per character (that is, Type: Function using the binary version of the character code). The two string arguments must be the same Description: Maximum Real Function: Returns the symbolic constant MAXR or its numerical representation length. 9.99999999999E499. When the arguments are real numbers or symbolics, OR simply does a true/false test. The result MAXR is the largest real number that can be represented by the calculator. is 1 (true) if either or both arguments are nonzero; it is 0 (false) if both arguments are zero. This Access: !´L CONSTANTS LMAXR ( ´ is the leftshift of the Pkey). test is usually done to compare two test results. Flags: Symbolic Constants (–2), Numerical Results (–3) If either or both of the arguments are algebraic objects, then the result is an algebraic of the form Input/Output: symb 1 OR symb 2. Execute →NUM (or set flag –3 before executing OR) to produce a numeric result from the algebraic result. Level 1/Argument 1 Level 1/Item 1 Access: …ãL LOGIC OR (ãis the rightshift of the 3key). → 'MAXR ' !° TEST L OR ( °is the leftshift of the Nkey). → 9.99999999999E499 Flags: Numerical Results (–3), Binary Integer Wordsize (–5 through –10) Input/Output: See also: e, i , MINR, π Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 MAX ΣΣΣ

Type: Command #n 1 #n 2 → #n 3

Description: Maximum Sigma Command: Finds the maximum coordinate value in each of the m columns of “string 1” “string 2” → “string 3” the current statistical matrix (reserved value ΣDAT ). T/F 1 T/F 2 → 0/1 The maxima are returned as a vector of m real numbers, or as a single real number if m = 1. T/F 'symb ' → 'T/F OR symb ' Access: … MAX Σ 'symb ' T/F → 'symb OR T/F ' Input/Output: 'symb 1' 'symb 2' → 'symb 1 OR symb 2' Level 1/Argument 1 Level 1/Item 1 See also: AND, NOT, XOR

→ xmax ORDER → [x max1 x max2 ... x maxm ] Type: Command See also: BINS, MEAN, MINΣ, SDEV, TOT, VAR Description: Order Variables Command: Reorders the variables in the current directory (shown in the VAR menu) to the order specified. MCALC The names that appear first in the list will be the first to appear in the VAR menu. Variables not Type: Command specified in the list are placed after the reordered variables. Description: Make Calculated Value Command: Designates a variable as a calculated variable for the multiple If the list includes the name of a large subdirectory, there may be insufficient memory to execute equation solver. ORDER. MCALC designates a single variable, a list of variables, or all variables as calculated values. Access: … MCALC Access: !°MEMORY DIRECTORY L ORDER ( °is the leftshift of the Nkey). Input/Output: Input/Output:

Level 1/Argument 1 Level 1/Item 1 Level 1/Argument 1 Level 1/Item 1

'name ' → { global 1 ... global n } → { list } → See also: VARS

"ALL" → OVER See also: MUSER Type: RPL command Description: Over Command: Returns a copy to stack level 1 of the object in level 2.

3144 Full Command and Function Reference Full Command and Function Reference 3161

than a list or name containing a list is supplied to MENU, a Bad Argument Type error will occur !°LIST OBJ → ( °is the leftshift of the Nkey). when the calculator attempts to display the custom menu. …&NL OBJ → A full list of all menus can be found in Appendix H of this reference. !°LCHARS LOBJ → ( °is the leftshift of the Nkey). Access: !&H [ MENU ] MENU Input/Output: !°LMODES [MENU ] MENU ( °is the leftshift of the Nkey). Level 1/Argument 1 Level n+1 /Item 1 Level 2/Item n Level 1/Item n+1 Input/Output: (x, y) → x y

Level 1/Argument 1 Level 1/Item 1 { obj 1, ... ,obj n } → obj 1 … obj n n

xmenu → [ x 1, ... ,x n ] → x1 … xn { n }

1 1 m n → 1 1 m n { list definition } → [[ x , ... ,x ]] x … x { m, n }

'name definition ' → “obj” → evaluated object

obj → 'symb ' → arg 1 ... arg n … n 'function ' Example 1: 5 MENU displays the first page of the MTH MATR NORM menu. x_unit → x 1_unit Example 2: 48.02 MENU displays the second page of the UNITS MASS menu. :tag:obj → obj “tag” Example 3: { A 123 "ABC" } MENU displays the custom menu defined by the list argument. Example: The command sequence '„(0,1,SIN(X),X)' OBJ→ returns: Example 4: 'MYMENU' MENU displays the custom menu defined by the name argument. 6: 0 first argument See also: RCLMENU, TMENU 5: 1 second argument 4: 'SIN(X)' third argument MENUXY 3: 'X' fourth argument Type: Command 2: 4 number of arguments for „ 1: „ Description: Displays a function key menu of computer algebra commands in a specified range. function name See also: ARRY→, C→R, DTAG, EQ→, LIST→, R→C, STR→, →TAG Access: Catalog, … Input: Level 2/Argument 1: The number of the first command in the range to be displayed. OCT Level 1/Argument 2: The number of the last command in the range to be displayed. Type: Command Arguments below 0 are treated as 0; arguments above 140 are treated as 140. Description: Octal Mode Command: Selects octal base for binary integer operations. (The default base is decimal.) Binary integers require the prefix #. Binary integers entered and Output: On the function key menu, the computer algebra commands in the range specified. NOVAL is returned in octal base automatically show the suffix o. If the current base is not octal, enter an returned in Algebraic mode. octal number by ending it with o. It will be displayed in the current base when entered. The This list gives the number of each operation that can be displayed by the command. The complete current base does not affect the internal representation of binary integers as unsigned binary menu below can be generated by MENUXY(0,140). Items 127 through to 135 allow access from numbers. the top row of keys to CAS menus. Access: …ãOCT (ã is the rightshift of the 3key). Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) Number Operation Input/Output: None 05 EXPAND FACTOR SUBST DERVX INTVX lim 611 TAYLOR0 SERIES SOLVEVX PLOT PLOTADD IBP See also: BIN, DEC, HEX, RCWS, STWS 1217 PREVAL RISCH DERIV DESOLVE LAP ILAP 1823 LDEC TEXPAND LIN TSIMP LNCOLLECT EXPLN OFF 2429 SINCOS TLIN TCOLLECT TRIG TRIGCOS TRIGSIN Type: Command 3035 TRIGTAN TAN2SC HALFTAN TAN2SC2 ATAN2S ASIN2T Description: Off Command: Turns off the calculator. 3641 ASIN2C ACOS2S DIV2 IDIV2 QUOT IQUOT When executed from a program, that program will resume execution when the calculator is turned 4247 REMAINDER IREMAINDER GCD LCM EGCD IEGCD on. This provides a programmable “autostart.” ( i.e., a programmable …ç). 4853 ABCUV IABCUV LGCD SIMP2 PARTFRAC PROPFRAC Access: „°LLRUN L OFF ( °is the leftshift of the Nkey). 5459 PTAYL HORNER EULER PA2B2 CHINREM ICHINREM 6065 ISPRIME? NEXTPRIME PREVPRIME SOLVE ZEROS FCOEF Input/Output: None 6671 FROOTS FACTORS DIVIS TRAN HADAMARD rref See also: CONT, HALT, KILL 7277 REF AXM AXL QXA AXQ GAUSS 7883 SYLVESTER PCAR JORDAN MAD LINSOLVE VANDERMONDE OLDPRT 8489 HILBERT LCXM DIV CURL LAPL HESS Type: Command 9095 LEGENDRE TCHEBYCHEFF HERMITE LAGRANGE FOURIER SIGNTAB Description: Modifies the remapping string in the reserved variable PRTPAR so that the extended character set 96101 TABVAR TABVAL DIVPC TRUNC SEVAL TEVAL of the calculator matches that of the HP 82240A Infrared Printer. 102107 MAP XNUM XQ REORDER LVAR FXND

3146 Full Command and Function Reference Full Command and Function Reference 3159

Use the number or arrow keys to cross the battlefield one square at a time (use 7, 9, 1, NOVAL is used to mark an empty field in a userdefined dialog box created with the INFORM and 3to move diagonally.) You can exit the game at any time by pressing −(the $ key). command. INFORM defines fields sequentially. If default values are used for those fields, the To interrupt and save a game, press K. This creates a variable MHpar in the current directory defaults must be defined in the same order as the fields were defined. To skip over (not provide and ends the game. If MHpar exists when you start MINEHUNT, the interrupted game resumes defaults for) some of the fields, use the NOVAL command. and MHpar is purged. After INFORM terminates, NOVAL is returned if a field is empty and OK or ` is selected. You can change the number of mines in the battlefield by creating a variable named Nmines Access: !°L IN NOVAL ( °is the leftshift of the Nkey). containing the desired number. Nmines must contain a real number (1 to 64). If Nmines is negative, Input/Output: None the mines are visible during the game (allowing you to cheat). See also: INFORM Access: G EQUATION LIBRARY UTILS MINEHUNT Input/Output: None. NΣ Type: Command MINIFONT → Description: Number of Rows Command: Returns the number of rows in the current statistical matrix Type: Command (reserved variable ΣDAT ). Description: Minifont: Returns the font that is set as the minifont. Access: … NΣ Access: … MINIFONT → Input/Output: Input/Output: Level 1/Argument 1 Level 1/Item 1

Level 1/Argument 1 Level 1/Item 1 → nrows → Font object See also: ΣX, ΣXY, ΣX2, ΣY, ΣY2

See also: →MINIFONT NSUB Type: Command →MINIFONT Type: Command Description: Number of Sublist Command: Provides a way to access the current sublist position during an iteration of a program or command applied using DOSUBS. Description: Minifont: Sets the font that is used as the minifont. Returns an Undefined Local Name error if executed when DOSUBS is not active. Access: … →MINIFONT Access: !°LIST PROCEDURES NSUB ( °is the leftshift of the Nkey). Input/Output: Input/Output: Level 1/Argument 1 Level 1/Item 1 Level 1/Argument 1 Level 1/Item 1

Font object → → nposition See also: MINIFONT→ See also: DOSUBS, ENDSUB

MINIT →NUM Type: Command Type: Command Description: Multipleequation Menu Initialization Command. Creates the reserved variable Mpar , which Description: Evaluate to Number Command. Evaluates a symbolic argument object (other than a list) and includes the equations in EQ and the variables in these equations. returns the numerical result. Access: …MINIT →NUM repeatedly evaluates a symbolic argument until a numerical result is achieved. The effect is the same as evaluating a symbolic argument in Numerical Result Mode (flag –3 set). See also: MITM, MROOT, MSOLVR

Access: … →NUM (→NUM is the rightshift of the `key). MINR Input/Output: Type: Function Level 1/Argument 1 Level 1/Item 1

Description: Minimum Real Function: Returns the symbolic constant MINR or its numerical representation, obj symb → z 1.00000000000E–499. See also: EVAL MINR is the smallest positive real number that can be represented by the calculator. NUM Access: !´LCONSTANTS LMINR ( ´ is the leftshift of the Pkey). Type: Command Flags: Symbolic Constants (–2), Numerical Results (–3) Description: Character Number Command: Returns the character code n for the first character in the string. The character codes are an extension of ISO 8859/1. Codes 128 through 159 are unique to the calculators.

3148 Full Command and Function Reference Full Command and Function Reference 3157

Example 2: Find the matrix for a rotation with axis [1 1 1] and angle π/3 radians combined with a reflection in See also: ABS, CONJ, NOT, SIGN the plane x + y + z = 0 NEWOB Command: MKISOM({ [1, 1, 1], π/3 }, 1) then simplify with EXPAND(ANS(1)) Type: Command 0– 1 0 Description: New Object Command: Creates a new copy of the specified object. 0 0– 1 NEWOB has two main uses: –1 0 0 Result: • NEWOB enables the purging of a library or backup object that has been recalled from a port. NEWOB creates a new, separate copy of the object in memory, thereby allowing the original See also: ISOM copy to be purged. MOD • Creating a new copy of an object that originated in a larger composite object (such as a list) Type: Function allows you to recover the memory associated with the larger object when that larger object is no Description: Modulo Function: Returns a remainder defined by: x mod y = x – y floor ( x/y) longer needed. Mod ( x, y) is periodic in x with period y. Mod ( x, y) lies in the interval [0, y) for y > 0 and in ( y, 0] !° ° N for y < 0. Access: MEMORY NEWOB ( is the leftshift of the key). Algebraic syntax: argument 1 MOD argument 2 Flags: Last Arguments (–55). In order for NEWOB to immediately release the memory occupied by the Access: !´REAL MOD ( ´ is the leftshift of the Pkey). original copy, flag –55 must be set so that the copy is not saved as a last argument. Input/Output: !ÞMODUL L MOD ( Þ is the leftshift of the 1key). Level 1/Argument 1 Level 1/Item 1 Flags: Numerical Results (–3) Input/Output: obj → obj Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Example 1: :0:BKUP1 RCL NEWOB :0:BKUP1 PURGE recalls and purges the backup object BKUP1 . → x y x mod y Example 2: 3 GET NEWOB retrieves the third element out of a list on the stack, recovering the memory x 'symb ' → 'MOD(x, symb) ' occupied by the whole list. 'symb ' x → 'MOD(symb, x) ' See also: MEM, PURGE

'symb 1' 'symb 2' → 'MOD(symb 1, symb 2)' NEXT See also: FLOOR, / Type: Command

MODSTO Description: NEXT Command: Ends definite loop structures. See the FOR and START keyword entries for more information. Type: Command Access: !°BRANCH START /FOR NEXT ( °is the leftshift of the Nkey). Description: Changes the modulo setting to the specified number. The number that you set is reflected in the Input/Output: CAS Modes input form. Negative numbers are replaced by their positive value, 0 and 1 are None replaced by 2. See also: FOR, START, STEP

Access: Arithmetic, !Þ MODULO L NEXT Input: The modulo value that you want to set, an integer or an expression that evaluates to an integer. Type: Operation Description: NEXT Operation: Returns but does not execute the next one or two steps of a program. Output: The modulo setting is changed to the specified number. In Algebraic mode, NOVAL is returned as argument 1. Access: „°LLRUN NEXT ( °is the leftshift of the Nkey). Flags: Exact mode must be set (flag –105 clear). Input/Output: None Numeric mode must not be set (flag –3 clear). See also: SST, SST ↓

MODULAR NEXTPRIME Type: Command Type: Function Description: Displays a menu or list of the CAS modulo operations. Description: Given an integer, returns the next prime number larger than the integer. Like ISPRIME?, it uses a Access: Catalog, … pseudoprime check for large numbers. Flags: If the CHOOSE boxes flag is clear (flag –117 clear), displays the operations as a numbered list. If Access: Arithmetic, !Þ INTEGER L the flag is set, displays the operations as a menu of function keys. Input: An integer or an expression that evaluates to an integer. See also: ALGB, ARIT, CONSTANTS, DIFF, EXP&LN, INTEGER, MAIN, MATHS, MATR, Output: The next prime number larger than the integer. POLYNOMIAL, REWRITE, TESTS, TRIGO Example: Find the closest, larger prime number to 145.

3150 Full Command and Function Reference Full Command and Function Reference 3155

Input/Output: variable Mpar that is used during the solution process. Mpar contains the equation set plus additional information. See appendix D, “Reserved Variables”, for information about Mpar . Level 1/Argument 1 Level 1/Item 1 Access: … MSOLVR “message” → Input/Output: None See also: CHOOSE, INFORM, PROMPT See also: EQNLIB, MCALC, MINIT, MITM, MROOT, MSLV, MUSER

MSLV MULTMOD Type: Command Type: Function Description: Numerically approximates a solution to a system of equations. Searches for a solution accurate to Description: Performs modular multiplication of two objects, modulo the current modulus. 12 digits, regardless of the display setting. Underdetermined and overdetermined systems are rejected. Complex solutions will be looked for if any of the inputs contain complex values. If a Access: Arithmetic, !Þ MODULO L single expression or equation is to be solved, use SOLVE instead, or for linear equations, use Input: Level 2/Argument 1: A number or an expression. LINSOLVE. This command is similar to MSOLVR, but is more appropriate for use with the Level 1/Argument 2: A number or an expression. CAS as it automates the solution instead of working through a menu. Stepbystep mode is Output: available with this command. The result of modular multiplication of the two objects, modulo the current modulus. Flags: Exact mode must be set (flag –105 clear). Access: Numeric solve, …Ï or catalog, … Numeric mode must not be set (flag –3 clear). Input: Level 3/Argument 1: A vector containing the equations or expressions (assumed equal to zero) to Radians mode must be set (flag –17 set). solve. Example: Find the product of 2 x and 38 x2, modulo the default modulus, 3. Level 2/Argument 2: A vector containing the variables to solve for Level 1/Argument 3: A vector containing initial guesses Command: MULTMOD(2*X,38*X^2) Result: X^3 Output: Level 3/Item 1: The vector containing the equations to solve. Level 2/Item 2: The vector containing the variables to solve for MUSER Level 1/Item 3: A vector representing an approximate solution to the system of equations. Type: Command Flags: Exact mode must be set (flag –105 clear), The calculator will set approximate mode and will look Description: Make UserDefined Variable Command: Designates a variable as userdefined for the multiple for approximate results if exact results are not found. equation solver. Numeric mode must not be set (flag –3 clear). MUSER designates a single variable, a list of variables, or all variables as userdefined. Radians mode must be set (flag –17 set). Access: … MUSER Complex mode must be set (flag –103 set) if complex results are wanted. Input/Output: Stepbystep mode can be set (flag –100 set). Example: Find x and y values, allowing for complex solutions, that solve the following two equations. The Level 1/Argument 1 Level 1/Item 1 first equation is an expression equal to zero, so only the expression needs to be given. Setting the 'name ' → second expression equal to a complex number forces the solver to look for complex solutions: sin( x)+ y=0, x+sin( y)=1: { list } → Command: MSLV('[SIN(X)+Y, X+SIN(Y)=(1,0)]', '[X,Y]', [0,0]) "ALL" → Results: ('[SIN(X)+Y, X+SIN(Y)=(1,0)]', '[X,Y]', [(1.82384112611,0.), See also: MCALC

(.968154636174,0.)]) →NDISP See also: DESOLVE, LINSOLVE, MSOLVR, SOLVE Type: Command Description: Sets the number of program lines displayed on the screen. MSOLVR The default value on the calculator is 9. On the HP 50g and 49g+ a value of 12 should be set for Type: Command →NDISP , which will allow more of these models’ taller screen to be used when the font is Description: Multiple Equation Solver Command: Gets the multipleequation solver variable menu for the set FONT7, FONT6, or the MINIFONT. Also, note that the →NDISP setting is reset to 9 at every of equations defined by Mpar . warmstart. Including << 12 →NDISP >> in 'STARTUP' will automatically reset the value to 12. The multipleequation solver application can solve a set of two or more equations for unknown Access: … →NDISP variables by finding the roots of each equation, one at a time. Input/Output: The MultipleEquation Solver uses the list of equations stored in EQ . “Equations” in this context includes programs, expressions, and variable names that evaluate to a single value. The Multiple Level 1/Argument 1 Level 1/Item 1 Equation Solver requires that EQ contain more than one equation — that is, the HP Solve n → application would include the NXEQ menu label for EQ . The solver uses EQ to create a reserved

3152 Full Command and Function Reference Full Command and Function Reference 3153

Input/Output: None REORDER

PIX? Type: Function Type: Command Description: Given a polynomial expression and a variable, reorders the variables in the expression in the order Description: Pixel On? Command: Tests whether the specified pixel in PICT is on; returns 1 (true) if the pixel of powers set on the CAS Modes screen, that is, either in increasing or decreasing order. is on, and 0 (false) if the pixel is off. Access: Catalog, … !° L L ° N Access: PICT PIX ? ( is the leftshift of the key). Input: Level 2/Argument 1: The polynomial expression. Input/Output: Level 1/Argument 2: The variable with respect to which the reordering is performed. Level 1/Argument 1 Level 1/Item 1 Output: The reordered expression. (x,y) → 0/1 Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). { #n #m } → 0/1 Radians mode must be set (flag –17 set). See also: PIXON, PIXOFF Complex mode must be set (flag –103 set) if the polynomial contains complex terms.

PIXOFF The polynomial terms order flag (flag –114) must be set for increasing power order, or clear (the default) for decreasing power order. Type: Command Description: Pixel Off Command: Turns off the pixel at the specified coordinate in PICT . Example: Reorder the polynomial x2 + 2 y2 +2 x +3 y in order of powers of y. Assume that increasing power mode has been set in the CAS modes. Access: !°LPICT L PIXOFF ( °is the leftshift of the Nkey). Command: REORDER(X^2+2*Y^2+2*X+6+3*Y, Y) Input/Output: Result: 2*Y^2+3*Y+(X^2+2*X)

Level 1/Argument 1 Level 1/Item 1 REPEAT (x,y) → Type: Command { #n #m } → Description: REPEAT Command: Starts loop clause in WHILE … REPEAT … END indefinite loop structure. See also: PIXON, PIX? See the WHILE entry for more information. PIXON Access: !°BRANCH WHILE REPEAT ( °is the leftshift of the Nkey). Type: Command Input/Output: None Description: Pixel On Command: Turns on the pixel at the specified coordinate in PICT . See also: END, WHILE Access: !°LPICT LPIXON ( °is the leftshift of the Nkey). Input/Output: REPL Type: Command Level 1/Argument 1 Level 1/Item 1 Description: Replace Command: Replaces a portion of the target object (first input) with a specified object (x,y) → (third input), beginning at a specified position (second input). { #n #m } → For arrays, nposition counts in row order. For matrices, nposition specifies the new location of the See also: PIXOFF, PIX? upper lefthand element of the replacement matrix. For graphics objects, the upper left corner of grob 1 is positioned at the userunit or pixel PKT coordinates ( x,y) or { #n #m }. From there, it overwrites a rectangular portion of grob target or Type: Command PICT . If grob 1 extends past grob target or PICT in either direction, it is truncated in that direction. If Description: Packet Command: Used to send command “packets” (and receive requested data) to a Kermit the specified coordinate is not on the target graphics object, the target graphics object does not server. change. To send calculator objects, use SEND. Access: !°LIST REPL ( °is the leftshift of the Nkey). PKT allows additional commands to be sent to a Kermit server. The packet data, packet type, and the response to the packet transmission are all in string form. PKT first does an I ( initialization ) packet exchange with the Kermit server, then sends the server a packet constructed from the data and packettype arguments supplied to PKT. The response to PKT will be either an acknowledging string (possibly blank) or an error packet (see KERRM). For the type argument, only the first letter is significant. Access: … PKT

3170 Full Command and Function Reference Full Command and Function Reference 3199

Access: … PMIN Input/Output: Input/Output: Level 1/Argument 1 Level 1/Item 1 Level 1/Argument 1 Level 1/Item 1 x → x (x,y) → x_unit → x See also: PDIM, PMAX, XRNG, YRNG (x,y ) → x

PMINI [ Rarray ] → [ Rarray ] Type: Command [ Carray ] → [ Rarray ] Description: Finds the minimal polynomial of a matrix. 'symb ' → 'RE( symb ') Access: Matrices, ! Ø LEIGENVECTORS See also: C→R, IM, R→C

Input: An nxn matrix A. RECN Output: A matrix whose first zerorow contains the minimal polynomial of A. In stepbystep mode, Type: Command PMINI shows the rowreduction steps. Description: Receive Renamed Object Command: Prepares the calculator to receive a file from another Kermit server device, and to store the file in a specified variable. Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). RECN is identical to RECV except that the name under which the received data is stored is Stepbystep mode can be set (flag –100 set). specified. 0 1 Access: … RECN 1 0 Flags: I/O Device flag (–33), I/O Data Format (–35), RECV Overwrite (–36), I/O Messages (–39), I/O Example: Find the minimal polynomial of : Device for Wire (–78) Command: PMINI([[0,1][1,0]]) Input/Output:

1 0 0 1 1 Level 1/Argument 1 Level 1/Item 1 0 1 1 0 X → 2 'name ' 0 0 0 0 X – 1 Result: So, the minimal polynomial is X21, as it is in the first row to contain entirely “name ” → zeros, except for the result. See also: BAUD, CKSM, CLOSEIO, FINISH, KERRM, KGET, PARITY, RECV, SEND, SERVER, See also: JORDAN, PCAR TRANSIO

POLAR RECT Type: Command Type: Command Description: Polar Plot Type Command: Sets the plot type to POLAR. Description: Rectangular Mode Command: Sets Rectangular coordinate mode. When the plot type is POLAR, the DRAW command plots the current equation in polar RECT clears flags –15 and –16. coordinates, where the independent variable is the polar angle and the dependent variable is the In Rectangular mode, vectors are displayed as rectangular components. Therefore, a 3D vector radius. The current equation is specified in the reserved variable EQ . would appear as [ X Y Z ]. The plotting parameters are specified in the reserved variable PPAR , which has this form: Access: „&H ANGLE RECT { ( xmin , ymin ) ( xmax , ymax ) indep res axes ptype depend } „´VECTOR L RECT ( ´is the leftshift of the Pkey). For plot type POLAR, the elements of PPAR are used as follows: „°L MODES ANGLE RECT ( °is the leftshift of the Nkey). • (xmin , ymin ) is a complex number specifying the lower left corner of PICT (the lower left corner of the display range). The default value is (–6.5,–3.1) for the HP 48gII and (–6.5,–3.9) for the Input/Output: None HP 50g and 49g+. See also: CYLIN, SPHERE

• (xmax , ymax ) is a complex number specifying the upper right corner of PICT (the upper right RECV corner of the display range). The default value is (6.5,3.2) for the HP 48gII and (6.5,4.0) for the Type: Command HP 50g and 49g+. Description: Receive Object Command: Instructs the calculator to look for a named file from another Kermit • indep is a name specifying the independent variable, or a list containing such a name and two server device. The received file is stored in a variable named by the sender. numbers specifying the minimum and maximum values for the independent variable (the Since the calculator does not normally look for incoming Kermit files, you must use RECV to tell plotting range). The default value of indep is X. it to do so. Access: … RECV

3172 Full Command and Function Reference Full Command and Function Reference 3197

POS Executing RCLMENU when the current menu is a userdefined menu (build by TMENU) Type: Command returns 0.01 (in 2 Fix mode), indicating “Last menu”. Description: Position Command: Returns the position of a substring within a string or the position of an Access: „&HMENU RCLMENU object within a list. „°LMODES MENU RCLMENU ( °is the leftshift of the Nkey). If there is no match for obj or substring , POS returns zero. Input/Output: Access: !°LCHARS POS ( °is the leftshift of the Nkey). Level 1/Argument 1 Level 1/Item 1 !° ° N LIST ELEM POS ( is the leftshift of the key). → xmenu @& N POS Example: If the third page of the PRG STACK menu is currently active, RCLMENU returns 73.03. Input/Output: See also: MENU, TMENU

Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 RCLVX → “string” “substring” n Type: Command → { list } obj n Description: Returns the name or list of names stored in the current CAS variable. This is the same action as See also: CHR, NUM, REPL, SIZE, SUB recalling the contents of the variable VX in the CASDIR directory.

POTENTIAL Access: Catalog, … Type: Command Input: None. Description: Find the potential field function describing a field whose vector gradient is input. This command Output: Level 1/Item 1: The name of the current CAS variable. V U U is the opposite of DERIV. Given a vector it attempts to return a function such that grad See also: STOVX is equal to V; ∇U = V . For this to be possible, CURL( V) must be zero, otherwise the command reports a “Bad Argument Value” error. Stepbystep mode is available with this command. RCLΣ Access: Catalog, … Type: Command Input: Level 2/Argument 1: A vector V of expressions. Description: Recall Sigma Command: Returns the current statistical matrix (the contents of reserved variable Level 1/Argument 2: A vector of the names of the variables. ΣDAT ) from the current directory. Output: Level 1/Item 1: A function U of the variables that is the potential from which V is derived. An To recall ΣDAT from the parent directory (when ΣDAT doesn’t exist in the current directory), arbitrary constant can be added, the command does not do this. evaluate the name ΣDAT . Flags: Exact mode must be set (flag –105 clear). Access: … RCLΣ (or …ΣDAT after pressing J) Numeric mode must not be set (flag –3 clear). Input/Output: Radians mode must be set (flag –17 set). Level 1/Argument 1 Level 1/Item 1 Stepbystep mode can be set (flag –100 set). → obj Example: To confirm that this command is the opposite of DERIV, use the output of the example in See also: CLΣ, STOΣ, Σ+, Σ– DERIV, and show that the result is the same as the input given in the DERIV example. Find the function of the spatial variables x, y, and z whose gradient is: RCWS (4 xy +z)i + (2 x2 + 6yz )j + ( x+3 y2)k Type: Command Command: POTENTIAL([4*X*Y+Z, 2*X^2+6*Y*Z, X+3*Y^2], [X,Y,Z]) Description: Recall Wordsize Command: Returns the current wordsize in bits (1 through 64). EXPAND(ANS(1)) Access: …ãL RCWS (ã is the rightshift of the 3key). Result: 2*Y*X^2+Z*X+3*Z*Y^2 Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) See also: DERIV, VPOTENTIAL Input/Output:

POWEXPAND Level 1/Argument 1 Level 1/Item 1 Type: Function → n See also: BIN, DEC, HEX, OCT, STWS

Description: Rewrites an expression raised to a power as a product. If followed by repeated execution of DISTRIB allows an expression to be expanded fully, step by step. RDM Access: !Ú REWRITE L Type: Command Description: Redimension Array Command: Rearranges the elements of the argument according to specified Input: An expression raised to a power. dimensions.

3174 Full Command and Function Reference Full Command and Function Reference 3195

Access: … PR 1 by a constant xfactor , adds this product to element j of the vector, and returns the modified vector. Flags: I/O Device (–33), Printing Device (–34), Doublespaced Printing (–37), Linefeed (–38), I/O RCIJ rounds the row numbers to the nearest integer, and treats vector arguments as column Device for Wire (–78). If flag –34 is set, flag –33 must be clear. vectors. Input/Output: Access: !Ø CREATE ROW RCIJ ( Ø is the leftshift of the 5key). Level 1/Argument 1 Level 1/Item 1 !´ MATRIX ROW RCIJ ( ´ is the leftshift of the Pkey). object → object Input/Output: See also: CR, DELAY, OLDPRT, PRLCD, PRST, PRSTC, PRVAR Level 4/Argument 1 Level 3/Argument 2 Level 2/Argument 3 Level 1/Argument 4 Level 1/Item 1

row i nrow j PREDV [[ matrix ]] 1 xfactor n → [[ matrix ]] 2

nelement i Type: Command [ vector ]1 xfactor nelement j → [ vector ]2 Description: Predicted yValue Command: Returns the predicted dependentvariable value ydependent , based on See also: RCI the independentvariable value xindependent , the currently selected statistical model, and the current regression coefficients in the reserved variable ΣPAR . RCL PREDV is the same as PREDY. See PREDY. Type: Command Operation Description: Recall Command: Returns the unevaluated contents of a specified variable. Access: … PREDV Input/Output: RCL searches the entire current path, starting with the current directory. To search a different path, specify { path name }, where path is the new path to the variable name . The path subdirectory Level 1/Argument 1 Level 1/Item 1 does not become the current subdirectory (unlike EVAL). xindependent → ydependent To recall a library or backup object, tag the library number or backup name with the appropriate See also: PREDY port number ( nport ), which must be an integer in the range 0 to 3. Recalling a backup object brings a copy of its contents to the stack, not the entire backup object. PREDX To search for a backup object, replace the port number with the wildcard character &, in which Type: Command case the calculator will search (in order) ports 0 through 3, and the main memory for the named Description: Predicted xValue Command: Returns the predicted independentvariable value xindependent , based backup object. on the dependentvariable value ydependent , the currently selected statistical model, and the current You can specify a port (that is, nport) in one of two ways: regression coefficients in the reserved variable ΣPAR . • H, 0, 1, 2, or 3 The value is predicted using the regression coefficients most recently computed with LR and • H, R, E, F, or SD stored in the reserved variable ΣPAR . For the linear statistical model, the equation used is this: In each case, the ports are home, RAM, extended RAM, flash memory, and the plugin SD card ydependent = ( mx independent ) + b slot, respectively. where m is the slope (the third element in ΣPAR ) and b is the intercept (the fourth element in Access: !© ( ©is the leftshift of the Kkey). ΣPAR ). Input/Output: For the other statistical models, the equations used by PREDX are listed in the LR entry. If PREDX is executed without having previously generated regression coefficients in ΣPAR , a Level 1/Argument 1 Level 1/Item 1 default value of zero is used for both regression coefficients, and an error results. 'obj ' → obj Access: … PREDX PICT → grob Input/Output:

Level 1/Argument 1 Level 1/Item 1 :nport :nlibrary → obj

:nport :name backup → obj ydependent → xindependent

Example: Given five columns of data in ΣDAT , the command sequence: :nport :{ path } → obj 2 XCOL 5 YCOL LOGFIT LR 23 PREDX See also: STO sets column 2 as the independent variable column, sets column 5 as the dependent variable column, and sets the logarithmic statistical model. It then executes LR, generating intercept and RCLALARM slope regression coefficients, and storing them in ΣPAR . Then, given a dependent value of 23, it Type: Command returns a predicted independent value based on the regression coefficients and the statistical Description: Recall Alarm Command: Recalls a specified alarm.

model. obj action is the alarm execution action. If an execution action was not specified, obj action defaults to See also: COLΣ, CORR, COV, EXPFIT, ΣLINE, LINFIT, LOGFIT, LR, PREDY, PWRFIT, XCOL, an empty string. YCOL xrepeat is the repeat interval in clock ticks, where 1 clock tick equals 1/8192 second. If a repeat

interval was not specified, the default is 0.

3176 Full Command and Function Reference Full Command and Function Reference 3193

Result: 135/4 Rank is computed by calculating the singular values of the matrix and counting the number of nonnegligible values. If all computed singular values are zero, RANK returns zero. Otherwise PREVPRIME RANK consults flag –54 as follows: Type: Function • If flag –54 is clear (the default), RANK counts all computed singular values that are less than or Description: Given an integer, finds the closest prime number smaller than the integer. Like ISPRIME?, it uses equal to 1.E–14 times the largest computed singular value. a pseudoprime check for large numbers. • If flag –54 is set, RANK counts all nonzero computed singular values. Access: !Ø OPERATIONS L RANK ( Ø is the leftshift of the 5key). Access: Arithmetic, !Þ INTEGER L !´ MATRIX NORMALIZE L RANK ( ´ is the leftshift of the Pkey). Input: An integer or an expression that evaluates to an integer. Flags: Singular Value (–54) Output: The closest prime number smaller than the integer. Input/Output: Example: Find the closest, smaller prime number to 145. Level 1/Argument 1 Level 1/Item 1 Command: PREVPRIME(145) [[ matrix ]] → Nrank Result: 139 See also: LQ, LSQ, QR See also: ISPRIME?, NEXTPRIME RANM PRLCD Type: Command Type: Command Description: Random Matrix Command: Returns a matrix of specified dimensions that contains random Description: Print LCD Command: Prints a pixelbypixel image of the current display (excluding the integers in the range –9 through 9. annunciators). The probability of a particular nonzero digit occurring is 0.05; the probability of 0 occurring is 0.1. The width of the printed image of characters in the display is narrower using PRLCD than using a Access: !Ø CREATE LLRANM ( Ø is the leftshift of the 5key). print command such as PR1. The difference results from the spacing between characters. On the !´ ´ P display there is a single blank column between characters, and PRLCD prints this spacing. Print MATRIX MAKE RANM ( is the leftshift of the key). commands such as PR1 print two blank columns between adjacent characters. Input/Output: Level 1/Argument 1 Level 1/Item 1 Access: … PRLCD

Flags: I/O Device (–33), Printing Device (–34), Doublespaced Printing (–37), Linefeed (–38). Flag –38 { m n } → [[ random matrix ]] m×n

must be clear, I/O Device for Wire (–78). If flag –34 is set, flag –33 must be clear. [[ matrix ]] m×n → [[ random matrix ]] m×n Input/Output: None See also: RAND, RDZ Example: The command sequence ERASE DRAW PRLCD clears PICT , plots the current equation, then prints the graphics display. RATIO Type: Function See also: CR, DELAY, OLDPRT, PRST, PRSTC, PRVAR, PR1 Description: Prefix Divide Function: Prefix form of / (divide).

PROMPT RATIO is identical to / (divide), except that, in algebraic syntax, RATIO is a prefix function, while Type: Command / is an infix function. For example, RATIO(A,2) is equivalent to A/2. Description: Prompt Command: Displays the contents of “ prompt ” in the status area, and halts program Access: … RATIO execution. PROMPT is equivalent to 1 DISP 1 FREEZE HALT. Access: !°LIN LPROMPT ( °is the leftshift of the Nkey). Input/Output: Level 1/Argument 1 Level 1/Item 1

“prompt” → See also: CONT, DISP, FREEZE, HALT, INFORM, INPUT, MSGBOX

PROMPTSTO Type: Command Description: Prompt Command: Creates a variable with the name supplied as an argument, prompts for a value, and stores the value you enter in the variable. Access: …PROMPTSTO

3178 Full Command and Function Reference Full Command and Function Reference 3191

PRST Input/Output: Type: Command Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Description: Print Stack Command: Prints all objects in the stack, starting with the object on the highest level. 1 → 2 Objects are printed in multiline printer format. See the PR1 entry for a description of multiline 'symb ' 'global ' 'symb ' printer format. See also: COLCT, EXPAN, ISOL, SHOW, SOLVE

Access: … PRST QUOT Flags: I/O Device (–33), Printing Device (–34), Doublespaced Printing (–37), Linefeed (–38), I/O Type: Function Device for Wire (–78). If flag –34 is set, flag –33 must be clear. Generally, flag –38 should be clear. Description: Returns the quotient part of the Euclidean division of two polynomials. Input/Output: None Access: Arithmetic, !Þ POLYNOMIAL !« See also: CR, DELAY, OLDPRT, PRLCD, PRSTC, PRVAR, PR1 Input: Level 2/Argument 1: The numerator polynomial.

PRSTC Level 1/Argument 2: The denominator polynomial. Type: Command Output: The quotient of the Euclidean division. Description: Print Stack (Compact) Command: Prints in compact form all objects in the stack, starting with the Flags: Exact mode must be set (flag –105 clear). object on the highest level. Numeric mode must not be set (flag –3 clear). If flag –34 is set (printer output directed to the serial port), flag –33 must be clear. Radians mode must be set (flag –17 set). When flag –38 is set, linefeeds are not added at the end of each print line. Generally, flag –38 x3 +6x2 +11x + 6 x2 +5x + 6 should be clear for execution of PRSTC. Example: Find the quotient of the division of by . Compact printer format is the same as compact display format. Multiline objects are truncated Command: QUOT(X^3+6*X^2+11*X+6, X^2+5*X+6) and appear on one line only. Result: X+1 Access: … PRSTC See also: REMAINDER, DIV2, IQUOT

Flags: I/O Device (–33), Printing Device (–34), Doublespaced Printing (–37), Linefeed (–38), I/O QUOTE Device for Wire (–78) Type: Function Input/Output: None Description: Quote Argument Function: Returns its argument unevaluated. See also: CR, DELAY, OLDPRT, PRLCD, PRST, PRVAR, PR1 When an algebraic expression is evaluated, the arguments to a function in the expression are

PRVAR evaluated before the function. For example, when SIN(X) is evaluated, the name X is evaluated Type: Command first, and the result is placed on the stack as the argument for SIN. This process creates a problem for functions that require symbolic arguments. For example, the Description: Print Variable Command: Searches the current directory path or port for the specified variables integration function requires as one of its arguments a name specifying the variable of integration. and prints the name and contents of each variable. If evaluating an integral expression caused the name to be evaluated, the result of evaluation Objects are printed in multiline printer format. See the PR1 entry for a description of multiline would be left on the stack for the integral, rather than the name itself. To avoid this problem, the printer format. calculator automatically (and invisibly) quotes such arguments. When the quoted argument is If flag –34 is set (printer output directed to the serial port), flag –33 must be clear. evaluated, the unquoted argument is returned. When flag –38 is set, linefeeds are not added at the end of each print line. Generally, flag –38 If a userdefined function takes symbolic arguments, quote the arguments using QUOTE. should be clear for execution of PRVAR. Access: …QUOTE Input/Output: Access: … PRVAR Flags: I/O Device (–33), Printing Device (–34), Doublespaced Printing (–37), Linefeed (–38), I/O Level 1/Argument 1 Level 1/Item 1 Device for Wire (–78). If flag –34 is set, flag –33 must be clear. Generally, flag –38 should be obj → obj clear. Input/Output: Example: The following userdefined function ArcLen calculates the arc length of a function: « → start end expr var Level 1/Argument 1 Level 1/Item 1 « start end expr var ˆ SQ 1 + ƒ var » 'name ' → » { name 1 name 2 ... } → `OArcLen K

:n port : 'global ' → To use this userdefined function in an algebraic expression, the symbolic arguments must be See also: CR, DELAY, OLDPRT, PR1, PRLCD, PRST, PRSTC quoted: 'ArcLen(0,π,QUOTE(SIN(X)),QUOTE(X))' See also: APPLY, | (Where)

3180 Full Command and Function Reference Full Command and Function Reference 3189

PTAYL PX →C Type: Function Type: Command Description: Pixel to Complex Command: Converts the specified pixel coordinates to userunit coordinates. Description: Returns the Taylor polynomial at x = a for a specified polynomial. The userunit coordinates are derived from the ( xmin , ymin ) and ( xmax , ymax ) parameters in the Access: Arithmetic, !Þ POLYNOMIAL LL reserved variable PPAR . The coordinates correspond to the geometrical center of the pixel. Input: Level 2/Argument 1: A polynomial, P. Access: !°LPICT LPX →C ( °is the leftshift of the Nkey). Level 1/Argument 2: A number, a. Input/Output: Output: A polynomial, Q such that Q( x – a)=P( x). Level 1/Argument 1 Level 1/Item 1 Flags: Exact mode must be set (flag –105 clear). { #n #m } → (x,y) Numeric mode must not be set (flag –3 clear). Radians mode must be set (flag –17 set). See also: C→PX

Example: Find the polynomial Q( x) such that →Q Q( x2)= x2+3 x+2. Type: Command Command: PTAYL(X^2+3*X+2, 2) Description: To Quotient Command: Returns a rational form of the argument. Result: X^2+7*X+12 The rational result is a “best guess”, since there might be more than one rational expression consistent with the argument. →Q finds a quotient of integers that agrees with the argument to PTPROP within the number of decimal places specified by the display format mode. Type: Function →Q also acts on numbers that are part of algebraic expressions or equations. Description: Returns the specified property for the specified element. It takes the element’s atomic number or symbol as a name (with certain restrictions) and the property number. It returns the property, Access: „Ú REWRITE L→Q (Ú is the leftshift of the 6key). usually a value or a string. It chooses to use or not use units according to the Units Usage flag Flags: Number Display Format (–45 to –50) (flag 61: SI units if clear, no units if set). If you use PTPROP as an algebraic function, you must Input/Output : use the symbol to define the element — you can’t use its atomic number. Level 1/Argument 1 Level 1/Item 1 See Appendix B for a full list of available properties. x → 'a/b' G Access: PERIODIC TABLE PTPROP (x,y ) → 'a/b + c /d*i' Flags: Units Usage (61)

Input/Output : 'symb 1' → 'symb 2' Example: 'Y+2.5' →Q returns 'Y+5/2' Level 2 Level 1 Level 1 See also: →Qπ, /, XQ 'symb ' x → “string ” or x or x_unit or ' name ' y x → “string ” or x or x_unit or ' name ' →Qπ Type: Command Example 1: The command sequence 'Hg' 6 PTPROP returns "[Xe]4f145d106s2" . Description: To Quotient Times π Command: Returns a rational form of the argument, or a rational form of 79 8 PTPROP 1337.58 Example 2: The command sequence returns when flag 61 is set. the argument with π, square roots, natural logs, and exponentials factored out, whichever yields See also: MOLWT, PERINFO, PERTBL the smaller denominator.

PURGE The rational result is a “best guess”, since there might be more than one rational expression Type: Command consistent with the argument. →Qπ finds a quotient of integers that agrees with the argument to Description: Purge Command: Purges the named variables or empty subdirectories from the current directory. the number of decimal places specified by the display format mode. →Qπ also acts on numbers that are part of algebraic expressions or equations. PURGE executed in a program does not save its argument for recovery by LASTARG. For a complex argument, the real or imaginary part (or both) can have π as a factor. To empty a named directory before purging it, use PGDIR. Access: „Ú REWRITE L →Qπ (Ú is the leftshift of the 6key). To help prepare a list of variables for purging, use VARS. Flags: Number Display Format (–45 to –50) Purging PICT replaces the current graphics object with a 0 × 0 graphics object. If a list of objects (with global names, backup objects, library objects, or PICT ) for purging contains an invalid object, then the objects preceding the invalid object are purged, and the error Bad Argument Type occurs. To purge a library or backup object, tag the library number or backup name with the appropriate port number (: nport ), which must be in the range from 0 to 3. For a backup object, the port

3182 Full Command and Function Reference Full Command and Function Reference 3187

Input/Output: Input/Output: Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 L3/A 1 L2/A 2 L1/A 3 L2/I 1 L1/I 2

[[ matrix ]] 1 nposition zput → [[ matrix ]] 2 [[ matrix ]] 1 nposition1 zput → [[ matrix ]] 2 nposition2

[[ matrix ]] 1 { n row m col } zput → [[ matrix ]] 2 [[ matrix ]] 1 { n row m col } 1 zput → [[ matrix ]] 2 { n row m col } 2

'name matrix ' nposition zput → 'name matrix ' nposition1 zput → 'name matrix ' nposition2

'name matrix ' { n row m col } zput → 'name matrix ' { n row m col } 1 zput → 'name matrix ' { n row m col } 2

[ vector ] 1 nposition zput → [ vector ] 2 [ vector ] 1 nposition1 zput → [ vector ] 2 nposition2

[ vector ] 1 { n position } zput → [ vector ] 2 [ vector ] 1 { n position1 } zput → [ vector ] 2 { n position2 }

'name vector ' nposition zput → 'name vector ' nposition1 zput → 'name vector ' nposition2

'name vector ' { n position } zput → 'name vector ' { n position1 } zput → 'name vector ' { n position2 }

{ list }1 nposition obj put → { list } 2 { list } 1 nposition1 obj put → { list } 2 nposition2

{ list } 1 { n position } obj put → { list } 2 { list } 1 { n position1 } obj put → { list } 2 { n position2 }

'name list ' nposition obj put → 'name list ' nposition1 obj put → 'name list ' nposition2

'name list ' { n position } obj put → 'name list ' { n position1 } obj put → 'name list ' { n position2 } Example 1: This command sequence: L = Level; A = Argument; I = item [[ 2 3 4 ][ 4 1 2 ]] { 1 3 } 96 PUT returns [[ 2 3 96 ][ 4 1 2 ]] . Example: The following program uses PUTI and flag –64 to replace A, B, and C in the list with X. « { A B C } DO 'X' PUTI UNTIL 64 FS? END » Example 2: The command sequence: [[ 2 3 4 ][ 4 1 2 ]] 5 96 PUT returns [[ 2 3 4 ][ 4 96 2 ]] . See also: GET, GETI, PUT

Example 3: The command sequence: PVAR { A B C D E } { 3 } 'Z' PUT returns { A B Z D E } . Type: Command See also: GET, GETI, PUTI Description: Population Variance Command: Calculates the population variance of the coordinate values in each of the m columns in the current statistics matrix ( ΣDAT ). PUTI Type: Command The population variance (equal to the square of the population standard deviation) is returned as a vector of m real numbers, or as a single real number if m = 1. The population variances are Description: Put and Increment Index Command: Replaces the object at a specified position (second input) in computed using this formula: a specified array or list (first input) with a specified object (third input), returning a new array or n list together with the next position in the array or list. 1 2 --- ∑ ()xk – x For matrices, the position is incremented in row order. nk = 1 Unlike PUT, PUTI returns a named array or list. This enables a subsequent execution of PUTI at x the next position of a named array or list. where xk is the kth coordinate value in a column, is the mean of the data in this column, and n is Access: !°LIST ELEMENTS PUTI ( °is the leftshift of the Nkey). the number of data points. Flags: Index Wrap Indicator (–64) Access: … PVAR Input/Output: Level 1/Argument 1 Level 1/Item 1

→ xpvariance

→ [ x pvariance1 , ...,xpvariancem ] See also: MEAN, PCOV, PSDEV, SDEV, VAR

PVARS Type: Command

Description: PortVariables Command: Returns a list of the backup objects (: nport :name ) and the library objects (: nport :nlibrary ) in the specified port. Also returns the available memory size (RAM).

The port number, nport , must be in the range from 0 to 2.

3184 Full Command and Function Reference Full Command and Function Reference 3185

Flags: Exact mode must be set (flag –105 clear). Input/Output: Numeric mode must not be set (flag –3 clear). Level 1/Argument 1 Level 1/Item 1 Complex mode must be set (flag –103 set) if either input contains complex terms. { list } 1 → { list } 2 Example: Obtain the resultant of the two polynomials See also: REVLIST 3 2 x px+q and 3 x p. Command: RESULTANT(X^3P*X+Q, 3*X^2P) SPHERE Result: 27*Q^24*P^3 Type: Command Description: Spherical Mode Command: Sets spherical coordinate mode. REVLIST SPHERE sets flags –15 and –16. Type: Command In spherical mode, vectors are displayed as polar components. Description: Reverse List Command: Reverses the order of the elements in a list. Access: „&H ANGLE SPHERE Access: !°LIST PROCEDURES REVLIST ( °is the leftshift of the Nkey). Input/Output: None Input/Output: See also: CYLIN, RECT

Level 1/Argument 1 Level 1/Item 1 SQ

{ obj n ... obj 1 } → { obj 1 ... obj n } Type: Analytic function See also: SORT Description: Square Analytic Function: Returns the square of the argument. 2 2 REWRITE The square of a complex argument ( x, y) is the complex number ( x – y , 2 xy ). Matrix arguments must be square. Type: Command Access: !º ( º is the leftshift of the Rkey). Description: Displays a menu or list of CAS operations that rewrite expressions. Flags: Numerical Results (–3) Access: Catalog, … Input/Output: Flags: If the CHOOSE boxes flag is clear (flag –117 clear), displays the operations as a numbered list. If Level 1/Argument 1 Level 1/Item 1 the flag is set, displays the operations as a menu of function keys. z → z2 See also: ALGB, ARIT, CONSTANTS, DIFF, EXP&LN, INTEGER, MAIN, MATHS, MATR, x_unit → x2_unit 2 MODULAR, POLYNOMIAL, TESTS, TRIGO [[ matrix ]] → [[ matrix × matrix ]] RISCH 'symb ' → 'SQ( symb )' Type: Function See also: √, ^ Description: Performs symbolic integration on a function using the Risch algorithm. RISCH is similar to the INTVX command, except that it allows you to specify the variable of integration. SR Type: Command Access: Calculus !Ö DERIV . & INTEG L. Description: Shift Right Command: Shifts a binary integer one bit to the right. Input: Level 2/Argument 1: The function to integrate. Level 1/Argument 2: The variable of integration. The least significant bit is shifted out to the right and lost, while the most significant bit is Output: The antiderivative of the function with respect to the variable. regenerated as a zero. SR is equivalent to binary division by 2. Flags: Exact mode must be set (flag –105 clear). Access: !´ BASE L BIT SR ( ´ is the leftshift of the Pkey). Numeric mode must not be set (flag –3 clear). …ã L BIT SR (ã is the rightshift of the 3key). Radians mode must be set (flag –17 set). Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) Example: Find the antiderivative of the following function, with respect to y: Input/Output: 2 y +3y + 2 Level 1/Argument 1 Level 1/Item 1 Command: RISCH(Y^23*Y+2,Y) #n 1 → #n 2 Result: 1/3*Y^33*(1/2*Y^2)+2*Y See also: ASR, SL, SLB, SRB See also: IBP, INT, INTVX SRAD Type: Command Description: Spectral Radius Command: Returns the spectral radius of a square matrix.

3202 Full Command and Function Reference Full Command and Function Reference 3231

• error displays the absolute error for that step. A zero error indicates that the Runge–Kutta– Input/Output: Fehlberg method failed and that Euler’s method was used instead. Level 1/Argument 1 Level 1/Item 1 The absolute error is the absolute value of the estimated error for a scalar problem, and the row [ array ] → xspectralnorm (infinity) norm of the estimated error vector for a vector problem. (The latter is a bound on the maximum error of any component of the solution.) See also: ABS, CNRM, COND, RNRM, SRAD, TRACE

Access: … RKFE SOLVE Input/Output: Type: Command

L2/A 1 L1/A 2 L4/I 1 L3/I 2 L2/I 3 L1/I 4 Description: Finds zeros of an expression equated to 0, or solves an equation.

{ list } h → { list } h ydelta error Access: Symbolic solve, !Î, P SOLVE , …×L L = Level; A = Argument; I = item Input: Level 2/Argument 1: The expression or equation. A list of equations and expressions can be See also: RKF, RKFSTEP, RRK, RRKSTEP, RSBERR given too, each will be solved for the same variable. Level 1/Argument 2: The variable to solve for. RKFSTEP Type: Command Output: A zero or solution, or a list of zeros or solutions.

Description: Next Solution Step for RKF Command: Computes the next solution step ( hnext ) to an initial value Flags: Radians mode must be set (flag –17 set). problem for a differential equation. If exact mode is set (flag –105 clear) and there are no exact solutions, the command returns a null The arguments and results are as follows: list even when there are approximate solutions. Radians mode must be set (flag –17 set). • { list } contains three items in this order: the independent ( t) and solution ( y) variables, and the If complex mode is set (flag –103 set) then SOLVE will search for complex roots as well as real righthand side of the differential equation (or a variable where the expression is stored). ones. Complex roots are displayed according to the coordinate system selected. • xtol sets the tolerance value. • h specifies the initial candidate step. Example 1: Find the zeros of the following expression: 3 • hnext is the next candidate step. x –x – 9 The independent and solution variables must have values stored in them. RKFSTEP steps these Command: SOLVE(X^3X9,X) variables to the next point upon completion. Result: X=2.24004098747 Note that the actual step used by RKFSTEP will be less than the input value h if the global error Example 2: Find the real and complex roots of the two equations: tolerance is not satisfied by that value. If a stringent global error tolerance forces RKFSTEP to 4 1 , 2 A reduce its stepsize to the point that the Runge–Kutta–Fehlberg methods fails, then RKFSTEP x – = 3 x – = 0 will use the Euler method to compute the next solution step and will consider the error tolerance Command: Clear numeric mode, clear approximate mode, set complex mode, set rectangular mode, enter: satisfied. The RungeKuttaFehlberg method will fail if the current independent variable is zero SOLVE({X^41=3,X^2A=0},X) and the stepsize ≤ 1.3 × 10 498 or if the variable is nonzero and the stepsize is 1.3 × 10 10 times its Result: {{X= √2×i,X= √2×1,X=(√2×i),X= √2}, magnitude. {X= √A×1,X= √A}} Note that in this case, imaginary solutions for X are returned, even if X is in . Access: … RKFS REALASSUME Input/Output: See also: DESOLVE, LDEC, LINSOLVE, MSLV, QUAD, SOLVEVX

L3/A 1 L2/A n L1/A n+1 L3/I 1 L2/I 2 L1/I 3 SOLVEQN { list } xtol h → { list } xtol hnext Type: Command L = Level; A = Argument; I = item Description: Starts the appropriate solver for a specified set of equations. See also: RKF, RKFERR, RRK, RRKSTEP, RSBERR SOLVEQN sets up and starts the appropriate solver for the specified set of equations, bypassing the Equation Library catalogs. It sets EQ (and Mpar if more than one equation is being solved), RL sets the unit options according to flags 60 and 61, and starts the appropriate solver. Type: Command SOLVEQN uses subject and title numbers (levels 3 and 2) and a “PICT” option (level 1) and Description: Rotate Left Command: Rotates a binary integer one bit to the left. returns nothing. Subject and title numbers are listed in chapter 5. For example, a 2 in level 3 and a

The leftmost bit of # n1 becomes the rightmost bit of # n2. 9 in level 2 would specify the Electricity category and Capacitive Energy set of equations. If the “PICT” option is 0, PICT is not affected; otherwise, the equation picture (if any) is copied into Access: … ãBIT RL (ã is the rightshift of the 3key). PICT . Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) Access: … SOLVEQN Flags: Unit Type (60), Units Usage (61) Flags: Units Type (60), Units Usage (61)

3204 Full Command and Function Reference Full Command and Function Reference 3229

See also: TRNC Input/Output:

RNRM Level 1/Argument 1 Level 2/Item 1 Level 1/Item 2 Type: Command “string ” → n Description: Row Norm Command: Returns the row norm (infinity norm) of its argument array. integer → n The row norm is the maximum (over all rows) of the sums of the absolute values of all elements in each row. For a vector, the row norm is the largest absolute value of any of its elements. { list } → n

Access: !Ø OPERATIONS LRNRM ( Ø is the leftshift of the 5key). [ vector ] → { n } !´ MATRIX NORMALIZE RNRM ( ´ is the leftshift of the Pkey). [[ matrix ]] → { n m } Input/Output: 'symb ' → n

Level 1/Argument 1 Level 1/Item 1 grob → #n width #m height

→ width height [ array ] → xrow norm PICT #n #m See also: CNRM, CROSS, DET, DOT x_unit → n See also: CHR, NUM, POS, REPL, SUB

ROLL Type: RPL command SL Description: Roll Objects Command: Moves the contents of a specified level to level 1, and rolls upwards the Type: Command portion of the stack beneath the specified level. Description: Shift Left Command: Shift a binary integer one bit to the left. In RPN mode, 3 ROLL is equivalent to ROT. The most significant bit is shifted out to the left and lost, while the least significant bit is regenerated as a zero. SL is equivalent to binary multiplication by 2, truncated to the current !° L ° N Access: STACK ROLL ( is the leftshift of the key). wordsize. Input/Output: Access: !´ BASE LBIT SL ( ´ is the leftshift of the Pkey).

Ln+1 ... L 2 L1 Ln ... L2 L1 …ãL BIT SL (ã is the rightshift of the 3key). Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) obj n ... obj 1 n → obj n–1 ... obj 1 obj n L = Level Input/Output: Level 1/Argument 1 Level 1/Item 1 See also: OVER, PICK, ROLLD, ROT, SWAP #n 1 → #n 2 ROLLD See also: ASR, SLB, SR, SRB Type: RPL command Description: Roll Down Command: Moves the contents of level 2 to a specified level, n, and rolls downward SLB the portion of the stack beneath the specified level. Type: Command Description: Shift Left Byte Command: Shifts a binary integer one byte to the left. Access: !°STACK LROLLD ( °is the leftshift of the Nkey). The most significant byte is shifted out to the left and lost, while the least significant byte is Input/Output: regenerated as zero. SLB is equivalent to binary multiplication by 2 8 (256) (or executing SL eight times), truncated to the current wordsize. Ln+1 ... L 2 L1 Ln Ln–1 ... L1 Access: !´ BASE LBYTE SLB ( ´ is the leftshift of the Pkey).

obj n ... obj 2 n (obj 1) → obj 1 obj n ... obj 2 …ãL BYTE SLB (ã is the rightshift of the 3key). L = Level Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) See also: OVER, PICK, ROLL, ROT, SWAP Input/Output:

ROMUPLOAD Level 1/Argument 1 Level 1/Item 1 Type: Command #n 1 → #n 2 Description: This command remains from earlier HP graphing calculators and should not be used. It was used See also: ASR, SL, SR, SRB to transfer the ROM from one HP 49G to another. SLOPEFIELD Access: … ROMUPLOAD Type: Command

Description: SLOPEFIELD Plot Type Command: Sets the plot type to SLOPEFIELD.

3206 Full Command and Function Reference Full Command and Function Reference 3227

ROW+ See also: EGCD

Type: Command SIMPLIFY Description: Insert Row Command: Inserts an array into a matrix (or one or more numbers into a vector) at Type: Command the position indicated by nindex , and returns the modified matrix (or vector). The inserted array must have the same number of columns as the target array. Description: Simplifies an expression.

nindex is rounded to the nearest integer. The original array is redimensioned to include the new Access: !Ú REWRITE L columns or elements, and the elements at and below the insertion point are shifted down. Input: An expression Access: !Ø CRREATE ROW ROW + ( Ø is the leftshift of the 5key). Output: An equivalent simplified expression. SIMPLIFY follows an extensive builtin set of rules, but !´ MATRIX ROW ROW + ( ´ is the leftshift of the Pkey). these might not give exactly the simplification the user expects. Input/Output: Flags: Exact mode must be set (flag –105 clear). Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 Numeric mode must not be set (flag –3 clear). SI(3 ⋅ X) + SI(7 ⋅ X) ------[[ matrix ]] 1 [[ matrix ]] 2 nindex → [[ matrix ]] 3 Example: Simplify SI()5 ⋅ X

[[ matrix ]] 1 [ vector ]row nindex → [[ matrix ]] 2 Command: SIMPLIFY((SIN(3*X)+SIN(7*X))/SIN(5*X))

[ vector ]1 nelement nindex → [ vector ]2 Result: 4*COS(X)^2 2 See also: COL–, COL+, ROW–, RSWP See also: COLLECT, EXPAND

ROW→ SIN Type: Command Type: Analytic function Description: Rows to Matrix Command: Transforms a series of row vectors and a row count into a matrix Description: Sine Analytic Function: Returns the sine of the argument. containing those rows, or transforms a sequence of numbers and an element count into a vector For real arguments, the current angle mode determines the number’s units, unless angular units with those numbers as elements. are specified. For complex arguments, sin( x + iy ) = sin x cosh y + i cos x sinh y. Access: !Ø CREATE ROW ROW → ( Ø is the leftshift of the 5key). If the argument for SIN is a unit object, then the specified angular unit overrides the angle mode !´ MATRIX ROW ROW → ( ´ is the leftshift of the Pkey). to determine the result. Integration and differentiation, on the other hand, always observe the Input/Output: angle mode. Therefore, to correctly integrate or differentiate expressions containing SIN with a unit object, the angle mode must be set to radians (since this is a “neutral” mode). Ln+1 /A 1 L2/A n L1/A n+1 Level 1/Item 1 Access: S [ vector ]row 1 [ vector ]row n nrow count → [[ matrix ]] Flags: Numerical Results (–3), Angle Mode (–17, –18) element 1 element n nelement count → [ vector ]column Input/Output: L = Level; A = Argument; I = item Level 1/Argument 1 Level 1/Item 1 See also: →COL, COL→, →ROW → z sin z

→ROW x_unit angular → sin( x_unit angular ) Type: Command 'symb ' → 'SIN( symb )' Description: Matrix to Rows Command: Transforms a matrix into a series of row vectors, returning the See also: ASIN, COS, TAN vectors and row count, or transforms a vector into its elements, returning the elements and element count. SINCOS Access: !Ø CREATE ROW →ROW ( Ø is the leftshift of the 5key). Type: Command !´ MATRIX ROW →ROW ( ´ is the leftshift of the Pkey). Description: Converts complex logarithmic and exponential expressions to expressions with trigonometric Input/Output : terms.

L1/Argument 1 Ln+1 /I 1 L 2/I n L1/I n+1 Access: Trigonometry, …ÑL, PLEXPLN

[[ matrix ]] → [ vector ] row n … [ vector ] row n nrowcount Input: An expression with complex linear and exponential terms. Output: The expression with logarithmic and exponential subexpressions converted to trigonometric and [ vector ] → element 1 … element n nelementcount L =Level; A = Argument; I = Item inverse trigonometric expressions. See also: →COL, COL→, ROW→ Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear).

3208 Full Command and Function Reference Full Command and Function Reference 3225

rref G( x + 1) – G( x) = f(x) where x is the specified variable. Type: Command !Ö L Description: Reduces a matrix to rowreduced echelon form, and provides a list of pivot points. Access: DERIV Input: Level 2/Argument 1: A function Access: PSOLVE , Matrices, !Ø LINEAR SYSTEMS Level 1/Argument 2: The variable to calculate the antiderivative with respect to. Input: A matrix. Output: The discrete antiderivative of the function. Output: Level 2/Item 1: The pivot points. Flags: Exact mode must be set (flag –105 clear). Level 1/Item 2: An equivalent matrix in row reduced echelon form. Numeric mode must not be set (flag –3 clear). Flags: Exact mode must be set (flag –105 clear). Radians mode must be set (flag –17 set). Numeric mode must not be set (flag –3 clear) Example: Obtain the discrete antiderivative with respect to the variable y of the expression: If flag –126 is clear (the default), row reduction is done with the last column. If the flag is set, row 2 x2y reduction is done without reducing the last column, but the last column will be modified by the Command: SIGMA(2*X2*Y,Y) reduction of the rest of the matrix. Result: (Y^2 –(2*X+1)*Y) Example: Reduce to rowreduced echelon form, and find the pivot points, for the matrix: See also: SIGMAVX, RISCH 2 1 SIGMAVX 3 4 Command: rref([[2,1][3,4]]) Type: Function Result: {Pivots: {5,1.,2,1.},[[10,0][0,5]]} Description: Calculates the discrete antiderivative of a function f with respect to the current variable. This is a function G such that: See also: RREFMOD G( x + 1) – G( x) = f(x) RREF where x is the current variable. Type: Command Access: !ÖDERIV LL Description: Reduces a matrix to rowreduced echelon form. The reduction is carried out completely, so a Input: Level 1/Argument 1: A function. square matrix is reduced to an identity matrix. Stepbystep mode can be used to show how the Output: The discrete antiderivative of the function. reduction proceeds. Flags: Exact mode must be set (flag –105 clear). Access: Matrices, !Ø LINEAR SYSTEMS , !´ MATRX FACTR Numeric mode must not be set (flag –3 clear). Input: A matrix. Radians mode must be set (flag –17 set). Output: An equivalent matrix in row reduced echelon form. Example: Obtain the discrete antiderivative with respect to the current variable x of the expression: Flags: Exact mode must be set (flag –105 clear). 2 x2y Numeric mode must not be set (flag –3 clear). Command: SIGMAVX(2*X2*Y) Stepbystep mode can be set (flag –100 set). Result: X^2 –(2*Y+1)*X Example: Solve the system of linear equations: See also: SIGMA, RISCH 3x + 4 y = 5 SIGN 5x + 6 y = 7 by reducing the augmented matrix that represents this system. Type: Function Description: Command: RREF([[3, 4, 5] [ 5, 6, 7]]) Sign Function: Returns the sign of a real number argument, the sign of the numerical part of a unit object argument, or the unit vector in the direction of a complex number argument. Result: [[1, 0, 1] [0, 1, 2]] This reduced matrix represents the system: For real number and unit object arguments, the sign is defined as +1 for positive arguments, –1 1x + 0 y = –1 for negative arguments. In exact mode, the sign for argument 0 is undefined (?). In approximate !´ 0x + 1 y = 2 mode, the sign for argument 0 is 0. SIGN in the menu returns the sign of a number, while …ß so that the solution is x = –1, y = 2 . SIGN in the menu returns the unit vector of a complex number. For a complex argument: See also: rref, RREFMOD x iy SIGN()x+ iy = ------+ ------2 2 2 2 x + y x + y

3210 Full Command and Function Reference Full Command and Function Reference 3223

The derivative of the function with respect to y (∂f/∂y) is –4y, and the derivative of the function Level 1/Argument 3: The order for the series expansion. The minimum value is 2, and the − 2t maximum value is 20. with respect to t ( ∂f/∂t) is . 1( + t 2 )2 Output: Level 2/Item 1: A list containing the limit as a value and as the equivalent expression, an 1. Store the independent variable’s initial value, 0, in T. expression approximating the function near the limit point, and the order of the remainder. These 2. Store the dependent variable’s initial value, 0, in Y. are expressed in terms of a small parameter h. 1 Level 1/Item 2: An expression for h in terms of the original variable. 3. Store the expression, − 2y 2 , in F. 1+ t 2 Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). 4. Store ∂f/∂y, –4y, in FY . Radians mode must be set (flag –17 set). − 2t 5. Store ∂f/∂t, 2 2 , in FT . Example: 1( + t ) Obtain the second order Taylor series expansion of ln(x) at x=1. Command: SERIES(LN(X),1,2) 6. Enter these five items in a list: { T Y F FY FT } . 7. Enter the tolerance. Use estimated decimal place accuracy as a guideline for choosing a Result: {{Limit: 0, Equiv: h, Expans: 1/2*h^2+h, Remain: h^3}, h=X 1} tolerance: 0.00001. See also: TAYLOR0 8. Enter the final value for the independent variable: 8. The stack should look like this: SERVER Type: Command { T Y F FY FT } Description: Server Mode Command: Selects Kermit Server mode. .00001 A Kermit server (a Kermit device in Server mode) passively processes requests sent to it by the 8 local Kermit. The server receives data in response to SEND, transmits data in response to 9. Press RRK . The variable T now contains 8, and Y now contains the value .123077277659. KGET, terminates Server mode in response to FINISH or LOGOUT, and transmits a directory The actual answer is .123076923077, so the calculated answer has an error of approximately listing in response to a generic directory request. .00000035, well within the specified tolerance. Access: … SERVER See also: RKF, RKFERR, RKFSTEP, RRKSTEP, RSBERR Flags: I/O Device (–33), I/O Data Format (–35), RECV Overwrite (–36), I/O Messages (–39), I/O Device for Wire (–78) RRKSTEP Input/Output: None Type: Command See also: BAUD, CKSM, FINISH, KERRM, KGET, PARITY, PKT, RECN, RECV, SEND, TRANSIO Description: Next Solution Step and Method (RKF or RRK) Command: Computes the next solution step SEVAL (hnext ) to an initial value problem for a differential equation, and displays the method used to arrive at that result. Type: Function The arguments and results are as follows: Description: Simplifies the given expression. Simplifies the expression except at the highest level, and also • { list } contains five items in this order: evaluates any existing variables that the expression contains and substitutes these back into the – The independent variable ( t). expression. – The solution variable ( y). Access: Catalog, … – The righthand side of the differential equation (or a variable where the expression is stored). – The partial derivative of y'(t) with respect to the solution variable (or a variable where the Input: Level 1/Argument 1: An algebraic expression. expression is stored). Output: The expression simplified and with existing variables evaluated. – The partial derivative of y'(t) with respect to the independent variable (or a variable where the Flags: Exact mode must be set (flag –105 clear). expression is stored). Numeric mode must not be set (flag –3 clear). • xtol is the tolerance value. Radians mode must be set (flag –17 set). • h specifies the initial candidate step. Example: With π stored in the variable Y, and the variables X and Z not in the current path, simplify the • last specifies the last method used (RKF = 1, RRK = 2). If this is the first time you are using following expression. Note that the toplevel simplification is not carried out. RRKSTEP, enter 0. Sin(3 x – y + 2 z – (2 x – z)) – Sin( x – 2 y + ( y + 3 z)) • current displays the current method used to arrive at the next step. Command: SEVAL(SIN(3*XY+2*Z(2*XZ)) SIN(X2*Y+(Y+3*Z)) • hnext is the next candidate step. Result: SIN( π –(X+3*Z)) SIN( π –(X+3*Z)) The independent and solution variables must have values stored in them. RRKSTEP steps these See also: EXPAND, SIMPLIFY variables to the next point upon completion. Note that the actual step used by RRKSTEP will be less than the input value h if the global error SF tolerance is not satisfied by that value. If a stringent global error tolerance forces RRKSTEP to Type: Command reduce its stepsize to the point that the Runge–Kutta–Fehlberg or Rosenbrock methods fails, then Description: Set Flag Command: Sets a specified user or system flag.

3212 Full Command and Function Reference Full Command and Function Reference 3221

• B and Z must both be vectors or both be matrices. Access: … SCL Σ • B and Z must have the same number of columns if they are matrices. Input/Output: None RSD is typically used for computing a correction to Z, where Z has been obtained as an See also: AUTO, SCATRPLOT approximation to the solution X to the system of equations AX = B. SCONJ Access: !Ø OPERATIONS LRSD ( Ø is the leftshift of the 5key). Type: Command !´ MATRIX LRSD ( ´ is the leftshift of the Pkey). Description: Store Conjugate Command: Conjugates the contents of a named object. Input/Output: The named object must be a number, an array, or an algebraic object. For information on conjugation, see CONJ. Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 Access: !°MEMORY ARITHMETIC LSCONJ ( °is the leftshift of the Nkey).

[ vector ]B [[ matrix ]] A [ vector ]Z → [ vector ]B–AZ Input/Output:

[[ matrix ]] B [[ matrix ]] A [[ matrix ]] Z → [[ matrix ]] B–AZ Level 1/Argument 1 Level 1/Item 1 See also: DET, IDN 'name ' →

RSWP See also: CONJ, SINV, SNEG Type: Command SCROLL Description: Row Swap Command: Swaps rows i and j of a matrix and returns the modified matrix, or swaps Type: Command elements i and j of a vector and returns the modified vector. Description: Displays any object. This is the programmable equivalent of pressing I%VIEW% and is the best Row numbers are rounded to the nearest integer. Vector arguments are treated as column vectors. way to view any object larger than the screen, such as complicated algebraic expressions. Access: !Ø CREATE ROW LRSWP ( Ø is the leftshift of the 5key). Access: … SCROLL !´ MATRIX ROW LRSWP ( ´ is the leftshift of the Pkey). Input/Output: Input/Output: Level 1/Argument 1 Level 1/Item 1 Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 Grob →

[[ matrix ]] 1 nrow i nrow j → [[ matrix ]] 2

[ vector ]1 nelement i nelement j → [ vector ]2 SDEV Type: Command See also: CSWP, ROW+, ROW– Description: Standard Deviation Command: Calculates the sample standard deviation of each of the m RULES columns of coordinate values in the current statistics matrix (reserved variable ΣDAT ). Type: Command SDEV returns a vector of m real numbers, or a single real number if m = 1. The standard Description: Displays a list of names of individuals involved with the HP 49G calculator project. deviation (the square root of the variances) is computed using this formula: Access: … RULES 1 n 2 Input/Output: None ------∑ ()xi – x n – 1i = 1 R→B Type: Command where xi is the ith coordinate value in a column, x is the mean of the data in this column, and n is the number of data points. Description: Real to Binary Command: Converts a positive real to its binary integer equivalent. Access: … SDEV For any value of n ≤ 0, the result is # 0. For any value of n ≥ 1.84467440738E19 (base 10), the result is # FFFFFFFFFFFFFFFF (base 16). Input/Output: Access: …ãR→B (ã is the rightshift of the 3key). Level 1/Argument 1 Level 1/Item 1 Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) → xsdev Input/Output: → [ xsdev 1 xsdev 2 ... xsdev m ] Level 1/Argument 1 Level 1/Item 1 See also: MAXΣ, MEAN, MINΣ, PSDEV, PVAR, TOT, VAR n → #n SEND See also: B→R Type: Command

Description: Send Object Command: Sends a copy of the named objects to a Kermit device.

3214 Full Command and Function Reference Full Command and Function Reference 3219

Input/Output: Executing SCALEW changes the xaxis display range—the xmin and xmax components of the first Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 two complex numbers in the reserved variable PPAR . The plot origin (the userunit coordinate of the center pixel) is not changed.

obj 1 obj 2 → 0/1 Access: …SCALEW Example 1: { A B } (4,5) SAME returns 0. Input/Output : Example 2: { A B } { B A } SAME returns 0. Level 1/Argument 1 Level 1/Item 1 Example 3: "CATS" "CATS" SAME returns 1. factor → See also: TYPE, == x See also: AUTO, SCALEH, XRNG SBRK Type: Command SCATRPLOT Description: Serial Break Command: Interrupts serial transmission or reception. Type: Command SBRK is typically used when a problem occurs in a serial data transmission. Description: Draw Scatter Plot Command: Draws a scatterplot of ( x, y) data points from the specified columns Access: … SBRK of the current statistics matrix (reserved variable ΣDAT ). Flags: I/O Device (–33), I/O Device for Wire (–78) The data columns plotted are specified by XCOL and YCOL, and are stored as the first two Input/Output: None parameters in the reserved variable ΣPAR . If no data columns are specified, columns 1 (independent) and 2 (dependent) are selected by default. The yaxis is autoscaled and the plot type See also: BUFLEN, SRECV, STIME, XMIT

is set to SCATTER. SCALE When SCATRPLOT is executed from a program, the resulting display does not persist unless Type: Command PICTURE or PVIEW is subsequently executed. Description: Scale Plot Command: Adjusts the first two parameters in PPAR , ( xmin , ymin ) and ( xmax , ymax ), so Access: … SCATRPLOT that xscale and yscale are the new plot horizontal and vertical scales, and the center point doesn’t Input/Output: None change. Example: The following program plots a scatter plot of the data in columns 3 and 4 of ΣDAT , draws a best fit The scale in either direction is the number of user units per tick mark. The default scale in both line, and displays the plot: directions is 1 userunit per tick mark. « 3 XCOL 4 YCOL SCATRPLOT BESTFIT ΣLINE STEQ Access: … SCALE FUNCTION DRAW { # 0d # 0d } PVIEW 7 FREEZE » Input/Output: See also: BARPLOT, PICTURE, HISTPLOT, PVIEW, SCLΣ, XCOL, YCOL

Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 SCATTER Type: Command xscale yscale → Description: Scatter Plot Type Command: Sets the plot type to SCATTER. See also: AUTO, CENTR, SCALEH, SCALEW When the plot type is SCATTER, the DRAW command plots points by obtaining x and y SCALEH coordinates from two columns of the current statistics matrix (reserved variable ΣDAT ). The Type: Command columns are specified by the first and second parameters in the reserved variable ΣPAR (using the

Description: Multiply Height Command: Multiplies the vertical plot scale by xfactor . XCOL and YCOL commands). The plotting parameters are specified in the reserved variable PPAR , which has this form: Executing SCALEH changes the yaxis display range — the ymin and ymax components of the first two complex numbers in the reserved variable PPAR . The plot origin (the userunit coordinate of { ( xmin , ymin ), ( xmax , ymax ), indep, res, axes, ptype, depend } the center pixel) is not changed. For plot type SCATTER, the elements of PPAR are used as follows: …SCALEH Access: • (xmin , ymin ) is a complex number specifying the lower left corner of PICT (the lower left corner Input/Output : of the display range). The default value is (–6.5,–3.1) for the HP 48gII and (–6.5,–3.9) for the Level 1/Argument 1 Level 1/Item 1 HP 50g and 49g+. • (xmax , ymax ) is a complex number specifying the upper right corner of PICT (the upper right xfactor → corner of the display range). The default value is (6.5,3.2) for the HP 48gII and (6.5,4.0) for the See also: AUTO, SCALEW, YRNG HP 50g and 49g+. • indep is a name specifying the independent variable. The default value of indep is X. SCALEW • res is not used. Type: Command • axes is a list containing one or more of the following, in the order listed: a complex number Description: Multiply Width Command: Multiplies the horizontal plot scale by xfactor . specifying the userunit coordinates of the plot origin, a list specifying the tickmark annotation, and two strings specifying labels for the horizontal and vertical axes. The default value is (0,0).

3216 Full Command and Function Reference Full Command and Function Reference 3217

See also: NEXT, SST

UFACT START Type: Command Type: Command Operation Description: Factor Unit Command: Factors the level 1 unit from the unit expression of the level 2 unit object. Description: START Definite Loop Structure Command: Begins START … NEXT and START … STEP Access: !Ú UNITS TOOLS UFACT ( Ú is the leftshift of the 6key). definite loop structures. Input/Output: Definite loop structures execute a command or sequence of commands a specified number of times. Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 • START … NEXT executes a portion of a program a specified number of times. x1_unit 1 x2_unit 2 → x3_unit 2*unit 3 The RPL syntax is this: xstart x finish START loopclause NEXT The algebraic syntax is this: START( xstart xfinish ) loopclause NEXT Example: 1_W 1_N UFACT returns 1_N*m/s . START takes two numbers ( xstart and xfinish ) from the stack and stores them as the starting and See also: CONVERT, UBASE, →UNIT, UVAL ending values for a loop counter. Then the loop clause is executed. NEXT increments the counter by 1 and tests to see if its value is less than or equal to xfinish. If so, the loop clause is UFL1→MINIF executed again. Notice that the loop clause is always executed at least once. Type: Command • START … STEP works just like START … NEXT, except that it can use an increment value Description: Converts a UFL1 (universal font library) fontset to a minifont compatible with the calculator. other than 1. The RPL syntax is this: xstart x finish START loopclause x increment STEP You specify the fontset and give it an ID (0–255). The font must be a 6by4 font. The algebraic syntax is this: START (xstart xfinish) loopclause STEP(xincrement) Access: …UFL 1→MINIF START takes two numbers (xstart and xfinish) from the stack and stores them as the starting Input/Output: and ending values for the loop counter. Then the loop clause is executed. STEP takes Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 xincrement from the stack and increments the counter by that value. If the argument of STEP

is an algebraic or a name, it is automatically evaluated to a number. obj fontset nID → The font converted to minifont. The increment value can be positive or negative: See also: →MINIFONT, MINIFONT→

– If positive, the loop is executed again when the counter is less than or equal to xfinish . – If negative, the loop is executed when the counter is greater than or equal to xfinish . UNASSIGN !° ° N Access: BRANCH START ( is the leftshift of the key). Type: Command Input/Output: Description: Removes global variables and returns their values. This is an algebraic version of the PURGE Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 command.

start finish → START x x Access: Catalog, … → NEXT Input: Level 1/Item 1: The name of a global variable, or a list of global names, to be purged.

increment → STEP x Output: Level 1/Item 1: The value or list of values that were stored in the now purged variables. If a

STEP 'symb increment ' → variable does not exist, or is not in the current directory path, it is not removed, and its name is See also: FOR, NEXT, STEP returned. Flags: The status of the purge confirm flag (flag –76) is ignored, variables are purged with no request for STD confirmation. Type: Command Example: Try to remove the global variable U, which contains 17.5, and the global variable V, which is not Description: Standard Mode Command: Sets the number display format to standard mode. on the current directory path. Executing STD has the same effect as clearing flags –49 and –50. Command: UNASSIGN({U, V}) Standard format (ANSI Minimal BASIC Standard X3J2) produces the following results when Result: {17.5, V} displaying or printing a number. See also: ADDTOREAL, ASSUME, DEF, LOCAL, PURGE, STO, STORE, UNASSUME, UNBIND • Numbers that can be represented exactly as integers with 12 or fewer digits are displayed without a fraction mark or exponent. Zero is displayed as 0. UNASSUME • Numbers that can be represented exactly with 12 or fewer digits, but not as integers, are Type: Command displayed with a fraction mark but no exponent. Leading zeros to the left of the fraction mark and trailing zeros to the right of the fraction mark are omitted. Description: Removes all assumptions on specified global variables, whether created by default, by ADDTOREAL or by ASSUME. Does this by removing the variable names from the list • All other numbers are displayed in scientific notation (see SCI) with both a fraction mark (with REALASSUME. Returns the variable names. To remove assumptions on a variable but leave it in one number to the left) and an exponent (of one or three digits). There are no leading or trailing REALASSUME, use ADDTOREAL instead of UNASSUME. zeros. … In algebraic objects, integers less than 10 3 are always displayed in standard mode. Access: Catalog,

3234 Full Command and Function Reference Full Command and Function Reference 3263

Input/Output: Input/Output: Level 1/Argument 1 Level 1/Item 1 Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1

xseconds → date time → “DOW DATE TIME “

0 → Example: With flags –42 and –41 clear, 2.061990 14.55 TSTR returns See also: BUFLEN, CLOSEIO, SBRK, SRECV, XMIT "TUE 02/06/90 02:55:00P" . See also: DATE, TICKS, TIME

STO Type: Command TVARS Description: Store Command: Stores an object into a specified variable or object. Type: Command Storing a graphics object into PICT makes it the current graphics object. Description: Typed Variables Command: Lists all global variables in the current directory that contain objects To create a backup object, store the obj into the desired backup location (identified as of the specified types. :nport :name backup ). STO will not overwrite an existing backup object. If the current directory contains no variables of the specified types, TVARS returns an empty list. To store backup objects and library objects, specify a port number (0 through 3). For a table of the objecttype numbers, see the entry for TYPE. After storing a library object in a port, it must then be attached to its directory before it can be Access: !° MEMORY DIRECTORY LTVARS ( °is the leftshift of the Nkey). used. The easiest way to do this is to execute a warm start (by pressing $& C). This also Input/Output: causes the calculator to perform a system halt, which clears the stack, the LAST stack, and all local Level 1/Argument 1 Level 1/Item 1 variables.

STO can also replace a single element of an array or list stored in a variable. Specify the variable in ntype → { global ... } level 1 as name (index ), which is a user function with index as the argument. The index can be n or { ntype ...} → { global ... } n,m, where n specifies the row position in a vector or list, and n,m specifies the rowandcolumn position in a matrix. See also: PVARS, TYPE, VARS

Access: K TVM Input/Output: Type: Command Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Description: TVM Menu Command: Displays the TVM Solver menu.

obj 'name ' → Access: … TVM grob PICT → Input/Output : None

obj :nport :name backup → See also: AMORT, TVMBEG, TVMEND, TVMROOT

obj 'name(index )' → TVMBEG

backup nport → Type: Command Description: Payment at Start of Period Command: Specifies that TVM calculations treat payments as being library nport → made at the beginning of the compounding periods.

port library → library :n :n Access: … TVMBEG Example 1: 'A+B+C+D' 'SUMAD' STO stores the expression A+B+C+D in the variable SUMAD . Input/Output : None Example 2: 5 'A(3)' STO stores the integer 5 in the third element in a list or vector A. See also: AMORT, TVM, TVMEND, TVMROOT Example 3: 2 'A(3,5)' STO stores the integer 2 in the element in the third row and fifth column of matrix A. TVMEND See also: DEFINE, RCL, →, Type: Command Description: Payment at End of Period Command: Specifies that TVM calculations treat payments as being STOALARM made at the end of the compounding periods. Type: Command Access: … TVMEND Description: Store Alarm Command: Stores an alarm in the system alarm list and returns its alarm index Input/Output : None number. See also: AMORT, TVM, TVMBEG, TVMROOT If the argument is a real number xtime , the alarm date will be the current system date by default.

If obj action is a string, the alarm is an appointment alarm, and the string is the alarm message. If TVMROOT obj action is any other object type, the alarm is a control alarm, and the object is executed when the Type: Command alarm comes due. Description: TVM Root Command: Solves for the specified TVM variable using values from the remaining xrepeat is the repeat interval for the alarm in clock ticks, where 8192 ticks equals 1 second. TVM variables. Access: … TVMROOT

3236 Full Command and Function Reference Full Command and Function Reference 3261

Input/Output: Input/Output: Level 1/Argument 1 Level 1/Item 1 Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1

1 truncate → 2 { obj 1, x key 1 , ... obj n, x key n } → z n z

{ S , obj 1, x key 1 , ... obj n, x key n } → z1 'symb truncate ' → 'TRNC( z1,symb truncate )'

'S' → 'symb 1' ntruncate → 'TRNC( symb 1,ntruncate )' See also: ASN, DELKEYS, RCLKEYS 'symb 1' 'symb truncate ' → 'TRNC( symb 1,symb truncate )'

STORE [ array ]1 ntruncate → [ array ]2

Type: Function x_unit ntruncate → y_unit

Description: Stores a number in a global variable. Given an expression as input, STORE evaluates the x_unit 'symb truncate ' → 'TRNC( x_unit ,symb truncate )' expression and stores the numerical value, unlike DEF which stores the expression. Example 1: (4.5792,8.1275) 2 TRNC returns (4.57,8.12) . Access: Catalog, … Example 2: [ 2.34907 3.96351 2.73453 ] 2 TRNC returns [ 2.3 3.9 2.7 ] . Input: Level 2/Argument 1: A number or an expression that evaluates to a numeric value. See also: RND

Level 1/Argument 2: The name of the variable in which the number is to be stored. If this TRUNC variable does not already exist in the current directory path then it is created. Type: Function Output: Level 1/Item 1: The number to which the first argument is evaluated, and which is stored in the variable. Description: Truncates a series expansion. Flags: Exact mode must be set (flag –105 clear). Access: Catalog, … Numeric mode must not be set (flag –3 clear). Input: Level 2/Argument 1: The expression that you want to truncate. Example: Store in variable Z the result of calculating 17*Y. Assume that Y contains the integer number 2. Level 1/Argument 2: The expression to truncate with respect to. Command: STORE(17*Y, Z) Output: The expression from Level 2/Argument 1, with terms of order greater than or equal to the order Result: 34 of the expression in Level 1/Argument 2 removed. See also: DEF, DEFINE, UNASSIGN Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). STOVX Radians mode must be set (flag –17 set). Type: Command Example: Expand the expression ( x+1) 7, and remove all terms in x4 and higher powers of x Description: Stores a name or list of names in the current CAS variable. This is the same as storing into the VX Command: TRUNC((X+1)^7,X^4) variable in the CASDIR directory. By default, the CAS variable is called X; this command allows a Result: 35*X^3+21*X^2+7*X+1 program to change that name. See also: DIVPC, EXPAND, SERIES Access: Catalog, … Input: Level 1/Argument 1: A name or list of names. TRUTH Type: Command Output: None in RPN mode, NOVAL in Algebraic mode. Description: Truth Plot Type Command: Sets the plot type to TRUTH. See also: RCLVX When the plot type is TRUTH, the DRAW command plots the current equation as a truthvalued function of two real variables. The current equation is specified in the reserved variable EQ . The STO+ plotting parameters are specified in the reserved variable PPAR , which has this form: Type: Command { ( xmin , ymin ) ( xmax , ymax ) indep res axes ptype depend } Description: Store Plus Command: Adds a number or other object to the contents of a specified variable. For plot type TRUTH, the elements of PPAR are used as follows: The object on the stack and the object in the variable must be suitable for addition to each other. STO+ can add any combination of objects suitable for addition. • (xmin , ymin ) is a complex number specifying the lower left corner of PICT (the lower left corner of the display range). The default value is (–6.5,–3.1) for the HP 48gII and (–6.5,–3.9) for the Using STO+ to add two arrays (where obj is an array and name is the global name of an array) HP 50g and 49g+. requires less memory than using the stack to add them. • (xmax , ymax ) is a complex number specifying the upper right corner of PICT (the upper right !° ° N Access: MEMORY ARITHMETIC STO+ ( is the leftshift of the key). corner of the display range). The default value is (6.5,3.2) for the HP 48gII and (6.5,4.0) for the HP 50g and 49g+.

3238 Full Command and Function Reference Full Command and Function Reference 3259

Using STO/ to divide one array by another array or to divide an array by a number (where obj is 2 1 L N(X + 1 ) + 2 × i × A TA N  an array or a number and name is the global name of an array) requires less memory than using the x stack to divide them. Result: 2 Access: !°MEMORY ARITHMETIC STO / ( °is the leftshift of the Nkey). See also: TRIGCOS, TRIGSIN, TRIGTAN Input/Output: TRIGCOS Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Type: Command obj 'name ' → Description: Simplifies a trigonometric expression by applying the identity: 'name ' obj → ()sin x 2 +()cosx 2 = 1 See also: STO+, STO–, STO*, / Returns only cosine terms if possible. STOΣ Type: Command Access: Trigonometry, …ÑLL Description: Store Sigma Command: Stores obj in the reserved variable ΣDAT . Input: An expression with trigonometric terms. STOΣ accepts any object and stores it in ΣDAT . However, if the object is not a matrix or the Output: The transformed expression. name of a variable containing a matrix, an Invalid ΣDATA error occurs upon subsequent Flags: Exact mode must be set (flag –105 clear). execution of a statistics command. Numeric mode must not be set (flag –3 clear). Access: … STO Σ Radians mode must be set (flag –17 set). Input/Output: See also: TRIG, TRIGSIN, TRIGTAN

Level 1/Argument 1 Level 1/Item 1 TRIGO obj → Type: Command See also: CLΣ, RCLΣ, Σ+, Σ– Description: Displays a menu or list containing the CAS commands for transforming trigonometric

STR→ expressions. Type: Command Access: Catalog, … Description: Evaluate String Command: Evaluates the text of a string as if the text were entered from the Flags: If the CHOOSE boxes flag is clear (flag –117 clear), displays the operations as a numbered list. If command line. the flag is set, displays the operations as a menu of function keys. OBJ→ also includes this function. STR→ is included for compatibility with the HP 28S. See also: ALGB, ARIT, CONSTANTS, DIFF, EXP&LN, INTEGER, MAIN, MATHS, MATR, Access: … STR → MODULAR, POLYNOMIAL, REWRITE, TESTS Input/Output: Level 1/Argument 1 Level 1/Item 1 TRIGSIN “obj ” → evaluatedobject Type: Command See also: ARRY→, DTAG, EQ→, LIST→, OBJ→, →STR Description: Simplifies a trigonometric expression by applying the identity: 2 2 ()sin x +()cosx = 1 →STR Returns only sine terms if possible. Type: Command Description: Object to String Command: Converts any object to string form. Access: Trigonometry, …ÑLL The fullprecision internal form of a number is not necessarily represented in the result string. To Input: An expression with trigonometric terms. ensure that →STR preserves the full precision of a number, select Standard number display Output: The transformed expression. format or a wordsize of 64 bits (or both) before executing →STR. The result string includes the entire object, even if the displayed form of the object is too large to Flags: Exact mode must be set (flag –105 clear). fit in the display. Numeric mode must not be set (flag –3 clear). If the argument object is normally displayed in two or more lines, the result string will contain Radians mode must be set (flag –17 set). newline characters (character 10) at the end of each line. The newlines are displayed as the See also: TRIG, TRIGCOS, TRIGTAN character ␍. If the argument object is already a string, →STR returns the string. TRIGTAN Access: … →STR Type: Command Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12), Number Display Description: Replaces sine and cosine terms in a trigonometric expression with tangent terms. Format (–49, –50)

3240 Full Command and Function Reference Full Command and Function Reference 3257

See also: STURMAB TMENU

STURMAB Type: Command Description: Temporary Menu Command: Displays a builtin menu, library menu, or userdefined menu. Type: Command TMENU works just like MENU, except for userdefined menus (specified by a list or by the Description: For a polynomial P and a closed interval [ a, b], STURMAB determines the number of zeroes P has name of a variable that contains a list). Such menus are displayed like a custom menu and work in [ a, b] like a custom menu, but are not stored in reserved variable CST . Thus, a menu defined and displayed by TMENU cannot be redisplayed by evaluating CST . Access: Arithmetic, !ÞPOLYNOMIAL !« See Appendix H for a list of the calculator’s builtin menus and the corresponding menu Input: A polynomial P numbers ( xmenu ). Access: „ H MENU TMENU Output: A list containing a number that is the same sign as P(a) and the number of zeroes P has in [ a, b]. & Input/Output: Flags: Exact mode must be set (flag –105 clear). Numeric mode must not be set (flag –3 clear). Level 1/Argument 1 Level 1/Item 1 Radians mode must be set (flag –17 set). xmenu →

Example: For the polynomial: { list definition } → x 3 + 2 'name definition ' → in the interval [2,0] find the sign at the lower bound, and the number of zeroes Example 1: 7 TMENU displays the first page of the MTH MATR menu. Command: STURMAB(X^3+2, 2, 0) Example 2: 48.02 TMENU displays the second page of the UNITS MASS menu. Result: {6,1} Example 3: 256 TMENU displays the first page of commands in library 256. { A 123 "ABC" } TMENU See also: STURM, ZEROS Example 4: displays the custom menu defined by the list argument. Example 5: 'MYMENU' TMENU displays the custom menu defined by the name argument. STWS See also: MENU, RCLMENU Type: Command TOT Description: Set Wordsize Command: Sets the current binary integer wordsize to n bits, where n is a value Type: Command from 1 through 64 (the default is 64). Description: Total Command: Computes the sum of each of the m columns of coordinate values in the current Values of n less than 1 or greater than 64 are interpreted as 1 or 64, respectively. statistics matrix (reserved variable ΣDAT ). If the wordsize is smaller than an integer entered on the command line, then the most significant The sums are returned as a vector of m real numbers, or as a single real number if m = 1. bits are not displayed upon entry. The truncated bits are still present internally (unless they exceed Access: … TOT 64), but they are not used for calculations and they are lost when a command uses this binary Input/Output: integer as an argument. Level 1/Argument 1 Level 1/Item 1 Results that exceed the given wordsize are also truncated to the wordsize.

→ xsum Access: !´ BASE LSTWS ( ´ is the leftshift of the Pkey). → [ xsum 1 , xsum 2 , ... , xsum m ] … ã STWS (ã is the rightshift of the 3key). See also: MAXΣ, MINΣ, MEAN, PSDEV, PVAR, SDEV, VAR Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) Input/Output: TRACE Type: Command Level 1/Argument 1 Level 1/Item 1 Description: Matrix Trace Command: Returns the trace of a square matrix. n → The trace of a square matrix is the sum of its diagonal elements. #n → Access: !Ø OPERATIONS LL TRACE ( Ø is the leftshift of the 5key). See also: BIN, DEC, HEX, OCT, RCWS !´MATRIX NORMALIZE L TRACE ( ´ is the leftshift of the Pkey). Input/Output: SUB Type: Command Operation Level 1/Argument 1 Level 1/Item 1

Description: Subset Command: Returns the portion of a string or list defined by specified positions, or returns [[ matrix ]] n×n → xtrace the rectangular portion of a graphics object or PICT defined by two corner pixel coordinates. See also: CONJ, DET, IDN If n end position is less than nstart position , SUB returns an empty string or list. Values of n less than 1 are treated as 1; values of n exceeding the length of the string or list are treated as that length. TRAN For graphics objects, a userunit coordinate less than the minimum userunit coordinate of the Type: Command graphics object is treated as that minimum. A pixel or userunit coordinate greater than the Description: Transpose Matrix Command: Returns the transpose of a matrix. maximum pixel or userunit coordinate of the graphics object is treated as that maximum. Same as TRN, but without conjugation of complex numbers.

3242 Full Command and Function Reference Full Command and Function Reference 3255

Input: Level 2/Argument 1: The object or number to be subtracted from. TICKS Level 1/Argument 2: The object or number to subtract. Type: Command Output: The result of the subtraction, modulo the current modulus. Description: Ticks Command: Returns the system time as a binary integer, in units of 1/8192 second. Flags: Exact mode must be set (flag –105 clear). Access: …ÓTOOLS TICKS ( Ó is the rightshift of the 9 key). Numeric mode must not be set (flag –3 clear). Input/Output: Radians mode must be set (flag –17 set). Level 1/Argument 1 Level 1/Item 1

SVD → #ntime Type: Command Example: If the result from a previous invocation from TICKS is on level 1 of the stack, then the command Description: Singular Value Decomposition Command: Returns the singular value decomposition of an m × n sequence TICKS SWAP B>R 8192 / returns a real number whose value is the matrix. elapsed time in seconds between the two invocations. SVD decomposes A into 2 matrices and a vector. U is an m × m orthogonal matrix, V is an n × n See also: TIME

orthogonal matrix, and S is a real vector, such that A = U × diag(S) × V . S has length MIN( m,n) TIME and contains the singular values of A in nonincreasing order. The matrix diag(S) is an m×n Type: Command diagonal matrix containing the singular values S. Description: Time Command: Returns the system time in the form HH.MMSSs. The computed results should minimize (within computational precision): time has the form HH.MMSSs , where HH is hours, MM is minutes, SS is seconds, and s is zero or A – U ⋅ diag(S) ⋅ V ------more digits (as many as allowed by the current display mode) representing fractional seconds. time min()m, n ⋅ A is always returned in 24hour format, regardless of the state of the Clock Format flag (–41). where diag( S) denotes the m × n diagonal matrix containing the singular values S. Access: …Ó TOOLS TIME (Ó is the rightshift of the 9 key). Access: !Ø FACTORIZATION SVD (Ø is the leftshift of the 5key). Input/Output: !´ MATRIX FACTORS SVD ( ´ is the leftshift of the Pkey). Level 1/Argument 1 Level 1/Item 1 Input/Output: → time Level 1/Argument 1 Level 3/Item 1 Level 2/Item 2 Level 1/Item 3 See also: DATE, TICKS, TSTR

A → U V S [[ matrix ]] [[ matrix ]] [[ matrix ]] [ vector ] →TIME See also: DIAG→, MIN, SVL Type: Command Description: Set System Time Command: Sets the system time. SVL time must have the form HH.MMSSs , where HH is hours, MM is minutes, SS is seconds, and s is Type: Command zero or more digits (as many as allowed by the current display mode) representing fractional Description: Singular Values Command: Returns the singular values of an m × n matrix. seconds. time must use 24hour format. SLV returns a real vector that contains the singular values of an m × n matrix in nonincreasing Access: …ÓTOOLS →TIME (Ó is the rightshift of the 9 key). order. The vector has length MIN( m,n). Input/Output: Access: !Ø FACTORIZATION LSVL (Ø is the leftshift of the 5key). Level 1/Argument 1 Level 1/Item 1 !´ MATRIX FACTORS LSVL ( ´ is the leftshift of the Pkey). time → Input/Output: See also: CLKADJ, →DATE

Level 1/Argument 1 Level 1/Item 1 TINC [[ matrix ]] → [ vector ] Type: Function See also: MIN, SVD Description: Temperature Increment Command: Calculates a temperature increment. TINC adds a temperature increment (not an actual temperature) to a point on a temperature scale. SWAP Use a negative increment to subtract the increment from the temperature. xinitial or x_unit1 is the Type: RPL Command initial temperature, and ydelta or y_unit2 delta is the temperature increment. The returned temperature Description: Swap Objects Command: Swaps the position of the two inputs. is the resulting final temperature. If unit objects are given, the final temperature is returned as a unit object with the same units as x_unit1 . If real numbers are given, the final temperature is !° ° N Access: STACK SWAP ( is the leftshift of the key). returned as a real number. ™ in RPN mode executes SWAP when no command line is present. Access: … TINC Input/Output: Flags: Numerical Results (–3) Level 2 Level 1 Level 2 Level 1

obj 1 obj 2 → obj 2 obj 1

3244 Full Command and Function Reference Full Command and Function Reference 3253

Example: Convert this system to a matrix: TCOLLECT X – Y = 0 Type: Command 2X + Y = 5 Command: SYST2MAT([XY, 2*X+Y=5],[X, Y]) Description: Linearizes products in a trigonometric expression by collecting sine and cosine terms, and by combining sine and cosine terms of the same argument. 1 –1 0 Access: Trigonometry, …ÑL Result: 2 1 –5 Input: An expression with trigonometric terms. %T Output: The simplified expression. Type: Function Description: Percent of Total Function: Returns the percent of the first argument that is represented by the Flags: Exact mode must be set (flag –105 clear). second argument. Numeric mode must not be set (flag –3 clear). If both arguments are unit objects, the units must be consistent with each other. Radians mode must be set (flag –17 set). The dimensions of a unit object are dropped from the result, but units are part of the calculation . Example: Collect terms in the expression: For more information on using temperature units with arithmetic functions, refer to the entry for sin 2x + cos 2 x +. Command: TCOLLECT(SIN(2*X)+COS(2*X)) Access: !´ REAL %T ( ´ is the leftshift of the Pkey). Result: √2*COS(2*Xπ/4) Flags: Numerical Results (–3) Input/Output : See also: TEXPAND, TLIN

Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 TDELTA x y → 100 y/x Type: Function x 'symb ' → '%T( x,symb )' Description: Temperature Delta Function: Calculates a temperature change. 'symb ' x → '%T( symb ,x)' TDELTA subtracts two points on a temperature scale, yielding a temperature increment (not an actual temperature). x or x_unit1 is the final temperature, and y or y_unit2 is the initial

'symb 1' 'symb 2' → '%T( symb 1, symb 2)' temperature. If unit objects are given, the increment is returned as a unit object with the same

x_unit 1 y_unit 2 → 100 y_unit 2/x_unit 1 units as x_unit1 . If real numbers are given, the increment is returned as a real number. Access: … TDELTA x_unit 'symb ' → '%T( x_unit ,symb )' Flags: Numerical Results (–3)

'symb ' x_unit → '%T( symb ,x_unit )' Input/Output: Example 1: 1_m 500_cm %T returns 500 , because 500 cm represents 500% of 1 m. Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Example 2: 100_K 50_K %T returns 50 .

See also: +, %, %CH x y → xdelta

TABVAL x_unit1 x_unit2 → x_unit1 delta Type: Command x_unit 'symb ' → 'TDELTA( x_unit, symb )' Description: For an expression and a list of values, stores the expression in EQ, and returns the results of 'symb ' y_unit → 'TDELTA( symb, y_unit )' substituting the values for the current variable in the expression. 'symb 1' 'symb 2' → 'TDELTA( symb 1, symb 2)' Access: PGRAPH L, !ÖGRAPH L See also: TINC Input: Level 2/Argument 1: An algebraic expression in terms of the current variable. Level 1/Argument 2: A list of values for which the expression is to be evaluated. TESTS Output: Level 2/Item 1: The algebraic expression. Type: Command Level 1/Item 2: A list containing two lists: a list of the values and a list of the corresponding Description: Displays a menu or list containing the ASSUME and UNASSUME commands, and tests that can results. be included in algebraic expressions. Flags: Exact mode must be set (flag –105 clear). Access: Catalog, … Numeric mode must not be set (flag –3 clear). Flags: If the CHOOSE boxes flag is clear (flag –117 clear), displays the operations as a numbered list. If 2 Example: Substitute 1, 2, and 3 into x + 1 . the flag is set, displays the operations as a menu of function keys. Command: TABVAL(X^2+1,{1, 2, 3}) See also: ALGB, ARIT, CONSTANTS, DIFF, EXP&LN, INTEGER, MAIN, MATHS, MATR, MODULAR, POLYNOMIAL, REWRITE, TRIGO

3246 Full Command and Function Reference Full Command and Function Reference 3251

See also: HEAD Input: An expression

TAN Output: The transformed expression. Type: Analytic function Flags: Exact mode must be set (flag –105 clear). Description: Tangent Analytic Function: Returns the tangent of the argument. Numeric mode must not be set (flag –3 clear). For real arguments, the current angle mode determines the number’s interpretation as an angle, Radians mode must be set (flag –17 set). unless the angular units are specified. Example: Replace tan(x) terms in the function: For a real argument that is an oddinteger multiple of 90 in Degrees mode, an Infinite Result ( tan ( x ) ) 2 exception occurs. If flag –22 is set (no error), the sign of the result (MAXR) matches that of the argument. Command: TAN2SC(TAN(X)^2) For complex arguments: Result: (SIN(X)/COS(X))^2 (sin x)( cosx) + i(sinh y)( cosh y) tan()x+ iy = ------2 2 See also: HALFTAN, TAN2CS2, TAN2SC2 sinh y + cos x If the argument for TAN is a unit object, then the specified angular unit overrides the angle mode TAN2SC2 to determine the result. Integration and differentiation, on the other hand, always observe the Type: Command angle mode. Therefore, to correctly integrate or differentiate expressions containing TAN with a unit object, the angle mode must be set to Radians (since this is a “neutral” mode). Description: Replaces tan( x) terms in an expression with sin(2 x)/1+cos(2 x) terms. Access: U Access: PTRIG , Trigonometry, …ÑL Flags: Numerical Results (–3), Angle Mode (–17, –18), Infinite Result Exception (–22) Input: An expression Input/Output: Output: The transformed expression. Level 1/Argument 1 Level 1/Item 1 Flags: Exact mode must be set (flag –105 clear). z → tan z Numeric mode must not be set (flag –3 clear). 'symb ' → 'TAN( symb )' Radians mode must be set (flag –17 set). In previous versions of the CAS, if flag –116 was set (Prefer sin()), then TAN2SC2 replaced tan(x) angular → angular x_unit tan ( x_unit ) terms with: 1 – cos(2 x)/sin(2 x). This action is now performed by the TAN2CS2 command. See also: ATAN, COS, SIN Example: Replace tan(x) terms in the function: TAN2CS2 2 ( tan ( x ) ) Type: Command Command: TAN2SC2(TAN(X)^2) Description: Replaces tan( x) terms in an expression with (1cos(2 x))/sin(2 x) terms. Result: (SIN(2*X)/(1+COS(2*X)))^2 Access: Catalog, … See also: HALFTAN, TAN2CS2, TAN2SC

Input: An expression TANH Type: Analytic function Output: The transformed expression. Description: Hyperbolic Tangent Analytic Function: Returns the hyperbolic tangent of the argument. Flags: Exact mode must be set (flag –105 clear). For complex arguments, Numeric mode must not be set (flag –3 clear). sinh2x + isin2y tanh()x+ iy = ------Radians mode must be set (flag –17 set). cosh2x + cos 2y Example: Replace tan(x) terms in the function: Access: …Ñ HYPERBOLIC TANH (Ñ is the rightshift of the 8key). 2 ( tan ( x ) ) !´ HYPERBOLIC TANH ( ´ is the leftshift of the Pkey). Command: TAN2CS2(TAN(X)^2) Flags: Numerical Results (–3) Result: ((1COS(2*X))/SIN(2*X))^2 Input/Output: See also: TAN2SC, TAN2SC2 Level 1/Argument 1 Level 1/Item 1 z → tanh z

TAN2SC 'symb ' → 'TANH( symb )' Type: Command See also: ATANH, COSH, SINH

Description: Replaces tan( x) subexpressions with sin( x)/cos( x). Access: PTRIG , Trigonometry, …ÑL

3248 Full Command and Function Reference Full Command and Function Reference 3249

Input/Output: > (Greater than) Type: Function Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Description: Greater Than Function: Tests whether one object is greater than another object. n x → utpc (n,x ) The function > returns a true test result (1) if the first argument is greater than the second See also: UTPF, UTPN, UTPT argument, or a false test result (0) otherwise.

UTPF If one object is a symbolic (an algebraic or a name), and the other is a number or symbolic or unit Type: Command object, > returns a symbolic comparison expression that can be evaluated to return a test result. For real numbers and binary integers, “greater than” means numerically greater (2 is greater than Description: Upper Snedecor’s F Distribution Command: Returns the probability utpf( n1, n2, x) that a 1). For real numbers, “greater than” also means less negative (–1 is greater than –2). Snedecor’s F random variable is greater than x, where n1 and n2 are the numerator and denominator degrees of freedom of the F distribution. For strings, “greater than” means alphabetically subsequent (“DEF” is greater than “ABC”; “AAB” is greater than “AAA”; “AA” is greater than “A”). In general, characters are ordered The defining equations for utpf( n1, n2, x) are these: according to their character codes. This means, for example, that “a” is greater than “B”, since • For x ≥ 0: “B” is character code 66, and “a” is character code 97.

n n + n ()n1 + n2 For unit objects, the two objects must be dimensionally consistent and are converted to common 1 1 2  n – 2 –------Γ ∞ 1 2 n 2 ------n 1  2  t 2 1  units for comparison. If you use simple temperature units, the calculator assumes the values -----  ------∫ 1 + ----- t dt n2 n n x n  represent temperatures and not differences in temperatures. For compound temperature units, the Γ-----1  Γ-----2  2 2  2  calculator assumes temperature units represent temperature differences. For more information on using temperature units with arithmetic functions, refer to the entry for +.

• For x < 0: Access: …É (É is the rightshift of the Ykey). Flags: Numerical Results (–3) utpf(n , n , x) = 1 1 2 Input/Output : z z Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Γ---  = ---– 1 !   2  For any value z, 2 , where ! is the calculator’s factorial command. x y → 0/1

#n 1 #n 2 → 0/1 The values n1 and n2 are rounded to the nearest integers and, when rounded, must be positive. “string 1” “string 2” → 0/1 Access: !´ L PROBABILITY L UTPF ( ´ is the leftshift of the Pkey). x 'symb ' → 'x > symb ' Input/Output: 'symb ' x → 'symb > x'

Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1 'symb 1' 'symb 2' → 'symb 1 > symb 2'

x_unit 1 y_unit 2 → 0/1 n1 n2 x → utpf (n1,n2,x) x_unit 'symb ' → 'x_unit > symb ' See also: UTPC, UTPN, UTPT → 'symb ' x_unit 'symb > x_unit ' UTPN See also: <, ≤, ≥, ==, ≠ Type: Command ≥ (Greater than or Equal) Description: Upper Normal Distribution Command: Returns the probability utpn( m, v, x) that a normal Type: Function random variable is greater than x, where m and v are the mean and variance, respectively, of the normal distribution. Description: Greater Than or Equal Function: Tests whether one object is greater than or equal to another object. For all x and m, and for v > 0, the defining equation is this: The function ≥ returns a true test result (1) if the first argument is greater than or equal to the ()t– m 2 second argument, or a false test result (0) otherwise. ∞ –------1 2v utpn() m,, v x = ------∫ e td If one object is a symbolic (an algebraic or a name), and the other is a number or symbolic or unit 2πv x object, ≥ returns a symbolic comparison expression that can be evaluated to return a test result.

For v = 0, UTPN returns 0 for x ≥ m, and 1 for x < m. For real numbers and binary integers, “greater than or equal to” means numerically equal or greater (2 is greater than or equal to 1). For real numbers, “greater than or equal to” also means Access: !´ L PROBABILITY L UTPN ( ´ is the leftshift of the Pkey). equally or less negative (–1 is greater than or equal to –2). For strings, “greater than or equal to” means alphabetically equal or subsequent (“DEF” is greater than or equal to “ABC”; “AAB” is greater than or equal to “AAA”; “AA” is greater than or equal to “A”). In general, characters are ordered according to their character codes. This means, for

3266 Full Command and Function Reference Full Command and Function Reference 3295

Input/Output: The calculator handles units by attaching the unit to a numeric value using the underscore symbol. For example, the value of 3 kilometers is shown as 3_km, and is created by entering 3 and then L1/A 1 Ln/I 1 ... L 3/I n–2 L2/I n–1 L1/I n the underscore character, followed by attaching the kilometer unit. [ x y ] → x y …Ý Ý [ xr, €ytheta ] → xr ytheta Access: ( is the rightshift of the key).

[ x1, x 2, x 3 ] → x1 x2 x3 Input: Numeric value

[ x1, €xtheta , x z ] → x1 xtheta xz Output: Numeric value ready for a unit attachment

[ x1, €xtheta , €xphi ] → x1 xtheta xphi « » (Program delimiters) [ x1, x 2, ... , x n ] → x1 ... x n–2 xn–1 xn Type: Object (x, y ) → x y Description: Program delimiter object: Enters a pair of program delimiter objects. (xr, €ytheta ) → xr ytheta L = Level; A = Argument; I = item A program is a set of instructions enclosed by an open program object delimiter and a close program object delimiter. These can be nested to have a program procedure enclosed within an Example 1: With flag –16 clear (Rectangular mode), (2,3) V→ returns 2 to level 2 and 1 to level 1. outer program object. Example 2: [ 2 €7 4 ] V→ 2 With flag –15 clear and –16 set (Polar/Cylindrical mode), returns to Access: …å (å is the rightshift of the +key). level 3, 7 to level 2, and 4 to level 1. Input: None Example 3: [ 9 7 5 3 ] V→ returns 9 to level 4, 7 to level 3, 5 to level 2, and 3 to level 1, Output: A pair of program delimiters independent of the state of flags –15 and –16. See also: →V2, →V3 < (Less than) Type: Function →V2 Description: Less Than Function: Tests whether one object is less than another object. Type: Command The function < returns a true test result (1) if the first argument is less than the second argument, Description: Stack to Vector/Complex Number Command: Converts two specified numbers into a 2element or a false test result (0) otherwise. vector or a complex number. If one object is a symbolic (an algebraic or a name), and the other is a number or symbolic or unit The result returned depends on the setting of flags –16 and –19, as shown in the following table: object, < returns a symbolic comparison expression that can be evaluated to return a test result. Flag –19 clear Flag –19 set For real numbers and binary integers, “less than” means numerically smaller (1 is less than 2). For Flag –16 clear (Rectangular mode) [ x y ] (x, y ) real numbers, “less than” also means more negative (–2 is less than –1). For strings, “less than” means alphabetically previous (“ABC” is less than “DEF”; “AAA” is less Flag –16 set (Polar mode) [ x € y ] ( x, € y ) than “AAB”; “A” is less than “AA”). In general, characters are ordered according to their character codes. This means, for example, that “B” is less than “a”, since “B” is character code 66, and “a” is character code 97. Access: !´ VECTOR →V2 ( ´ is the leftshift of the Pkey). Flags: Coordinate System (–16), Complex Mode (–19) For unit objects, the two objects must be dimensionally consistent, and are converted to common Input/Output : units for comparison. If you use simple temperature units, the calculator assumes the values represent temperatures and not differences in temperatures. For compound temperature units, the Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 calculator assumes temperature units represent temperature differences. For more information on using temperature units with arithmetic functions, refer to the entry for +. x y → [ x y ] Access: …Ç (Ç is the rightshift of the Xkey above the 8). → [ € ] x y x y Flags: Numerical Results (–3) x y → (x, y ) x y → (x, € y ) Example 1: With flags –19 and –16 clear, 2 3 →V2 returns [ 2 3 ] . Example 2: With flags –19 and –16 set (Polar/Spherical mode), 2 3 →V2 returns (2,€3) . See also: V→, →V3

→V3 Type: Command Description: Stack to 3Element Vector Command: Converts three numbers into a 3element vector. The result returned depends on the coordinate mode used, as shown in the following table:

3268 Full Command and Function Reference Full Command and Function Reference 3293

The variance (equal to the square of the standard deviation) is returned as a vector of m real flag –2 or flag –3 is set (to return numerical results), then evaluating 'SIN( π)' returns the numerical numbers, or as a single real number if m = 1. The variances are computed using this formula: approximation –2.06761537357E–13.

n !ì ì # 1 2 Access: ( is the leftshift of the key). ------⋅ ()x – x n – 1 ∑ i Flags: Symbolic Constants (–2), Numerical Results (–3) i = 1 Input/Output: x where xi is the ith coordinate value in a column, is the mean of the data in this column, and n is the number of data points. Level 1/Argument 1 Level 1/Item 1 Access: … VAR → '̟' Input/Output: → 3.14159265359…

Level 1/Argument 1 Level 1/Item 1 See also: e, i, MAXR, MINR, →Qπ

∂ (Derivative) → xvariance Type: Function → [ xvariance1 , ..., xvariancem ] Description: Derivative Function: Takes the derivative of an expression, number, or unit object with respect to See also: MAXΣ, MEAN, MINΣ, PSDEV, PVAR, SDEV, TOT a specified variable of differentiation.

VARS When executed in stack syntax, ∂ executes a complete differentiation: the expression 'symb 1' is Type: Command evaluated repeatedly until it contains no derivatives. As part of this process, if the variable of name Description: Variables Command: Returns a list of the names of all variables in the VAR menu for the current differentiation has a value, the final form of the expression substitutes that value substituted directory. for all occurrences of the variable. The algebraic syntax for ∂ is '∂name (symb 1'). When executed in algebraic syntax, ∂ executes a Access: !° MEMORY DIRECTORY L VARS ( °is the leftshift of the Nkey). stepwise differentiation of symb 1, invoking the chain rule of differentiation — the result of one Input/Output: evaluation of the expression is the derivative of the argument expression symb 1, multiplied by a new subexpression representing the derivative of symb 1’s argument. Level 1/Argument 1 Level 1/Item 1 If ∂ is applied to a function for which the calculator does not provide a derivative, ∂ returns a new → { global 1 ... global n } function whose name is der followed by the original function name. See also: ORDER, PVARS, TVARS Access: …¿ (¿is the rightshift of the Tkey). Flags: VER Numerical Results (–3) Input/Output : Type: Command Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Description: Returns the Computer Algebra System version number, and date of release. 'symb 1' 'name ' → 'symb 2' Access: Catalog, … z 'name ' → 0 Input: No input required. x_unit 'name ' → 0 Output: A real number giving the version and release date of the Computer Algebra System software. Example: In Radians mode, the command sequence 'ˆX(SIN(Y))' EVAL returns 0. When Y has Flags: The version and release date are given as a number of the form V.YYYYMMDD, so a display the value 'X^2' , the command sequence 'SIN(Y)' 'X' ˆ returns mode showing at least 8 digits after the fraction mark is needed to display the result in full. 'COS(X^2)*(2*X)' . The differentiation has been executed in stack syntax, so that all of VERSION the steps of differentiation have been carried out in a single operation. Type: Command See also: TAYLOR, ∫, Σ Description: Software Version Command: Displays the software version and copyright message. ! (Factorial) Access: … VERSION Type: Function Input/Output: Description: Factorial (Gamma) Function: Returns the factorial n! of a positive integer argument n, or the gamma function Γ(x+1) of a noninteger argument x. Level 1/Argument 1 Level 2/Item 1 Level 1/Item 2 For x ≥ 253.1190554375 or n < 0, ! causes an overflow exception (if flag –21 is set, the exception → “version number ” “copyright message ” is treated as an error). For noninteger x ≤ –254.1082426465, ! causes an underflow exception (if flag –20 is set, the exception is treated as an error). In algebraic syntax, ! follows its argument. Thus the algebraic syntax for the factorial of 7 is 7!. For noninteger arguments x, x! = Γ(x + 1), defined for x > –1 as:

3270 Full Command and Function Reference Full Command and Function Reference 3291

However, obtaining the curl of the above result, and then applying VPOTENTIAL to it again will example you could define $=1_ ? Then other currencies could be defined as multiples or fractions give the same result. of 1_ ? The calculator has symbols for Yen, Pounds and Euros; other currencies could be defined See also: CURL, POTENTIAL using their names. The unit conversion system would then check conversions between them for consistency because ? is recognized as a base unit. VTYPE Access: Catalog, …, or ~…3 Type: Command Description: Variable Type Command: Returns the type number of the object contained in the named variable. ∞ (Infinity) If the named variable does not exist, VTYPE returns –1. Type: Function For a table of the objects’ type numbers, see the entry for TYPE. Description: Infinity: used to signify a numeric result that is infinite by the rules of arithmetic, such as the result Access: !° TYPE L L VTYPE ( °is the leftshift of the Nkey). of dividing a nonzero number by zero. The calculator recognizes two kinds of infinity: signed Input/Output: and unsigned. Evaluating '1/0' gives an unsigned infinity '∞'. Selecting infinity from the keyboard, from the CHARS table, or from the catalog … returns '+∞' and the sign can be changed. Level 1/Argument 1 Level 1/Item 1 Calculations with the unsigned infinity return unsigned infinity or ? as their result. Calculations with the signed infinity can return ordinary numeric results, as in the example. Positive infinity → type 'name ' n and unsigned infinity are equal if tested with ==, but are not identical if tested with SAME.

port backup → type :n : name n Access: Keyboard, CHARS, or catalog, …

:nport : nlibrary → ntype Flags: Exact mode must be set (flag –105 clear), See also: TYPE and numeric mode must not be set (flag –3 clear) for mathematical operations to give ∞ as a result, and for executing ∞ from the keyboard or catalog to give +∞ and not an error. *W Type: Command Example: Find the arc tangent of minus infinity. Assume that radians mode is set. ATAN( ) Description: Multiply Width Command: Multiplies the horizontal plot scale by xfactor . *W is provided for Command: ∞ compatibility with the HP 48. *W is the same as SCALEW; see its listing for details. Results: (π/2)

WAIT Σ (Summation) Type: Command Type: Function Description: Wait Command: Suspends program execution for specified time, or until a key is pressed. Description: Summation Function: Calculates the value of a finite series. The function of WAIT depends on the argument, as follows: The summand argument smnd can be a real number, a complex number, a unit object, a local or • Argument x interrupts program execution for x seconds. global name, or an algebraic object. The algebraic syntax for Σ differs from the stack syntax. The • Argument 0 suspends program execution until a valid key is pressed (see below). WAIT then algebraic syntax is: 'Σ(index =initial,final,summand )' returns xkey , which defines where the pressed key is on the keyboard, and resumes program Access: …½ (½ is the rightshift of the Skey). execution. Flags: Symbolic Constants (–2), Numerical Results (–3) xkey is a threedigit number that identifies a key ’s location on the keyboard. See the entry for Input/Output : ASN for a description of the format of xkey . L4/A1 L3/A2 L2/A3 L1/A4 L1/I1 • Argument –1 works as with argument 0, except that the currently specified menu is also

displayed. 'indx' xinit xfinal smnd → xsum

!, …, ~, ~!, and ~… are not by themselves valid keys. 'indx ' 'init ' xfinal smnd → 'Σ(indx = init , xfinal , smnd )' Arguments 0 and –1 do not affect the display, so that messages persist even though the keyboard 'indx ' xinit 'final ' smnd → 'Σ(indx = xinit , final , smnd )' is ready for input (FREEZE is not required). 'indx ' 'init ' 'final ' smnd → 'Σ(indx = init , final , smnd )' Normally, the MENU command does not update the menu keys until a program halts or ends. WAIT with argument –1 enables a previous execution of MENU to display that menu while the L = Level; A = Argument; I = Item program is suspended for a key press. Example: The command sequence 'N' 1 5 'A^N' Σ returns '(EXP(6*LN(A))A)/(A1)' . Access: !° L IN WAIT ( °is the leftshift of the Nkey). See also: TAYLR, ∫, ∂

Σ+ (Sigma Plus) Type: Command Description: Sigma Plus Command: Adds one or more data points to the current statistics matrix (reserved variable ΣDAT ). For a statistics matrix with m columns, arguments for Σ+ can be entered several ways:

3272 Full Command and Function Reference Full Command and Function Reference 3289

VPAR has the following form: The principal branch used by the calculator for √ was chosen because it is analytic in the regions

{ xleft , xright , ynear , yfar , zlow , zhigh , xmin , xmax , ymin , ymax , xeye , yeye , zeye , xstep , ystep } where the arguments of the realvalued inverse function are defined. The branch cut for the complexvalued square root function occurs where the corresponding realvalued function is For plot type WIREFRAME, the elements of VPAR are used as follows: undefined. The principal branch also preserves most of the important symmetries. • xleft and xright are real numbers that specify the width of the view space. The graphs below show the domain and range of √. The graph of the domain shows where the • ynear and yfar are real numbers that specify the depth of the view space. branch cut occurs: the heavy solid line marks one side of the cut, while the feathered lines mark • zlow and zhigh are real numbers that specify the height of the view space. the other side of the cut. The graph of the range shows where each side of the cut is mapped under the function. • xmin and xmax are not used.

• ymin and ymax are not used.

• xeye , yeye , and zeye are real numbers that specify the point in space from which the graph is viewed.

• xstep and ystep are real numbers that set the number of xcoordinates versus the number of y coordinates plotted. The plotting parameters are specified in the reserved variable PPAR , which has this form:

{ ( xmin , ymin ) ( xmax , ymax ) indep res axes ptype depend } For plot type WIREFRAME, the elements of PPAR are used as follows:

• (xmin , ymin ) is not used.

• (xmax , ymax ) is not used. • indep is a name specifying the independent variable. The default value of indep is X. • res is not used. • axes is not used. • ptype is a name specifying the plot type. Executing the command WIREFRAME places the command name WIREFRAME in ptype . • depend is a name specifying the dependent variable. The default value is Y. Access: … WIREFRAME Input/Output : None

See also: BAR, CONIC DIFFEQ, FUNCTION, GRIDMAP, HISTOGRAM, PARAMETRIC, PARSURFACE, PCONTOUR, POLAR, SCATTER, SLOPEFIELD, TRUTH, YSLICE These graphs show the inverse relation 's1*√Z' for the case s1 =1. For the other value of s1 , the halfplane in the lower graph is rotated. Taken together, the halfplanes cover the whole complex WSLOG plane, which is the domain of SQ. Type: Command View these graphs with domain and range reversed to see how the domain of SQ is restricted to Description: Warmstart Log Command: Returns four strings recording the date, time, and cause of the four make an inverse function possible. Consider the halfplane in the lower graph as the restricted most recent warmstart events. domain Z = ( x, y). SQ sends this domain onto the whole complex plane in the range W = ( u, v) = Each string " log n" has the form " code–date time ". The following table summarizes the legal values of SQ( x, y) in the upper graph. code and their meanings. Access: R Code Description Flags: Principal Solution (–1), Numerical Results (–3) Input/Output: 0 The warmstart log was cleared. Level 1/Argument 1 Level 1/Item 1 1 The interrupt system detected a very low battery condition at the battery contacts (not the same as a low system voltage), and put the calculator in “Deep Sleep z → z $ 1 2 mode” ( with the system clock running ). When is pressed after the battery voltage x_unit → x unit is restored, the system warmstarts and puts a 1 in the log. 'symb ' → ' ()symb ' 2 Hardware failed during transmission (timeout). See also: SQ, ^, ISOL

3 Run through address 0. 4 System time is corrupt

3274 Full Command and Function Reference Full Command and Function Reference 3287

Access: …ΣX2 ZFACTOR Input/Output : Type: Function Description: Gas Compressibility Z Factor Function: Calculates the gas compressibility correction factor for Level 1/Argument 1 Level 1/Item 1 nonideal behavior of a hydrocarbon gas. 2 → Sum of X xTr is the reduced temperature: the ratio of the actual temperature ( T) to the pseudocritical See also: NΣ, ΣX, XCOL, ΣXY, ΣY, ΣY2 temperature ( Tc). (Calculate the ratio using absolute temperatures.) x Tr must be between 1.05 and 3.0. ΣX^2 yPr is the reduced pressure: the ratio of the actual pressure ( P) to the pseudocritical pressure ( Pc). Type: Command yPr must be between 0 and 30. Description: Sum of Squares of xValues Command: Sums the squares of the values in the independent xTr and yPr must be real numbers or unit objects that reduce to dimensionless numbers. variable column of the current statistical matrix. ΣX^2 is provided for compatibility with the HP 28. ΣX^2 is the same as ΣX2; see its listing for details. Access: … ZFACTOR Access: Flags: Numerical Results (–3)

Input/Output: XCOL Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Type: Command xTr yPr → xZfactor Description: Independent Column Command: Specifies the independentvariable column of the current statistics matrix (reserved variable ΣDAT ). xTr 'symb ' → 'ZFACTOR( xTr ,symb )' The independentvariable column number is stored as the first parameter in the reserved variable 'symb ' yPr → 'ZFACTOR( symb ,yPr )' ΣPAR . The default independentvariable column number is 1.

XCOL will accept a noninteger real number and store it in ΣPAR , but subsequent commands that 'symb 1' 'symb 2' → 'ZFACTOR( symb 1,symb 2)'

utilize the XCOL specification in ΣPAR will cause an error.

Access: …XCOL ZVOL Input/Output: Type: Command Level 1/Argument 1 Level 1/Item 1 Description: Z Volume Coordinates Command: Sets the height of the view volume in the reserved variable VPAR . ncol → xlow and xhigh are real numbers that set the zcoordinates for the view volume used in 3D plots. See also: BARPLOT, BESTFIT, COLΣ, CORR, COV, EXPFIT, HISTPLOT, LINFIT, LOGFIT, LR, These values are stored in the reserved variable VPAR . PREDX, PREDY, PWRFIT, SCATRPLOT, YCOL Access: … ZVOL

XGET Input/Output: Type: Command Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Description: XModem Get Command: Retrieves a specified filename via XMODEM from another calculator. xlow xhigh → The other calculator needs to be in server mode for the operation to work ( G I/O FUNCTIONS START SERVER ). See also: EYEPT, XVOL, XXRNG, YVOL, YYRNG

Access: … XGET ^ (Power) Input/Output: Type: Function Description: Power Analytic Function: Returns the value of the level 2 object raised to the power of the level 1 Level 1/Argument 1 Level 1/Item 1 object. This can also apply to a square matrix raised to a wholenumber power. 'name ' → If either argument is complex, the result is complex. See also: BAUD, RECN, RECV, SEND, XRECV, XSERV, XPUT The branch cuts and inverse relations for wz are determined by this relationship: z XMIT w = exp( z(ln w)) Type: Command Access: Q Description: Serial Transmit Command: Sends a string serially without using Kermit protocol, and returns a Flags: Principal Solution (–1), Numerical Results (–3) single digit that indicates whether the transmission was successful. XMIT is useful for communicating with nonKermit devices such as RS232 printers. If the transmission is successful, XMIT returns a 1. If the transmission is not successful, XMIT returns the unsent portion of the string and a 0. Use ERRM to get the error message.

3276 Full Command and Function Reference Full Command and Function Reference 3285

!´ BASE L LOGIC XOR ( ´ is the leftshift of the Pkey). YRNG Flags: Binary Integer Wordsize (–5 through –10), Binary Integer Base (–11, –12) Type: Command Input/Output: Description: yAxis Display Range Command: Specifies the yaxis display range. Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 The yaxis display range is stored in the reserved variable PPAR as ymin and ymax in the complex numbers ( xmin , ymin ) and ( xmax , ymax ). These complex numbers are the first two elements of PPAR #n 1 #n 2 → #n 3 and specify the coordinates of the lower left and upper right corners of the display ranges. “string 1” “string 2” → “string 3” The default values of ymin and ymax are –3.1 and 3.2, respectively for the HP 48gII and 3.9 and 4.0, respectively for the HP 50g and 49g+. T/F 1 T/F 2 → 0/1 Access: … YRNG T/F 'symb ' → 'T/F XOR symb ' Input/Output: 'symb ' T/F → 'symb XOR T/F ' Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 'symb 1' 'symb 2' → 'symb 1 XOR symb 2'

See also: AND, NOT, OR ymin ymax →

XPON See also: AUTO, PDIM, PMAX, PMIN, XRNG

Type: Function YSLICE Description: Exponent Function: Returns the exponent of the argument. Type: Command Access: !´ REAL L XPON ( ´ is the leftshift of the Pkey). Description: YSlice Plot Command: Sets the plot type to YSLICE. Flags: Numerical Results (–3) When plot type is set YSLICE, the DRAW command plots a slicing view of a scalar function of Input/Output: two variables. YSLICE requires values in the reserved variables EQ , VPAR , and PPAR. Level 1/Argument 1 Level 1/Item 1 VPAR has the following form: { xleft , xright , ynear , yfar , zlow , zhigh , xmin , xmax , ymin , ymax , xeye , yeye , zeye , xstep , ystep } x → nexpon For plot type YSLICE, the elements of VPAR are used as follows: 'symb ' → 'XPON( symb )' • xleft and xright are real numbers that specify the width of the view space. Example 1: 1.2E34 XPON returns 34 . • ynear and yfar are real numbers that specify the depth of the view space. Example 2: 12.4E3 XPON returns 4. • zlow and zhigh are real numbers that specify the height of the view space. 'A*1E34' XPON 'XPON(A*1E34)' Example 3: returns . • xmin and xmax are not used. See also: MANT, SIGN • ymin and ymax are not used. • xeye , yeye, and zeye are real numbers that specify the point in space from which the graph is XPUT viewed. Type: Command • xstep determines the interval between plotted xvalues within each “slice”. Description: XModem Send Command: Sends a specified filename via XMODEM to a calculator. The • ystep determines the number of slices to draw. receiving calculator needs to be in Server mode ( G I/O FUNCTIONS START SERVER ). The plotting parameters are specified in the reserved variable PPAR , which has this form: Access: … XPUT { ( xmin , ymin ), ( xmax , ymax ), indep , res , axes , ptype , depend } Input/Output: For plot type YSLICE, the elements of PPAR are used as follows: Level 1/Argument 1 Level 1/Item 1 • (xmin , ymin ) is not used. 'name ' → • (xmax , ymax ) is not used. See also: BAUD, RECN, RECV, SEND XRECV, XSERV, XGET • indep is a name specifying the independent variable. The default value of indep is X.

XQ • res is a real number specifying the interval, in userunit coordinates, between plotted values of the independent variable; or a binary integer specifying the interval in pixels. The default value is Type: Command 0, which specifies an interval of 1 pixel. Description: Converts a number, or a list of numbers in decimal format, to quotient (rational) format. Similar • axes is not used. to the →Qπ command, but also clears numeric constants mode (flag –2) and sets exact mode • ptype is a command name specifying the plot type. Executing the command YSLICE places (flag –105). YSLICE in ptype . • depend is a name specifying the dependent variable. The default value is Y. Access: Catalog, … Access: … YSLICE Input: A number, or a list of numbers. Input/Output : None Output: The number or list of numbers in rational format. This rational number converts to the input See also: BAR, CONIC, DIFFEQ, FUNCTION, GRIDMAP, HISTOGRAM, PARAMETRIC, value to the accuracy of the current display setting. PARSURFACE, PCONTOUR, POLAR, SCATTER, SLOPEFIELD, TRUTH, WIREFRAME

3278 Full Command and Function Reference Full Command and Function Reference 3283

Input/Output (RPN): M Get the calculator memory Level 2 Level 1 Level 1 L: List the files in the current directory

x Access: … XSERV y x → y See also: BAUD, RECN, RECV, SEND XRECV, XGET, XPUT 'symb 1' 'symb 2' → 'XROOT( symb 2,symb 1)' XVOL 'symb ' x → 'XROOT( x,symb )' Type: Command y 'symb ' → 'XROOT( symb ,y)' Description: X Volume Coordinates Command: Sets the width of the view volume in the reserved variable x y VPAR . y_unit x → _unit 1/x xleft and xright set the xcoordinates for the view volume used in 3D plots. These values are stored → y_unit 'symb ' 'XROOT( symb ,y_unit )' in the reserved variable VPAR .

Access: … XVOL Input/Output (ALG): Input/Output: Argument 1 Argument 2 Level 1 Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 y y x → x xleft xright →

'symb 1' 'symb 2' → 'XROOT( symb 1,symb 2)' See also: EYEPT, XXRNG, YVOL, YYRNG, ZVOL

'symb ' x → 'XROOT( symb,x )' XXRNG y 'symb ' → 'XROOT(y, symb )' Type: Command x y Description: x y_unit → _unit 1/x X Range of an Input Plane (Domain) Command: Specifies the x range of an input plane (domain) for GRIDMAP and PARSURFACE plots. 'symb ' y_unit → 'XROOT( symb ,y_unit )' xmin and xmax are real numbers that set the xcoordinates for the input plane. These values are

XSEND stored in the reserved variable VPAR . Type: Command Access: … XXRNG Description: XModem Send Command: Sends a copy of the named object via XModem. Input/Output: A receiving calculator must execute XRECV to receive an object via XModem. Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1

The transfer occurs more quickly if you start the receiving XModem after executing XSEND. xmin xmax → Also, configuring the receiving modem not to do CRC checksums (if possible) will avoid a 30 to See also: EYEPT, NUMX, NUMY, XVOL, YVOL, YYRNG, ZVOL

60second delay when starting the transfer. If you are transferring data between two calculators, executing {AAA BBB CCC} XSEND ΣXY sends AAA , BBB , and CCC . You also need to use a list on the receiving end ( {AAA BBB Type: Command CCC} XRECV , for example). Description: Sum of X times Y command: Sums the products of each of the corresponding values in the Access: … XSEND independent and dependentvariable columns of the current statistical matrix (reserved variable Σ Flags: I/O Device (–33), I/O Device for Wire (–78) DAT). The independent column is the column designated as XCOL and the dependent column Input/Output: is the column designated as YCOL. Access: …ΣXY Level 1/Argument 1 Level 1/Item 1 Input/Output : 'name ' → Level 1/Argument 1 Level 1/Item 1 See also: BAUD, RECN, RECV, SEND XRECV → Sum of X*Y See also: NΣ, ΣX, XCOL, ΣXY, ΣX2, YCOL, ΣY2

XSERV Type: Command ΣX*Y Description: XModem Server Command: Puts the calculator in XModem server mode. When in server mode, Type: Command the following commands are available: Description: Sum of X times Y command: Sums the products of each of the corresponding values in the P: Put a file in the calculator independent and dependentvariable columns of the current statistical matrix. ΣX*Y is provided G: Get a file from the calculator for compatibility with the HP 28. ΣX*Y is the same as ΣXY; see its listing for details. E: Execute a command line Access:

3280 Full Command and Function Reference Full Command and Function Reference 3281

Input/Output : Voltage Divider (2, 3) Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1

z1 z2 → z1 z2 [[ matrix ]] [ array ] → [[ matrix × array ]] z [ array ] → [ z × array ] [ array ] z → [ array × z ] z 'symb ' → 'z * symb ' 'symb ' z → 'symb * z'

'symb 1' 'symb 2' → 'symb 1 * symb 2' Equation:

1 2 → 3 #n n #n R1 V1= V ⋅ ------ R1+ R2  n1 #n 2 → #n 3

#n 1 #n 2 → #n 3 Example: x_unit y_unit → xy_unit x × unit y Given: R1 =40_, R2 =10_, V=100_V. x y_unit → xy_unit Solution: V1 =80_V. x_unit y → xy_unit

'symb ' x_unit → 'symb * x_unit ' Current Divider (2, 4) x_unit 'symb ' → 'x_unit * symb ' See also: +, –, /, =

+ (Add) Type: Function Description: Add Analytic Function: Returns the sum of the arguments. The sum of a real number a and a complex number ( x, y) is the complex number ( x+a, y).

The sum of two complex numbers ( x1, y1) and ( x2, y2) is the complex number ( x1+x2, y1+y2). The sum of a real array and a complex array is a complex array, where each element x of the real array is treated as a complex element ( x, 0). The arrays must have the same dimensions. Equation: The sum of a binary integer and a real number is a binary integer that is the sum of the two R2 arguments, truncated to the current wordsize. (The real number is converted to a binary integer I1= I ⋅ ------ before the addition.) R1+ R2  The sum of two binary integers is truncated to the current binary integer wordsize. The sum of two unit objects is a unit object with the same dimensions as the second argument. Example: The units of the two arguments must be consistent. Given: R1 =10_, R2 =6_, I=15_A. The sum of two graphics objects is the same as the result of performing a logical OR, except that Solution: I1 =5.6250_A. the two graphics objects must have the same dimensions.

Common usage is ambiguous about some units of temperature. When ºC or ºF represents a thermometer reading, then the temperature is a unit with an additive constant: 0 ºC = 273.15 K, Wire Resistance (2, 5) and 0ºF = 459.67ºR. But when ºC or ºF represents a difference in thermometer readings, then the Equation: temperature is a unit with no additive constant: 1 ºC=1 K and 1 ºF =1 ºR. ρ ⋅ L R = The calculator assumes that the simple temperature units x_ºC and x_ºF represent thermometer A temperatures when used as arguments to the functions <, >, ≤, ≥, ==, and ≠. This means that, in

order to do the calculation, the calculator will first convert any Celsius temperature to Kelvin and any Fahrenheit temperature to Rankine. (For other functions or compound temperature units, such as x_ºC/min, the calculator assumes temperature units represent temperature differences, so there is no additive constant involved, and hence no conversion.) The arithmetic operators +, –, %CH,

3298 Full Command and Function Reference Equation Reference 511

The difference of two binary integers is a binary integer that is the sum of the first argument and the two’s complement of the second argument. Electricity (2) The difference of two unit objects is a unit object with the same dimensions as the second argument. The units of the two arguments must be consistent. Variable Description Common usage is ambiguous about some units of temperature. When ºC or ºF represents a thermometer reading, then the temperature is a unit with an additive constant: 0 ºC = 273.15 K, ∈r Relative permittivity and 0 ºF = 459.67 ºR. But when ºC or ºF represents a difference in thermometer readings, then the r Relative permeability temperature is a unit with no additive constant: 1 ºC = 1 K and 1 ºF = 1 ºR. ω Angular frequency The calculator assumes that the simple temperature units x_ºC and x_ºF represent thermometer temperatures when used as arguments to the functions <, >, ≤, ≥, ==, and ≠. This means that, in ω0 Resonant angular frequency order to do the calculation, the calculator will first convert any Celsius temperature to Kelvin and φ any Fahrenheit temperature to Rankine. (For other functions or compound temperature units, such Phase angle as x_ºC/min, the calculator assumes temperature units represent temperature differences, so there φp ,φs Parallel and series phase angles is no additive constant involved, and hence no conversion.) ρ Resistivity The arithmetic operators +, –, %, %CH, and %T treat temperatures as differences, without any additive constant, but require both arguments to be either absolute (K and ºR), both ºC, or both I Current change ºF. No other combinations are allowed. t Time change Access: Flags: Numerical Results (–3) V Voltage change Input/Output : A Wire crosssection area (Wire Resistance), or Solenoid crosssection area Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 (Solenoid Inductance), or Plate area (Plate Capacitor)

z1 z2 → z1 – z2 C, C1, C2 Capacitance

[ array ] 1 [ array ] 2 → [ array ] 1–2 Cp,Cs Parallel and series capacitances z 'symb ' → 'z – symb ' d Plate separation 'symb ' z → 'symb – z' E Energy 'symb 1' 'symb 2' → 'symb 1 – symb 2' F Force between charges #n 1 n2 → #n 3 f Frequency n1 #n 2 → #n 3 f 0 #n 1 #n 2 → #n 3 Resonant frequency

x1_unit 1 y_unit 2 → (x2 – y)_ unit 2 I Current, or Total current (Current Divider) 'symb ' x_unit → 'symb – x_unit ' I1 Current in R1 → x_unit 'symb ' 'x_unit – symb ' Imax Maximum current Example 1: 25_ft 8_in returns 292_in . Example 2: [[ 5 1 ][ 3 3 ]] [[ 2 1 ][ 0 1 ]] returns L Inductance, or Length (Wire Resistance, Cylindrical Capacitor) [[ 3 0 ][ 3 2 ]] . L1,L2 Inductance Example 3: 'TOTAL' 'PART' returns 'TOTALPART' . See also: +, *, /, = Lp,Ls Parallel and series inductances

/ (Divide) N Number of turns Type: Function n Number of turns per unit length Description: Divide Analytic Function: Returns the quotient of the arguments: the first argument is divided by the second argument. P Power A real number a divided by a complex number ( x, y) returns: q Charge q1,q2 Point charge

3300 Full Command and Function Reference Equation Reference 59

Common usage is ambiguous about some units of temperature. When ºC or ºF represents a Cantilever Deflection (1, 7) thermometer reading, then the temperature is a unit with an additive constant: 0 ºC = 273.15 K, and 0ºF = 459.67ºR. But when ºC or ºF represents a difference in thermometer readings, then the temperature is a unit with no additive constant: 1ºC=1 K and 1ºF = 1ºR. The arithmetic operators +, –, %, %CH, and %T treat temperatures as differences, without any additive constant. However, +, –, %CH, and %T require both arguments to be either absolute (K and ºR), both ºC, or both ºF. No other combinations are allowed. Access: …Å (Å is the rightshift of the Wkey). Flags: Numerical Results (–3) Input/Output :

Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 Equation:

2 2 2 z1 z2 → z1 = z2 P⋅ x M⋅ x w⋅ x 2 2 y = ------⋅ ()x– 3 ⋅ a + ------–------⋅ () 6⋅ L –4 ⋅ L ⋅ x + x 6⋅ E ⋅ I 2⋅ E ⋅ I 24⋅ E ⋅ I z 'symb ' → 'z = symb ' 'symb ' z → 'symb = z' Example: 'symb 1' 'symb 2' → 'symb 1 = symb 2' Given: L=10_ft, E=29000000_psi, I=15_in^4, P=500_lbf, M=800_ft ∗lbf, a=3_ft, c=6_ft, w=100_lbf/ft, x=8_ft. y_unit x → y_unit 1 = x Solution: y= 0.3316_in. y_unit x_unit → y_unit 1 = x_unit

'symb ' x_unit → 'symb = x_unit ' Cantilever Slope (1, 8) x_unit 'symb ' → 'x_unit = symb ' See also: DEFINE, EVAL, –

== (Logical Equality) Type: Function Description: Logical Equality Function: Tests if two objects are equal. The function == returns a true result (1) if the two objects are the same type and have the same value, or a false result (0) otherwise. Lists and programs are considered to have the same values if the objects they contain are identical. If one object is algebraic (or a name), and the other is a number (real or complex) or an algebraic, == returns a symbolic comparison expression that can be evaluated to return a test result. Note that == is used for comparisons, while = separates two Equation:

sides of an equation. If the imaginary part of a complex number is 0, it is ignored when the P⋅ x M⋅ x w⋅ x 2 2 Θ = ------⋅ ()x– 2 ⋅ a + ------–------⋅ () 3⋅ L –3 ⋅ L ⋅ x + x complex number is compared to a real number. 2⋅ E ⋅ I EI⋅ 6⋅ E ⋅ I For unit objects, the two objects must be dimensionally consistent and are converted to common units for comparison. If you use simple temperature units, the calculator assumes the values Example: represent temperatures and not differences in temperatures. For compound temperature units, the calculator assumes temperature units represent temperature differences. For more information on Given: L=10_ft, E=29000000_psi, I=15_in^4, P=500lbf, M=800_ft ∗lbf, a=3_ft, c=6_ft, w=100_lbf/ft, x=8_ft. using temperature units with arithmetic functions, refer to the entry for +. Solution: Θ= 0.2652_°. Access: !°TEST == ( °is the leftshift of the Nkey). Cantilever Moment (1, 9) Flags: Numerical Results (–3)

3302 Full Command and Function Reference Equation Reference 57

« → x y z 'x*y/2+z' » Simple Deflection (1, 3) is a userdefined function. Like a builtin function, a userdefined function can take its arguments in stack syntax or algebraic syntax, and can take symbolic arguments. In addition, a userdefined function is differentiable if its defining procedure is an algebraic expression that contains only differentiable functions. See also: DEFINE, LOCAL, STO

; (Semicolon) Type: Command Description: Drop Safe Command: Removes the level 1 object from the stack if there is one, otherwise does nothing. Access: …&í when flag –51 is clear ( íis the rightshift of the #key) Equation: …í when flag –51 is set ( íis the rightshift of the #key). P⋅() L– a ⋅ x 2 2 2 y = ------⋅ ()x + ()L– a – L Input/Output: 6⋅ L ⋅ E ⋅ I Level 1 Level 1 M⋅ x x 2 L c 2 –------⋅  c – ------– --- – ------ obj → EI⋅ 6⋅ L 3 2⋅ L 

→ w⋅ x 3 2 –L------⋅ ()+ x ⋅ ()x–L 2 ⋅ See also: CLEAR, DROP, DROPN, DROP2 24⋅ E ⋅ I

Example: Given: L=20_ft, E=29000000_psi, I=40_in^4, a=10_ft, P=674.427_lbf, c=17_ft, M=3687.81_ft ∗lbf, w=102.783_lbf/ft, x=9_ft. Solution: y= 0.6005_in.

Simple Slope (1, 4)

Equation:

P⋅ () L– a 2 2 2 Θ = ------⋅ ()3⋅ x + ()L– a – L 6⋅ L ⋅ E ⋅ I

2 2 M x L c –------⋅  c – ------– --- – ------ EI⋅ 2⋅ L 3 2⋅ L 

w 3 2 –L------⋅ ()+ x ⋅ ()4⋅ x –L6 ⋅ 24⋅ E ⋅ I

3304 Full Command and Function Reference Equation Reference 55

• Many CAS commands will give numeric results instead of symbolic results if numeric mode is set instead of being cleared. Though these results may be correct, they will not be what the user wants if a symbolic result is needed. For this reason, the Flags section of most operation descriptions says that numeric mode should not be set. • If approximate mode is set instead of exact mode, CAS commands will often give reasonable results, but unexpected results can be obtained, because, for example, powers are real numbers, not integers, for Columns and Beams (1) instance a cube will be treated as x3.0 instead of x3. For this reason, the Flags section of most operation descriptions says that exact mode should be set. Some commands, like the numeric solvers, will only find Variable Description approximate solutions if approximate mode is set. • CAS operations are designed to work with integers if possible, and some CAS operations round their inputs º Eccentricity (offset) of load before using them. FIX 0 mode will round to whole numbers, losing accuracy. STD mode will retain full σcr Critical stress accuracy, so it is the best display mode to use with the CAS and is used in most of the examples in this chapter. σmax Maximum stress • For the same reasons, the general solutions, symbolic constants and symbolic arguments flags (flags –1, –2 θ Slope at x and –3) should normally be clear when working with the CAS. A Crosssectional area • Where possible, integer numbers should be used as input, not real numbers. The functions RND, CEIL and FLOOR can round a real number to a whole real number, and R I will convert a whole real number to an a Distance to point load integer. c Distance to edge fiber (Eccentric Columns), or • If complex inputs are given, approximate mode may need to be set to find solutions, and complex mode Distance to applied moment (beams) must be set (flag –103 set). • Not only the trigonometry rewriting operations, but some other CAS operations require the angle mode to E Modulus of elasticity be set to radians (flag –17 clear), even if it is not immediately obvious that this is so. For this reason, the I Moment of inertia Flags section of many operation descriptions says that radians mode should be set. K • Some CAS operations will work one step at a time if stepbystep mode is set (flag –100 set). If a result is Effective length factor of column wanted immediately, and the calculator instead displays one step of the operation, cancel the operation, clear L Length of column or bean flag –100, then repeat the operation. M Applied moment • If a mode needs to be changed for an operation to work, the calculator will by default ask if the mode can be changed. If the Silent mode switch flag (flag –120) is set, the calculator changes the mode without asking. Mx Internal bending moment at x If the mode switch disallowed flag (flag –123) is set, the mode will not be changed and an error will occur. P Load (Eccentric Columns), or Point load (beams) • All the system flags from –99 to –128 are intended for use by the CAS. It is worth reading Appendix C in the User’s Guide to learn the detailed effects of these flags on CAS operations and displays. Pcr Critical load • Remember that in RPN mode, symbolic expressions typed on the command line should be enclosed in r Radius of gyration single quote marks ′x + y ′. For clarity, it can be helpful to type expressions in single quote marks in Algebraic mode too. V Shear force at x • It is important to write symbolic expressions using the current variable. Some CAS operations will work w Distributed load with this variable, but treat other variables simply as unknown numbers. If an expression has been entered x using a variable other than the current variable, it may be simpler to change the current variable in the CAS Distance along beam MODES form, rather than rewrite the whole expression. y Deflection at x • In algebraic mode (flag –95 set), some CAS commands will replace variables with their numeric values before returning a result, even if “argument to symbolic” mode is set (flag –3 clear). In RPN mode, they will For simply supported beams and cantilever beams (“Simple Deflection” through “Cantilever Shear”), the be returned as variables. Some other CAS commands will always replace variables with their numeric results. calculations differ depending upon the location of x relative to the loads. • Because of the above, variables used in symbolic operations should not have the same names as variables Applied loads are positive downward. stored in the current directory/folder (or in directories above this directory). If, for example, x is the current The applied moment is positive counterclockwise. variable, and a variable called ′x′ exists in the current directory or in the HOME directory, then the value Deflection is positive upward. stored in ′x′ might be used instead of the symbolic variable x. Slope is positive counterclockwise Internal bending moment is positive counterclockwise on the lefthand part. • The modulo value used in modulus calculations is 13 after the calculator is reset. If the CAS modes are reset Shear force is positive downward on the lefthand part. with CASCFG, the modulo is also 13, but if the modes are reset using !RESET as above, the modulo is 3, otherwise it is the value most recently set. It is important to change this to the required value before carrying Reference: 2. out any modulus operations.

42 Computer Algebra System Equation Reference 53 5 Computer algebra command categories listed by menu CAS operations are listed here in order of the keyboard menus they appear in. These menus can be selected from 5. Equation Reference the CAS menu in G, or directly from the keyboard. A few CAS operations appear in more than one menu. Many CAS commands are also available from the P menu, or from the „´ menu; these menus are not listed The Equation Library consists of 15 subjects and more than 100 titles. Each subject and title has a number that you here, to avoid duplication. The CAS has its own menu commands too, they are included in the alphabetical list of can use with SOLVEQN to specify the set of equations. These numbers are shown in parentheses after the commands. Operations that do not appear in any menu can be spelled out or selected from …. headings.

Algebra commands, …× COLLECT ...... 340 EXPAND ...... 380 FACTOR ...... 382 LIN ...... 3131 LNCOLLECT ...... 3136 PARTFRAC ...... 3164 SOLVE ...... 3229 SUBST ...... 3243 See the end of this section for references given in each subject. Remember that some equations are estimates and TEXPAND ...... 3252 assume certain conditions. See the references or other standard texts for assumptions and limitations of the equations. Solutions in the examples have been rounded to four decimal places. Arithmetic commands NOTE: You must set system flag –117 in order to enable the soft menus for Equation Library usage.

Arithmetic Integer commands, !ÞINTEGER EULER ...... 376 IABCUV ...... 3108 The next page is a handy onepage table of contents to the equations and groups within the library. The columns IBERNOULLI...... 3109 headers provide the subject, the number of variables, the presence or absence of a picture, the number of equations and the page number where the group can be found. The example shown below should be read as follows: ICHINREM ...... 3109 IDIV2 ...... 3111 Subject, var (subj, title) Pic EQ Pg IEGCD ...... 3111 COLUMNS AND BEAMS, 22 **********(1)*** IQUOT ...... 3120 Elastic Buckling (1,1) Y 4 54

IREMAINDER ...... 3121 COLUMNS AND BEAMS, 22 **********(1)*** ISPRIME? ...... 3122 Columns and beams – The group header. NEXTPRIME ...... 3155 22 – The number of variables in the group. PA2B2 ...... 3162 PREVPRIME ...... 3178 (1) – Indicates that Columns and beams are the first group.

Elastic Buckling (1,1) Y 4 54 Arithmetic Polynomial commands, !ÞPOLYNOMIAL ABCUV ...... 35 Elastic Buckling – The subject area of the first set of equations. CHINREM ...... 334 (1,1) – Indicates that Elastic Buckling is the first subject area within the columns and beams group. CYCLOTOMIC ...... 348 Y – Indicates that a picture is present for this subject area. DIV2 ...... 362 EGCD ...... 372 4 – Indicates that there are 4 equations in this subject area. FACTOR ...... 382 54 – Indicates this subject area can be found on page 54. FCOEF ...... 385 FROOTS ...... 392 It is provided as a quick reference. GCD ...... 396

44 Computer Algebra System Equation Reference 51

Calculus commands Matrix convert, !Ú MATRIX CONVERT Derivation and integration commands, !ÖDERIV . & INTEG . AXL ...... 325 CURL ...... 348 AXQ ...... 326 DERIV ...... 356 QXA ...... 3190 DERVX ...... 356 SYST2MAT ...... 3245 DIV ...... 362 FOURIER ...... 391 Other CAS operations, … HESS ...... 3104 These operations are in other menus, as described in Access for each one, or can be accessed with IBP ...... 3109 …. INTVX ...... 3119 Other mathematics operations LAPL ...... 3127 DEGREE ...... 353 PREVAL ...... 3177 DOMAIN ...... 366 RISCH ...... 3202 SIGMA ...... 3222 DROITE ...... 369 SIGMAVX ...... 3223 dn ...... 364 EPSX0 ...... 374 Limits and series commands, !ÖLIMITS & SERIES EXLR ...... 377 DIVPC ...... 363 EXP2HYP ...... 379 lim ...... 3131 FXND ...... 394 SERIES ...... 3220 GBASIS ...... 395 TAYLOR0 ...... 3250 GREDUCE ...... 399 TAYLR ...... 3250 LCXM ...... 3129

Differential equations commands, !ÖDIFFERENTIAL EQNS LIMIT ...... 3131 DESOLVE ...... 356 LNAME ...... 3136 ILAP ...... 3114 LVAR ...... 3140 LAP ...... 3127 MSLV ...... 3152 LDEC ...... 3129 P2C ...... 3162 POTENTIAL ...... 3174 !Ö Graphing commands, GRAPH REORDER ...... 3199 DEFINE ...... 352 RREFMOD ...... 3211 GROBADD ...... 3101 SEVAL ...... 3221 PLOT ...... 3171 TAN2CS2 ...... 3248 PLOTADD ...... 3171 TCHEBYCHEFF ...... 3250 SIGNTAB ...... 3224 TRUNC ...... 3259 TABVAL ...... 3246 VPOTENTIAL...... 3271 TABVAR ...... 3247 XNUM ...... 3277

Other Calculus commands, !Ö XQ ...... 3278 DERVX ...... 356 ? ...... 3288 INTVX ...... 3119 ∞ ...... 3289 These two operations are available directly from the CALC menu as well as being in the Derivation and Integration commands menu.

46 Computer Algebra System Computer Algebra System 411

TRACE ...... 3255 TRAN ...... 3255 Symbolic solve commands, !Î DESOLVE ...... 356 Operations, !Ø FACTORIZATION ISOL ...... 3121 LQ ...... 3138 LDEC ...... 3129 LU ...... 3139 LINSOLVE ...... 3133 QR ...... 3188 SOLVEVX ...... 3229 qr ...... 3188 SOLVE ...... 3229 SCHUR ...... 3218 ZEROS ...... 3284 SVD ...... 3244

SVL ...... 3244 Trigonometry commands

Quadratic form, !Ø QUADRATIC FORM Hyperbolic, …Ñ HYPERBOLIC AXQ ...... 326 ACOSH ...... 38 CHOLESKY ...... 334 ASINH ...... 317 GAUSS ...... 395 ATANH ...... 322 QXA ...... 3190 COSH ...... 346 SYLVESTER ...... 3245 SINH ...... 3226 Linear Systems, !Ø LINEAR SYSTEMS TANH ...... 3249 LINSOLVE ...... 3133 Other Trigonometry commands, …Ñ REF ...... 3198 ACOS2S ...... 37 rref ...... 3210 ASIN2C ...... 317 RREF ...... 3210 ASIN2T ...... 317 SYST2MAT ...... 3245 ATAN2S ...... 321 Linear Applications, !Ø LINEAR APPL HALFTAN ...... 3102 IMAGE ...... 3115 SINCOS ...... 3225 ISOM ...... 3121 TAN2SC ...... 3248 KER ...... 3123 TAN2SC2 ...... 3249 MKISOM ...... 3149 TCOLLECT ...... 3251

TEXPAND ...... 3252 Eigenvectors, !Ø EIGENVECTORS TLIN ...... 3254 DIAGMAP ...... 358 TRIG ...... 3256 EGV ...... 373 TRIGCOS ...... 3257 EGVL ...... 373 TRIGSIN ...... 3257 JORDAN ...... 3122 TRIGTAN ...... 3257 PCAR ...... 3165 TSIMP ...... 3260 PMINI ...... 3172

Vector, !Ø VECTOR BASIS ...... 327 CROSS ...... 347 DOT ...... 367 GRAMSCHMIDT ...... 399 IBASIS ...... 3109

48 Computer Algebra System Computer Algebra System 49

RLC Current Delay (2, 11) Example: Given: xm =10_cm, ω=15_r/s, φ=25_°, t=25_ s. Solution: x=9.0615_cm, v= 0.6344_m/s, a= 20.3884_m/s^2, f= 2.3873_Hz.

Plane Geometry (11)

Variable Description β Central angle of polygon θ Vertex angle of polygon The phase delay (angle) is positive for current lagging voltage. A Area Equations: 1 1 Base length (Rectangle, Triangle), or – b X L – X C X C X L Length of semiaxis in x direction (Ellipse) TA N( φ s ) = TA N( φ p) = R 1 C R Circumference 1 X C = X L = ω ⋅ L ω = 2 ⋅ π ⋅ f d ω ⋅ C Distance to rotation axis in y direction

h Height (Rectangle, Triangle), or Example: Length of semiaxis in y direction (Ellipse) Given: f= 1107_Hz, C=80_ f, L=20_ mH, R=5_. I, Ix Moment of inertia about x axis Solution: ω=672.3008_r/s, φs= 45.8292_°, φp= 5.8772_°, XC =18.5929_, XL =13.4460_. Id Moment of inertia in x direction at d

Iy DC Capacitor Current (2, 12) Moment of inertia about y axis J Polar moment of inertia at centroid These equations approximate the dc current required to charge the voltage on a capacitor in a certain time interval. Equations: L Side length of polygon V n Number of sides IC= ⋅ ------   V =–Vf – Vi t = tf⋅ ti t P Perimeter Example: r Radius Given: C=15_ f, Vi =2.3_V, Vf =3.2_ V, I=10_A, ti =0_s. ri, ro Inside and outside radii Solution: V t tf =0.9000_V, =1.3500_ s, =1.3500_ s. rs Distance to side of polygon

rv Distance to vertex of polygon Capacitor Charge (2, 13) v Horizontal distance to vertex Equation: q= C⋅ V Reference: 4.

Example: Given: C=20_ F, V=100_V. Solution: q=0.0020_C.

514 Equation Reference Equation Reference 543

Solution: I=0.0072_A. MassSpring System (10, 1) Resonant Frequency (2, 17) Equation: 1 1 C C ω 0 = Qs = ⋅ Qp = R ⋅ ω 0 = 2 ⋅ π ⋅ f0 L ⋅ C R L L

Example: Given: L=500_mH, C=8_ F, R=10_ ω.

Solution: ω0=500_r / s, Qs =25.0000, Qp =0.0400, f0 =79.5775_Hz. Equations: Plate Capacitor (2, 18) k 2 ⋅ π ω = T = ω = 2 ⋅ π ⋅ f m ω

Example: Given: k=20_N/m, m=5_kg. Solution: ω =2_r/s. T=3.1416_s, f=.3183_Hz. Equation: ∈0 ⋅∈ r ⋅ A Simple Pendulum (10, 2) C = d

Example: Given: C=25_ F, ∈r=2.26, A=1_cm^2. Solution: d=8.0042E9_cm.

Cylindrical Capacitor (2,19)

Equations: g 2 ⋅ π ω = T = ω = 2 ⋅ π ⋅ f L ω

Example: Given: L=15_cm. Solution: ω =8.0856_r/s. T= 0.7771_s, f=1.2869_Hz. Equation: 2 ⋅ π ⋅∈0 ⋅∈r ⋅ L C = ro LN   r i 

516 Equation Reference Equation Reference 541

Sinusoidal Voltage (2, 22) Spherical Reflection (9, 4) Equations: V = V ma x ⋅ S IN( ω ⋅ t + φ ) ω = 2 ⋅ π ⋅ f

Example: Given: Vmax =110_V, t=30_ s, f=60_Hz, φ=15_°. Solution: ω=376.9911_r/s, V=29.6699_V.

Sinusoidal Current (2, 23) Equations: Equations: 1 1 1 1 –v I = Ima x ⋅ S IN( ω ⋅ t + φ ) ω = 2 ⋅ π ⋅ f --- + --- = --- f =--- ⋅ r m = ------u v f 2 u

Example: Example: Given: t=32_s, Imax =10_A, ω=636_r/s, φ=30_°. Given: u=10_cm, v=300_cm, r=19.35_cm. Solution: I=9.5983_A, f=101.2225_Hz. Solution: m=30, f=9.6774_cm. Fluids (3) Spherical Refraction (9, 5) Variable Description ∈ Roughness Dynamic viscosity ρ Density P Pressure change y Height change ΣK Total fitting coefficients A Crosssectional area Equation: n1 n2 n2 – n1 A1,A2 ------+ ------= ------Initial and final crosssectional areas u v r D Diameter Example: D1, D2 Initial and final diameters Given: u=8_cm, v=12_cm, r=2_cm, n1 =1. h Depth relative to P0 reference depth Solution: n2 =1.5000. hL Head loss L Length Thin Lens (9, 6) M Mass flow rate r1 is for the front surface, and r2 is for the back surface. n Kinematic viscosity P Pressure at h P0 Reference pressure P1, P2 Initial and final pressures Q Volume flow rate

518 Equation Reference Equation Reference 539

Equations: 2 2 P v 2 – v 1 ------+ ------+ g ⋅ y = 0 ρ 2 Optics (9) 2 A 2 2 v 2 ⋅  1 –  ------  P   A 1   ------+ ------+ g ⋅ y = 0 Variable Description ρ 2 2 A 2 2 θ1 v 1 ⋅   ------ – 1 Angle of incidence P   A 1   ------+ ------+ g ⋅ y = 0 ρ 2 θ2 Angle of refraction P = P 2 – P 1 y = y 2 – y 1 M = ρ ⋅ Q θB Brewster angle Q = A 2 – v 2 Q = A 1 – v 1 2 2 θc π ⋅ D 1 π ⋅ D 2 Critical angle A 1 = ------A 2 = ------4 4 f Focal length Example: m Magnification Given: P2 =25_psi, P1 =75_psi, y2=35_ft, y1 =0_fr, D1 =18_in, ρ=64_lb/ft^3, v1 =100_ft/s. n, n1, n2 Solution: Q=10602.8752_ft^3/min, M=678584.0132_lb/min, v2 =122.4213_ft/s, A2 =207.8633_in^2, Index of refraction D2 =16.2684_in, A1 =254.4690_in^2, P= 50_psi, y=35_ft. r, r1, r2 Radius of curvature

u Distance to object

Flow with Losses (3, 3) v Distance to image

These equations extend Bernoulli’s equation to include power input (or output) and head loss. For reflection and refraction problems, the focal length and radius of curvature are positive in the direction of the outgoing light (reflected or refracted). The object distance is positive in front of the surface. The image distance is positive in the direction of the outgoing light (reflected or refracted). The magnification is positive for an upright image. Reference: 3.

Law of Refraction (9, 1)

Equations: 2 2 P v 2 – v 1 M ⋅  ------+ ------+ g ⋅ y + h L = W  ρ 2  2 A 2 2  v 2 ⋅  1 –  ------    P   A 1    M ⋅  ------+ ------+ g ⋅ y + h L = W  ρ 2    2 A1 2 Equation:  v 1 ⋅   ------ – 1   P   A 2    M ⋅  ------+ ------+ g ⋅ y + h L = W n1 ⋅ S IN( θ 1 ) = n2 ⋅ S IN()θ 2  ρ 2    P = P 2 – P 1 y = y 2 – y 1 M = ρ ⋅ Q Example: Given: n1 =1, n2 =1.333, θ1=45_°. Q = A 2 ⋅ v 2 Q = A 1 ⋅ v 1 Solution: θ2=32.0367_°. 2 2 π ⋅ D 1 π ⋅ D 2 A 1 = ------A 2 = ------4 4

520 Equation Reference Equation Reference 537

Linear Motion (8, 1) Variable Description Equations: A 1 2 1 2 Projected area relative to flow x= x0+ v0 ⋅ t +--- ⋅ a ⋅ t x= x0+ v ⋅ t +--- ⋅ a ⋅ t 2 2 ar Centripetal acceleration at r 1 x= x0 +--- ⋅() v0+ v ⋅ t v= v0+ a ⋅ t 2 at Tangential acceleration at r Cd Drag coefficient Example: Given: x0 =0_m, x=100_m, t=10_s, v0=1_m/s E Energy Solution: v=19_m/s, a=1.8_m/s^2. F Force at r or x, or Spring force (Hooke’s Law), or attractive force (Law of Gravitation), or Drag force (Drag force) Object in Free Fall (8, 2) I Moment of inertia Equations: k Spring constant 1 2 1 2 y= y0+ v0 ⋅ t +--- ⋅ g ⋅ t y= y0+ v ⋅ t +--- ⋅ g ⋅ t Ki,Kf Initial and final kinetic energies 2 2 v2 = v02 +2⋅ g ⋅ () y+ y0 m, m1, m2 Mass v= v0+ g ⋅ t

N Rotational speed Example: Ni, Nf Initial and final rotational speeds Given: y0 =1000_ft, y=0_ft, v0 =0_ft/s P Instantaneous power Solution: t=7.8843_s, v= 253.6991_ft/s. Pavg Average power Projectile Motion (8, 3) Radius from rotation axis, or r Separation distance (Law of Gravitation) t Time v Velocity vf, v1f, v2f Final velocity vi, v1i Initial velocity W Work

x Displacement Equations: 1 2 x = x 0 + v 0 ⋅ C OS ( θ 0 ) ⋅ t y = y 0 + v0 ⋅ S IN()θ 0 ⋅ t – ⋅ g ⋅ t Reference: 3. 2

vx = v 0 ⋅ C OS ( θ 0 ) vy = v 0 ⋅ S IN( θ 0 ) – g ⋅ t Linear Mechanics (4, 1) 2 v0 R = ⋅ S IN( 2 ⋅ θ 0 ) Equations: g 1 2 1 2 F= m⋅ a Ki = --- ⋅m ⋅ vi Kf = --- ⋅m ⋅ vf W= F⋅ x 2 2 Example: W W= Kf– Ki P= F⋅ v Pavg = ----- vf= vi+ a ⋅ t t Given: x0 =0_ft, y0 =0_ft, Θ 0 =45_ °, v0 =200_ft/s, t=10_s.

Example: Solution: R=1243.2399_ft, vx =141.4214_ft/s, vy = 180.3186_ft/s, x=1414.2136_ft, y= 194.4864_ft. Given: t=10_s, m=50_lb, a=12.5_ft/s^2, vi =0_ft/s. Solution: vf =125_ft/s, x=625_ft, F=19.4256_lbf, Ki =0_ft ∗lbf, Kf =12140.9961_ft ∗lbf, W=12140.9961_ft ∗lbf, Pavg =2.2075_hp.

522 Equation Reference Equation Reference 535

1D Elastic Collisions (4, 5) Magnetic (B) Field in Solenoid (7, 3)

Equations: Equation:

m1– m2 2⋅ m1 B = 0 ⋅ r ⋅ I ⋅ n v1f = ------⋅ v1i v2f = ------⋅ v1i m1+ m2 m1+ m2

Example: Example: Given: r=10, n=50, I=1.25_A. Given: m1 =10_kg, m2 =25_kg, vli =100_m/s. Solution: B=0.0785_T. Solution: v1f =42.8571_m/s, v2f =57.1429_m/s.

Drag Force (4, 6) Magnetic (B) Field in Toroid (7, 4) Equation: 2 ρ ⋅ v F = C d ⋅   ⋅ A  2 

Example: Given: Cd =.05, ρ=1000_kg/m^3, A=7.5E6_cm^2, v=35_m/s. Solution: F=22968750_N.

Law of Gravitation (4, 7) Equation: 0 ⋅ r ⋅ I ⋅ N 2 Equation: B = ⋅   2 ⋅ π  ro + r i  m1⋅ m2 FG= ⋅ ------ 2  r Example: Example: Given: r=10, N=50, ri =5_cm, ro =7_cm, I=10_A. Given: m1 =2E15_kg, m2 =2E18_kg, r=1000000_km. Solution: B=1.6667E–2_T. Solution: F=266903.6_N.

MassEnergy Relation (4, 8) Equation:

2 E= m⋅ c

Example: Given: m=9.1E31_kg. Solution: E=8.1787E14_J.

524 Equation Reference Equation Reference 533

Example: Black Body Radiation (6, 6) Given: T=16.85_ °C, P=1_atm, V=25_1, MW =36_g/gmol. (See “F0 λ” in Chapter 3.) Solution: n=1.0506_gmol, m=3.7820E2_kg.

Ideal Gas State Change (5, 2) Equation: Pf⋅ Vf Pi⋅ Vi ------= ------Tf Ti

Example:

Given: Pi =1.5_kPa, Pf =1.5kPa, Vi =2_l, Ti =100_ °C, Tf =373.15_K. Equations: 4 Solution: Vf =2_1. e b = σ ⋅ T f = F0 λ( λ2 ; T) – F0 λ(λ1 ; T)

e B1 2 f ⋅ e b λma x ⋅ T = c 3 q = e b ⋅ A Isothermal Expansion (5, 3) = These equations apply to an ideal gas. Example: Equations: Given: T=1000_ °C, λ1=1000_nm, λ2=600_nm, A=1_cm^2. Vf W= n⋅ R ⋅ T ⋅ LN------ m= n⋅ MW Solution: λmax =2276.0523_nm, eb =148984.2703_W/m^2, f=.0036, eb12 =537.7264_W/m^2, q=14.8984_W. Vi 

Example: Magnetism (7) Given: Vi =2_l, Vf =125_l, T=300_ °C, n=0.25_gmol, MW =64_g/gmol. Variable Description Solution: W=4926.4942_J, M=0.016_kg. r Relative permeability

Polytropic Processes (5, 4) B Magnetic field d These equations describe a reversible pressurevolume change of an ideal gas such that P ∗Vn is constant. Special Separation distance cases include isothermal processes ( n=1), isentropic processes ( n=k, the specific heat ratio), and constantpressure Fba Force processes ( n=0). I, Ia, Ib Current Equations: n– 1 L Length ------Pf Vf –n Tf Pf n ----- = ------ ------= -----  N Pi Vi  Ti Pi  Total number of turns n Number of turns per unit length Example: r Distance from center of wire Given: Pi =15_psi, Pf =35_psi, Vi =1_ft^3, Vf =0.50_ft^3, Ti =75_ °F. ri, ro Inside and outside radii of toroid Solution: n=1.2224, Tf =164.1117_ °F. rw Radius of wire Isentropic Flow (5, 5) Reference: 3. The calculation differs at velocities below and above Mach 1. The Mach number is based on the speed of sound in the compressible fluid.

526 Equation Reference Equation Reference 531

Kinetic Theory (5, 8) Heat Capacity (6, 1) These equations describe properties of an ideal gas. Equations:

Equations: Q= m⋅ c ⋅ T Q= m⋅ c ⋅ () Tf– Ti

2 n⋅ MW ⋅ vrms 3⋅ R ⋅ T P = ------vrms = ------3⋅ V MW Example: 1 Given: λ = ------m= n⋅ MW T=15_ °C, Ti =0_ °C, m=10_kg, Q=25_kJ. n⋅ NA 2 2 ⋅π ⋅------ ⋅ d Solution: Tf =15_ °C, c=.1667_kJ/(kg ∗K) V  Example: Given: P=100_kPa, V=2_1, T=26.85_ °C, MW =18_g/gmol, d=2.5_nm. Thermal Expansion (6, 2) Solution: vrms =644.7678_m/s, m=1.4433E–3_kg, n=0.0802_gmol, λ=1.4916_nm.

Heat Transfer (6)

Variable Description α Expansion coefficient δ Elongation λ1, λ2 Lower and upper wavelength limits Equations: λmax Wavelength of maximum emissive power δ = α ⋅ L ⋅ T δ = α ⋅ L ⋅ ( Tf – Ti ) T Temperature difference

A Area Example: c Specific heat Given: T=15_ °C, L=10_m, Tf =25_ °C, δ=1_cm. eb12 Emissive power in the range λ1 to λ2 Solution: Ti =10_ °C, α=6.6667E–5_1/ °C. eb Total emissive power

f Fraction of emissive power in the range λ1 to λ2 Conduction (6, 3) h, h1,h3 Convective heattransfer coefficient k, k1, k2, k3 Thermal conductivity L, L1, L2, L3 Length m Mass Q Heat capacity q Heat transfer rate T Temperature

Tc Cold surface temperature (Conduction), or Cold fluid temperature Equations: Hot surface temperature, or k ⋅ A k⋅ A Th q =------⋅ T q = ------⋅ ()Th– Tc Hot fluid temperature (Conduction + Convection) L L

Ti, Tf Initial and final temperature Example: U Overall heat transfer coefficient Given: Tc=25_ °C, Th =75_ °C, A=12.5_m^2, L=1.5_cm, k=0.12_W/ (m ∗K) References: 7, 9. Solution: q=5000_W, T= 50_ °C.

528 Equation Reference Equation Reference 529

Circular Ring (11, 5) Define Error You can not do this operation in a DEFINE ARM register expected No comments. ARM invalid imediate In ARM mode, constants must be representable on 8 bit with an even number of rotation

Links Links are secondary source files that MASD can be directed to compile (equivalent to the {$I} directive in Pascal and #include in C). As there is no linking phase with MASD (like in C), a multi source project will usually have the form of a main source file that contains a certain number of links.

Equations: An example of main source would be: " π 4 4 A = π ⋅ ()ro2 – ri2 I = --- ⋅ ()ro – ri 'Constant_definition 4 'initialization π 4 4 2 J = --- ⋅ ()ro – ri Id= I+ A⋅ d 'graphic_functions 2 'other @" Example: When a link call is encountered, MASD suspends compilation of the current source, compiles the new source and Given: ro =4_ , ri =25.0 Å, d=.1_mil. then continues compiling the first one. Solution: A=3.0631E–7_cm^2, I=1.7038E–10_mm^4, J=3.4076E–10_mm^4, Id =3.0648E–10_mm^4. Program and data in the final object will be in the order in which MASD encounters the links.

Syntax in ASM and ARM mode:

'FileName links the file called FileName. Triangle (11, 6) Syntax in RPL mode: INCLUDE FileName links the file called FileName. Notes: 1. A link can call other links 2. You can not use more than 64 links in your project 3. To know how MASD looks for files, see the File search section 4. Links are useful to cut projects in independent parts to allow fast and easy access to source code 5. It is beneficial to place all constants definitions at the beginning of the compilation process as this will speed up Equations: compilation and give more flexibility b⋅ h 2 2 2 2 A = ------P= b+ v +h + () b– v + h 2 Labels 3 b⋅ h b⋅ h 2 2 Ix = ------Iy = ------⋅ ()b –b ⋅ v + v A label is a marker in the program. The principal use of labels is to determine jump destinations. 36 36 b⋅ h 2 2 2 2 A label is a set of less than 64 characters other than space, ‘ +’, ‘ ’, ‘ *’ and ‘ /’. A label begins with a star ‘ *’ and J = ------⋅ ()h +b –b ⋅ v + v Id= Ix+ A⋅ d 36 ends with a separation character.

Example: Syntax in ASM and ARM mode: *BigLoop is the BigLoop label declaration. Given: h=4.33012781892_in, v=2.5_in, P=15_in, d=2_in. Syntax in RPL mode: Solution: b=5.0000_in, Ix =11.2764_in^4, Iy =11.2764_in^4, J=22.5527_in^4, A=10.8253_in^2, LABEL BigLoop is the BigLoop label declaration. Id =54.5776_in^4. Be careful about upper and lower cases! Three types of labels can be used: • Global labels A global label is a label that can be used everywhere in the project, like global variables in Pascal or C. • Local labels

546 Equation Reference The Development Library 613

Cylinder (12, 2) MASD – The Machine Language and System RPL Compiler MASD is used for compiling assembly language and System RPL.

Introduction

Warnings The operating system can not control what a low level program is doing. Therefore, any programming error is likely to cause the calculator to crash (with potential memory loss). A careful developer will always save source code in the internal flash ROM or port 1 for protection before trying low level programs.

Equations: This document does not intend to be a programming course — it just presents the syntax of the compiler. Ample resources are available on the web ( www.hpcalc.org ) to learn how to program the Saturn CPU in assembler, how to 2 V = π ⋅r2 ⋅ h A= 2 ⋅π ⋅ r + 2 ⋅π ⋅r ⋅ h program in System RPL or how to program in ARM assembly.

1 2 1 2 1 2 With the introduction of the new ARM based series of calculators, some new things have been included that are not Ixx = --- ⋅m ⋅ r + ------⋅m ⋅ h Izz = --- ⋅m ⋅ r 4 12 2 backward compatible with previous calculators. The careful programmer should be wary of this. Id= Ixx+ m⋅ d2 Starting MASD Example: To compile a program, put the source code on the level 1 of the stack and type ASM (the development library Given: r=8.5_in, h=65_in, m=12000_lbs, d=2.5_in. must be attached) or use the ASM menu of the Development library. Solution: V=14753.7045_in^3, A=3925.4200_in^2, Izz =4441750_lb ∗in^2, Izz =433500_lb ∗in^2, If you have a new version of MASD packaged as a library 259, the command to type is asm (note the lowercase). Id =4516750_lb ∗in^2. Modes Parallelepiped (12, 3) MASD can be used to compile program in 3 different languages: Saturn ASM, ARM ASM and System RPL. Although some things are common to all modes, some are not. As a programmer, you should always know the current mode. Compilation directives instructions are used to switch from one mode to another: !ASM (switch to Saturn ASM mode, referred in the rest of this document as the Saturn mode) !RPL (switch to System RPL mode) !ARM (switches to ARM ASM mode) In addition, in RPL mode, CODE % here we are in ASM mode ENDCODE Equations: Allows switching from RPL mode to Saturn mode (and generate an assembly program object) V= b⋅ h ⋅ t A= 2⋅ () b⋅ h +b⋅ t + h⋅ t 1 2 2 2 Syntax I = ------⋅ m()h + t Id= I+ m⋅ d 12 MASD expects a character string (called source) on the stack level 1. A source is a set of instructions, comments, Example: and separation characters and ends with a carriage return and an @ character. MASD is case sensitive, so be careful, as «loop» and «LOOP» are two different things for MASD. Separation characters are those with an ASCII Given: b=36_in, h=12_in, t=72_in, m=83_lb, d=7_in. number below 32. They include spaces, tabs, line feed and carriage return. Solution: V=31104_in^3, A=7776_IN^2, I=36852_lb ∗in^2, Id =40919_lb ∗in^2. In Saturn mode, some instructions need a parameter. Separation characters between an instruction and the parameter are spaces, tabs, and points. Therefore A+B.A can be used instead of A+B A . In ARM mode, parameters for the instruction are separated by spaces and commas. In Saturn or ARM mode, comments can be placed everywhere and begin with % or ; and finish at the end of the current line. In RPL mode, comments are delimited by ‘ (’ ‘ )’ as isolated characters and can be multi line. A line that starts with a ‘ *’ on the first character will also be considered a comment.

548 Equation Reference The Development Library 611

Example: « » →S2 returns "!NO CODE !RPL :: x« x» ; @" .

Solid State Devices (13) XLIB~ Description: XLIB conversion command: Convert reals to an XLIB and vice versa. Variable Description Input/Output: αF Forward commonbase current gain Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 αR Reverse commonbase current gain n m → Xlib γ Body factor #n n → Xlib λ Modulation parameter n #n → Xlib n Electron mobility #n #m → Xlib φp Fermi potential Level 1/Argument 1 Level 2/Item 1 Level 1/Item 2 Xlib → n m L Length adjustment (PN Step Junctions), or Channel encroachment (NMOS Transistors) Example 1: #314h #40h XLIB~ returns ZEROS . Example 2: 1648 2 XLIB~ returns XLIB 1648 2 . W Width adjustment (PN Step Junctions), or Width contraction (NMOS Transistors) Example 3: { SYLVESTER } OBJ→ DROP XLIB~ returns 788. 78. .

a Channel thickness Aj Effective junction area CRLIB – Create Library Command BV Breakdown voltage A library is one of the most complex objects in the calculator. One of the basic uses of a library is to group all the Cj Junction capacitance per unit area files of an application. Cox Silicon dioxide capacitance per unit area In order to create a library, you must store in a directory all the variables that will be part of this library. Then, you must store configuration information in some special variables. E1 Breakdownvoltage field factor The $TITLE variable must contain a character string defining the title of the library. This string must be less than Emax Maximum electric field 256 characters long. The first five characters will be used for the name that is shown in the library menu. G0 Channel conductance The $ROMID variable must contain the library number or your library. This number must be in the range 769 to gds Output conductance 1791. In order to avoid conflicts, you should go to www.hpcalc.org to check whether the number is already in use. This variable may contain either a real or an integer. gm Transconductance The $CONFIG variable contains the library configuration object which is run at warmstart. The basic action that I Diode current this program should perform is to attach the library to the home directory. Placing a real or an integer in the IB Total base current $CONFIG variable will cause the CRLIB command to generate a default CONFIG object. This program must IC Total collector current leave the stack intact and is not allowed to produce errors. ICEO Collector current (collectortobase open) The $VISIBLE variable contains a list of all the variables in the current directory that you want to have visible in the library menu. ICO Collector current (emittertobase open) The $HIDDEN variable contains a list of all the variables in the current directory that you want to have invisible in ICS Collectortobase saturation current the library. They are generally subprograms of your application. ID, IDS Drain current The $EXTPRG variable contains the name of the extension program of the library. This program must be either a IE Total emitter current visible or an hidden object of the library. See the Extension program section below for more information. IES Emittertobase saturation current Then, once you have specified the required variables, you can type CRLIB to create the library. IS Transistor saturation current CRLIB places the library on level 1 of the stack. J Current density

550 Equation Reference The Development Library 69

PN Step Junctions (13, 1) POKEARM These equations for a silicon PNjunction diode use a “twosided stepjunction” model–the doping density changes Description: Memory write command: Writes bytes to a specified address in the ARM memory address space. abruptly at the junction. The equation assume the current density is determined by minority carries injected across You can not write data in the Flash ROM using this command. the depletion region and the PN junction is rectangular in its layout, The temperature should be between 77 and 500 Writing data in memory randomly can cause all memory to be lost. K. (See “SIDENS” in Chapter 3.) Input/Output: Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1 #n “string” → Example: #7300000h "00804421" POKEARM writes the given four bytes to ARM memory address 0x7300000.

→→→PRG Description: Create program command: This is equivalent to the RPL →LIST command, but it creates a program object. Equations: This command will also convert a symbolic or a list to a program object. k ⋅ T N A ⋅ N D Input/Output: V b i = ------⋅ L N  ------  2  q n i Level n+1 /Argument 1 Level 2/Argument n Level 1/Argument n+1 Level 1/Item 1

obj 1 … obj n n → obj 1, ...,obj n 2 ⋅ ε s i ⋅ ε 0 1 1 x d = ------⋅ ( V b i – V a ) ⋅  ------+ ------ q  NA ND {obj 1, ...,obj n} → obj 1, ...,obj n ε s i ⋅ ε 0 2 ⋅ ( V b i – V a ) C j = ------E m a x = ------obj 1, ...,obj n → obj 1, ...,obj n x d x d q ⋅ Va « 3 2 + » 5 →PRG « 3 2 + » 2 ------Example 1: , , , , , returns . ε s i ⋅ ε 0 ⋅ E 1 1 1  k ⋅ T  B V = ------⋅  ------+ ------ J = J s ⋅  e – 1 { 3 2 + } →PRG 3 2 + 2 ⋅ q  N A N D   Example 2: returns .

A j = ( W + 2 ⋅ W ) ⋅ ( L + 2 ⋅ L ) →→→RAM 2 π ⋅ ( W + L + 2 ⋅ W + 2 ⋅ L ) ⋅ x j + 2 ⋅ π ⋅ x j Description: Improved NEWOB command: Makes a copy of an object in RAM, wherever the object is. I = J ⋅ A j This command allows you to copy a ROM object into RAM. Input/Output: Example: Level 1/Argument 1 Level 1/Item 1

Given: ND =1E22_cm^–3, NA =1E15_1/cm^3, T=26.85_ °C, Js =1E–6_ A/cm^2, Va =20_V, obj 1 → obj 2 E1 =3.3E5_V/cm, W=10_ , W=1_ , L=10_ , L=1_ , xj =2_ . Example: { SIN } OBJ→ DROP →RAM returns External … External .

Solution: Vbi =.9962_V, xd =5.2551_ , Cj =2005.0141_pF/cm^2, Emax =79908.5240_V/cm, BV =358.0825_V, R~SB J= 1.0E–12_A/cm^2, Aj =3.1993E–6_cm^2, I = 3.1993E–15_mA. Description: Real to system binary conversion command: Converts a system binary to a real and a real to a system binary. Input/Output: Level 1/Argument 1 Level 1/Item 1 n → ¤n integer → ¤n ¤n → n Example: 4893 R~SB returns ¤ 131Dh .

SB~B Description: Binary integer to system binary conversion command: Converts a system binary to a binary integer and a binary integer to a system binary.

552 Equation Reference The Development Library 67

Input/Output:

Bipolar Transistors (13, 3) Level 1/Argument 1 Level 1/Item 1 “string” → obj These equations for an NPN silicon bipolar transistor are based on largesignal models developed by J.J. Ebers and "8BA207CA93B2130" H→ π J.L. Moll. The offsetvoltage calculation differs depending on whether the transistor is saturated or not. The Example: returns . equations also include the special conditions when the emitterbase or collectorbase junction is open, which are convenient for measuring transistor parameters. →→→H Description: Object to hex command: Returns the hex representation of a object. Input/Output: Level 1/Argument 1 Level 1/Item 1 obj → “string” Example: π →H returns "8BA207CA93B2130" .

H→→→A Description: String to address command: Returns the address represented by a 5 character hex string. The hex representation of an address is a 5 character string where the address is written backwards. Input/Output: Level 1/Argument 1 Level 1/Item 1 Equations: “string” → obj q------⋅ VBE ------q⋅ VBE "C75A3" H→A #3A57Ch k⋅ T  k⋅ T  Example: returns . IEIES= –⋅ e – 1  + αR⋅ ICS ⋅  e – 1      H→→→S ------q⋅ VBC q------⋅ VBE k⋅ T  k⋅ T  ICICS= –⋅ e – 1  + αF⋅ IES ⋅  e – 1  Description: Hex to string command: Returns the string whose data are represented by a hex string.     A hex string is a string that only contains the characters ‘0’ to ‘9’ and ‘A’ to ‘F’. IS = αRIES⋅ IS = αRICS⋅ IBIEIC+ += 0 Input/Output: ICO ICO= ICS⋅ () 1 – αF ⋅ αR ICEO = ------Level 1/Argument 1 Level 1/Item 1 1 – αF “string 1” → “string 2” IC 1 + ------⋅ ()1 – αR  k⋅ T IB  Example: "15" S→H returns "Q" . VCEsat = ------⋅ LN------ q IC 1 – αF αR⋅  1 – ------⋅ ------   IB αF    LC~C Description: Long complex to complex conversion command: Converts a long complex to a complex and a Example: complex to a long complex. Given: IES =1E–5_nA, ICS =2E–5_nA, T=26.85_ °C, αF=.98, αR=.49, IC =1_mA, VBC = –10_V. Input/Output: Solution: VBE =0.6553_V, IS =0.0000098_nA, ICO =0.000010396_nA, ICEO =0.0005198_nA, Level 1/Argument 1 Level 1/Item 1 IE = 1.0204_mA, IB =0.0204_mA, VCEsat =0_V. (x,y) → (x.Ey,z.Et) (x.Ey,z.Et) → (x,y) JFETs (13, 4) Example: (3.5,26.2) LC~C returns (3.5E0,2.62E1) .

These equations for a silicon Nchannel junction fieldeffect transistor (JFET) are based on the singlesided step LR~R junction approximation, which assumes the gates are heavily doped compared to the channel doping,. The drain Description: Long real to real conversion command: Converts a long real to a real and a real to a long real. current calculation differs depending on whether the gatejunction depletionlayer thickness is less than or greater Input/Output: than the channel thickness. The equations assume the channel is uniformly doped and end effects (such as contact, Level 1/Argument 1 Level 1/Item 1 drain, and source resistances) are negligible. (See “SIDENS” in Chapter 3.) x → x.Ey integer → x.Ey x.Ey → x

554 Equation Reference The Development Library 65

ARM→ Stress Analysis (14) Description: MASD ARM assembly disassembler command: Disassembles a Code object or a range of memory addresses containing ARM machine language to produce the assembly language source Variable Description code. δ Elongation Read later in this chapter for more details. Input/Output: ∈ Normal strain Level 1/Argument 1 Level 1/Item 1 γ Shear strain "string " → obj Code ARM→ " ADD R0 R0 R0 MOV R0 R1 @" φ Angle of twist Example: might return .

σ Normal stress ASM Description: MASD assemble/compile command: Compiles a string containing System RPL, Saturn assembly, σ1 Maximum principal normal stress or ARM assembly code into an object that the calculator can use. σ2 Minimum principal normal stress Read later in this chapter for details on the format of the string. σavg Normal stress on place of maximum shear stress Input/Output: σx Normal stress in x direction Level 1/Argument 1 Level 1/Item 1 string → obj σx1 Normal stress in rotatedx direction " " Level 1/Argument 1 Level 2/Item 1 Level 1/Item 2 σy Normal stress in y direction "string " → obj "debug string " σy1 Normal stress in rotatedy direction "string " → "string " {error list} τ Shear stress Example: "!NO CODE !RPL :: x« x» ; @" ASM returns « » . τ max Maximum shear stress ASM→ τ x1y1 Rotated shear stress Description: MASD Saturn assembly disassembler command: Disassembles a Code object or a range of memory addresses containing Saturn machine language to produce the assembly language source τ xy Shear stress code. Read later in this chapter for more details. θ Rotation angle Input/Output: θp1 Angle to plane of maximum principal normal stress Level 1/Argument 1 Level 1/Item 1 → θp2 Angle to plane of minimum principal normal stress Code "string " Example: Code ASM→ might return " D0=A D0+5 C=DAT0 A R0=C A" . θ s Angle to plane of maximum shear stress A Area BetaTesting Description: Test string command: Returns a string useful for testing purposes. E Modulus of elasticity Input/Output: G Shear modulus of elasticity Level 1/Argument 1 Level 1/Item 1 J Polar moment of inertia → “string” Example: BetaTesting returns "Sébastien Eric John…" . L Length

P Load CD →→→ Description: Code to hex command: Returns the hex representation of a code (Assembly program) object. r Radius Input/Output: T Torque Level 1/Argument 1 Level 1/Item 1 Reference: 2. Code → “string” Example: Code CD→ may return "8F507621301641468…" .

556 Equation Reference The Development Library 63 6

6. The Development Library

Introduction

Equations: Built into the calculator is a set of functions not accessible to the user by default. These functions are in a library that contains low level development tools mainly designed for use in developing System RPL and assembly σ x + σ y σ x – σ y σ x 1 = + ⋅ C OS (2 ⋅ θ ) + τ x y ⋅ S IN(2 ⋅ θ ) 2 2 programs. σ x 1 +σ y 1 = σ x + σ y In order to enable this library, you must attach it with the command 256 ATTACH or by setting flag –86. When the library is attached after the next warmstart (or reset), it appears in the APPS menu. You may reset the calculator by σ x –σ y τx 1 y 1 = –  ⋅ S IN( 2 ⋅ θ ) + τx y ⋅σ y  2  pressing $and C at the same time.

Example: Note: The tools and programs in this library are extremely Given: σx=15000_kPa, σy=4755_kPa, τ xy =7500_kPa, θ=30_°. powerful, and misusing them will cause memory loss . Solution: σx1 =18933.9405_kPa, σy1 =821.0595_kPa, τ x1y1 = 686.2151_kPa.

Mohr’s Circle (14, 4) Back up your calculator before trying these commands.

Equations:

σ x + σ y σ x – σ y 2 σ 1 = ------+ ------+ ρx y 2 2 σ 1 + σ 2 = σ x + σ y τ x y S I N ( 2 ⋅ θ p 1 ) = ------σ x – σ y 2 2  ------ + τ x y  2  σ 1 – σ 2 θ p 2 = θ p 1 + 90 τ m a x = ------2 σ x + σ y θ s = θ p 1 – 45 σ a v g = ------2

Example: Given: σx=5600_psi, σy=18400_psi, τ xy =4800_psi. Solution: σ1= 4000_psi, σ2= 20000_psi, θp1 =18.4349_°, θp2 =108.4349_°, τ max =8000_psi, θs= 26.5651_°, σavg = 12000_psi.

558 Equation Reference Equation Reference 61

References Sound Waves (15, 3) 1. Dranchuk, P.M., R.A. Purvis, and D.B. Robinson. “Computer Calculations of Natural Gas Compressibility Equations: Factors Using the Standing and Katz Correlation,” In Institute of Petroleum Technical Series , no. IP 74008. 1974. B 1 2 2 v = I = ⋅ ρ ⋅ v ⋅ ω ⋅ s m 2. Gere, James M., and Stephen P. Timoshenko. Mechanics of Materials , 2d ed. PWS Engineering, Boston, 1984. ρ 2 3. Halliday, David, and Robert Resnick. Fundamentals of Physics , I β = 10 ⋅ LOG  ω = 2 ⋅ π ⋅ f  10  3d ed. John Wiley & Sons, 1988. 4. Meriam, J. L., and L. G. Kraige. Engineering Mechanics , 2d ed. John Wiley & Sons, 1986 Example: 5. Muller, Richard S., and Theodore I. Kamins. Device Electronics for Integrated Cicuits , 2d ed. John Wiley & Sons 1986. Given: sm =10_cm, ω=6000_r/s, B=12500_kPa, ρ=65_kg/m^3. 6. Serghides, T. K. “Estimate Friction Factor Accurately,” In Chemical Engineering , Mar. 5, 1984. Solution: v=438.5290_m/s, I=5130789412.97_W/m^2, β=217.018_dB, f=954.9297_Hz. 7. Siegel, Robert, and John Howell. Thermal Radiation Heat Transfer , Vol. 1. National Aeronautics and Space Administration, 1968. 8. Sze, S. Physics of Semiconductors , 2d ed. John Wiley & Sons, 1981. 9. Welty, Wicks, and Wilson. Fundamentals of Momentum, Heat and Mass Transfer . John Wiley & Sons, 1969.

560 Equation Reference Equation Reference 561

• Entries from the EXTABLE may be used. As the EXTABLE does not have the label names limitations Messages Listed Alphabetically (continued) with operators, in ambiguous case ( DUP+#5 may either be an addition DUP + 5 , or an entry Message Meaning # (hex) ‘DUP+#5 ’), add "" around the word: "DUP"+#5 . • Calculations are done with 64 bits. Implicit ( ) off Implicit parentheses off. 207 • X divide by 0 = $FFFFFFFFFFFFFFFF. • In order to avoid wasting memory, MASD tries to compile expressions as soon as it sees them. If MASD Implicit ( ) on Implicit parentheses on. 208 is not able to compile an expression directly, it’s compiled at the end of the compilation. In order to use ™, ˜ or ` pressed before all function less memory, it’s a good idea to define your constants at the beginning of the sources so MASD can Incomplete Subexpression 206 compile expression using the constants directly. arguments supplied. • The only operator symbols not allowed in labels are +, , * and /; therefore, if you want to use a symbol Attempted unit conversion with Inconsistent Units B02 operator after a label, you must put the symbol between " in order to ‘limit’ the symbol. Meaningless incompatible units. Example: "DUP"<<5 . Math exception: Calculation such as 1/0 Infinite Result • A label/constant with strange char may be ‘protected’ between " chars. infinite result. 305 • The evaluation stack of MASD allows you to have around 10 pending computations (parenthesis, Matrix Writer application is inserting a operator priority). Inserting Column column. 506 • MASD only works with integers. You can represent signed values using standard 2’s complement, but be careful as all operators are unsigned. Inserting Row Matrix Writer application is inserting a row. 505

Not enough free memory to execute Insufficient Memory MASD recognizes the following operators: operation. 001

Operator Priority Notes A Statistics command was executed when << 7 Left Shift 1<<5 = $20 Insufficient Σ Data ΣDAT did not contain enough data points 603 >> 7 Right shift $20>>5 = 1 for calculation. % 6 Modulo (remainder of division) X%0=0 The HP Solve application or ROOT was * Interrupted 5 Multiplication interrupted by − A03 / 5 Division X/0=$FFFFFFFFFFFFFFFF + 4 Addition `returned object of wrong type for Invalid Array Element 502 4 Subtraction current matrix. < 3 Is smaller (true=1, false = 0) Machine does not recognize data on plugin Invalid Card Data > 3 Is greater (true=1, false = 0) card. 008 <=, ‰ 3 Is smaller or equal (true=1, false = 0) Date argument not real number in correct >=, Š 3 Is greater or equal (true=1, false = 0) Invalid Date format, or was out of range. D01 = 3 Is equal (true = 1, false = 0) Incorrect structure of equation argument #, ‹ 3 Is different (true = 1, false = 0) Invalid Definition for DEFINE. 12C & 2 Logical and ! 1 Logical or Invalid Dimension Array argument had wrong dimensions. 501 ^ 1 Logical xor Attempted operation from FCN menu Note: Throughout this documentation, you will see discussions about expressions that can be “immediately” when EQ did not contain algebraic, or, Invalid EQ evaluated. This refers to any expression that contains only number and labels/constants that have already been attempted DRAW with CONIC plot type 607 declared. when EQ did not contain algebraic.

Macros and includes IOPAR not a list, or one or more objects in Invalid IOPAR If data are to be included in a project, it can be entered in hex in a source file, using $. However, a simpler way is to list missing or invalid. C12 include data from an external file, called a macro. The macro file must be a character string, a graphic, a code object or a list. Invalid Mpar Mpar variable not created by MINIT. E401 - In case of a string or a code, MASD includes only the data part (after the length) of the object - In case of a graphic, only the graphic data will be included (no length, no dimensions)

616 The Development Library Error and Status Messages A3

!EVEN In absolute mode, cause an error if the directive is not on an even address. A !ADR MASD will generate a source defining all constants and labels used in the program instead of the program. !COMPEXP Cause MASD to calculate all previous expressions. A. Error and Status Messages !STAT Display/update compilation statistics !DBGINF Causes MASD to generate debugging information (see next The following table lists the most frequently encountered error and status messages on the calculator. They are section for more information) arranged alphabetically by name. The second table lists all the builtin messages numerically by message number. !JAZZ See local variable documentation in RPL mode Trailing spaces are indicated with a character. !MASD See local variable documentation in RPL mode Messages Listed Alphabetically The !DBGINF directive Message Meaning # (hex) If you put the !DBGINF directive into a MASD source, the assembler not only generates your compiled object, but Acknowledged Alarm acknowledged. 619 it also returns a string (on level 1) full of debug information. The structure of this string is as No unknowns to solve for. follows: All Variables known E405

5 DOCSTR Autoscaling Calculator is autoscaling x and/or y axis. 5 Length 610

Indicates Server mode active. 5 Number of links (source files) Awaiting Server Cmd. C0C n*[ 2 Number of characters One or more stack arguments were incorrect .. Name of link file Bad Argument Type type for operation. 202 ]

Bad Argument Value Argument value out of operation’s range. 5 Number of symbols (labels and constants) 203 n*[ 2 Number of characters Guess(es) supplied to HP Solve application or .. Name of symbol Bad Guess(es) ROOT lie outside domain of equation. A01 1 Type: 9=Label 2=Constant for labels: 5 Address of label for constants: 16 Value of constant Formula is invalid or incomplete. Look for Bad Molecular Formula ] mismatched parentheses or invalid element E501 names. 5 Number of source→code associations Computed packet checksum doesn’t match n*[ Bad Packet Block check checksum in packet. C01 5 Offset in code (this list is sorted by offset) 2 Number of link this instruction comes from 5 Character offset in link where this instruction starts Attempted to edit a string containing character Can't Edit Null Char. ] ā (character code 0). 102

Notes: Attempted to store a variable name into itself. Circular Reference 129 • If the source string is unnamed, i.e. in TEMPOB, the number of links is 00001 and the number of characters is 00, immediately followed by the symbol table. Connecting Indicates verifying IR or serial connection. • The label symbol table is supposed to be an offset table. However the current MASD may sometimes place C0A addresses into this table. The “associations” table correctly contains offsets. HP Solve application or ROOT returned same This instruction is intended for the case where someone decides to create a source level debugger. value at every sample point of current Constant? A02 equation.

618 The Development Library Error and Status Messages A1

Other notes You should read documentation on the internal structure of RPL objects ( www.hpcalc.org has good Disassemblers documentation) D0, D1, Ba and Da are used by the system (next RPL instruction pointer, RPL stack pointer (@@object on level 1 ASM →→→ of the stack), start of free memory and free memory in 5 blocks). The SAVE instruction will save these The ASM→ disassembler converts Saturn assembly into a source string. registers in dedicated memory areas, the LOADRPL instruction will restore them and continue the execution in the system. The syntax used is MASD syntax, in mode 015. Each line contains an address and an instruction. If the system flag –71 is set (with 71 SF ), addresses are not shown, except for the destinations of jumps. In this case, the resulting Please consult documentation on memory mapping for more information. source may be then reassembled if needed. New instructions ASM→ can either disassemble a CODE object or the memory area between 2 given addresses (as binary integers). In addition to the F fields, the following new instructions have been created: Example: 71 CF2 71 SF2 r=s.f, r=r+s.f, r=rs.f, r=r*s.f, r=r/s.f, r=r%s.f (modulo) r=s1.f (logical not), r=s.f (mathematical not), (default) AE734 GOSBVL 0679B GOSBVL 0679B r=rs.f (right shift), r=r^s.f (logical xor). AE73B LC 01000 LC 01000 r=1.f (alias for r=r/r.f) has also been created. AE742 CA A *AE742 AE744 GONC AE742 CA A Notes: AE747 GOVLNG 138B9 GONC AE742 GOVLNG 138B9 1. Any combination of the A, B, C and D registers can be used (notated r and s here)

2. All fields (including F1F7 fields) are valid 3. MASD will always choose the shortest version of the instruction (e.g.: A=A+B.A will use the standard C0 Level 2 Level 1 → Level 1 encoding AND affect the carry) Binary integer (start address of the Binary integer end → String (disassemble between 4. The carry is not affected by these instructions. memory area to disassemble) address the 2 address) Code object → String The following additional new instructions have been added (see description in the ASM syntax section):

NATIVE? $hex GOSLOW REMON CONFIGD ARM →→→ HST=1.x WSCREEN SERIAL BIGAPP? ?HST=1.x { } SETTIME OUTBYT RESETOS The ARM→ disassembler converts ARM assembly into a source string. SETFLD(17) SETLNED MOVEUP REFRESHD OFF SETOFFD MOVEDN AUTOTEST Each line contains an address and an instruction. If the system flag –71 is set (with 71 SF ), addresses are not RPL2 HSCREEN ARMSYS ACCESSSD shown, except for the destinations of jumps. In this case, the resulting source may be then reassembled if needed. KEYDN UNCNFGD ARMSAT PORTTAG? CRTMP GETTIME REMOFF MIDAPP? ARM→ can either disassemble a CODE object (which does not make much sense at this point in time) or the BEEP2 memory area between 2 given Saturn addresses (as binary integer). Skips Example: 71 CF2 (default) 71 SF2 Skips are a first step from ML to a third generation language, even if they are only another way to write ASM 874FF LDMGEIA R0 ! { R5 R6 R7 LP PC } LDMGEIA R0 ! { R5 R6 R7 LP PC } instructions. 87507 STMDB R5 { R5 R12 PC } STMDB R5 { R5 R12 PC } 8750F BL 87527 BL 876E3 Skips are wonderful as they allow you to: 87517 BLGE 87527 BLGE 876E3 - structure your program 8751F BGE 87527 BGE 876E3 - avoid using gotos 87527 ADD R0 R0 R0 *876E3 8752F MOV R0 R1 ADD R0 R0 R0 - make programs and piece of code that can be easily copied and pasted (because there is no label) 87537 TST R4 R5 MOV R0 R1 TST R4 R5 @

Level 2 Level 1 → Level 1 Binary integer (start address of the Binary integer end → String (disassemble between memory area to disassemble) address the 2 address) Code object → String

620 The Development Library The Development Library 641

Example of an ARM assembly language program using the MASD compiler

These instructions Are equivalent to "!NO CODE !RPL ( turn into RPL mode) { *.Beg3 :: ( open a RPL program ) { *.Beg2 TURNMENUOFF ( remove the menu line ) { *.Beg1 UP2 GOTO.Beg2 CODE UP3 GOTO.Beg3 % open an assembly program EXIT1 GOTO.End1 EXIT3 GOTO.End3 % this program takes control of the screen and } *.End1 % displays a Mandelbrot set using the standard algorithm } *.End2 % ie: for each point from x=1.5 to 0.5, } *.End3 % for each point from y=1 to 1 % if any an, n<256 in the series Notes: % a0=x+iy (complex number), an+1=a0+an² % has an absolute value > 2, the point is not part of the set 1. EXIT1 is equivalent to EXIT, and UP1 is equivalent to UP. % the numbers are stored on 32 bits. % the numbers are shifted by 12 bits, the lower 12 bits representing 2. The same rules apply in ARM mode: EXITGE3 for example is a BGE for the exit label 3 blocks down % the decimal part of the number (in 1/4096)

Using SKELSE, SKEC, SKENC, SKLSE instructions, two blocks create an IFNOTTHENELSE structure. SAVE % save the RPL pointers INTOFF % disable keyboard interrupts SKUB { % jump over the ARM code These Are equivalent to Or in highlevel *start instructions language ?A=0.A ?A=0.A GOYES.Beg2 IF NOT A=0 THEN !ARM % switch to ARM mode SKIPYES *.Beg1 BEGIN STMDB sp! {R4 R5 R6 R7 R8 LP} % save registers in the stack { GOTO.End2 % and not ... EXIT End1 ... LDR R2, [R1, #2324] % load R2=x (content of saturn UP GOTO.Beg1 END % reg B, 07) } *.End1 ELSE LDR R3, [R1, #2340] % load R3=y (content of saturn SKELSE GOTO.End2 BEGIN % reg B, nibbles 07) { *.Beg2 ... A+1.A A+1.A ... MOV R7 R2 % copy X in r7 EXIT GOTO.End2 ... MOV R8 R3 % copy Y in r8 UP GOTO.Beg2 END MOV R6 256 % copy 256 in R6 } *.End2 { Notes: MUL R4, R2, R2 % r4= x² << 12 MOV R4 R4 >> 12 % r4= x² 1. SKELSE places a GOTO between the 2 blocks, SKEC places a GOC, SKENC a GONC and SKLSE places MUL R5, R3, R3 nothing. MOV R5 R5 >> 12 % r5= y²

2. UP s are compiled directly when encountered while EXITs and block openings are compiled later on. You ADD LP R4 R5 % LP = x² + y² can not have more than 64 pending EXITs and block openings simultaneously. CMP LP $4000 % if abs² an > 4 EXITGT % exit

SUB R4 R4 R5 % r4= x²y² Tests MUL R3 R2 R3 % R3= X*Y A test instruction ( ?A=0.A ) may be followed by: • A GOYES Label , → Label or > Label instruction ADD R2 R7 R4 % r2= X + x²y² = new x

• A > { or → { instruction. In this case, the test is inverted and a skip block is open. MOV R3 R3 >> 11 % r3= x*y*2 • A RTY or RTNYES instruction. ADD R3 R8 R3 % r3= Y+2*x*y = new Y SKIPYES { { • A or instruction. In this case, a skip block is open. SUBS R6 R6 1 % decrement loop counter • A GOTO , GOTOL , GOVLNG , GOSUB , GOSUBL or GOSBVL . In this case, the test is inverted and a proper UPNE % up if not 0 jump instruction is generated (ie: ?A=B.A GOTO A is compiled as ?A#B.A { GOTO A } . % we have looped 256 times and abs(An)<2, the point is in the set! • A EXIT or UP . LDRB R6 [R1 2408] % clear the flag ST0 BIC R6 R6 1 STRB R6 [R1 2408] LDMIA sp! {R4 R5 R6 R7 R8 PC} % restore all registers and return

}

% we have reached a An where abs(An)>2,the point is out of the set

622 The Development Library The Development Library 639

Syntax Example Notes XxlibName XLIB identified by its name. If it is a standard calculator command Reg =Reg +Cst .f A=A+10.A Note 1: The Saturn processor is not able to add a constant greater than 16 (like xDUP ), the address is used instead of an XLIB object. Reg +Cst .f A+10.A to a register. If cst is greater than 16, MASD will generate as many HXS Size Data Binary integer ($02A4E), Size is in hexadecimal and Data is a set of Reg =Reg Cst .f A=A10.A instructions as needed. hexadecimal characters. Example: HXS 5 FFA21 Reg Cst .f AFOO.A Note 2: Even if adding constants to a register is very useful, large values should be avoided because this generates a large program. Prefer another GROB Size Data GROB ($02B1E). solution like LC(5) Cte A+C.A LIBDAT Size Data Library data ($02B88). Note 3: Adding a constant greater than 1 to a P, WP, XS or S field is a BAK Size Data Backup ($02B62). bugged Saturn instruction (problem with carry propagation). Use these instructions with care. LIB Size Data Library ($02B40). Note 4: After adding a constant greater than 16 to a register, the carry EXT3 Size Data Extended3 ($02BEE). should not be tested (because you do not know if the last generated ARRAY Size Data Array ($029E8). instruction generated the carry or not) Note 5: You can put an expression instead of the constant (MASD must be LNKARRAY Size Data Linked Array ($02A0A). able to evaluate the expression right away). If the expression is negative, MINIFON Size Data Minifont object MASD will invert the addition in a subtraction and vice versa. ARRY2 Size Data Note 6: Be careful when using subtraction; it’s easy to be misled. A56.A is Array object equivalent to A+1.A, not A11.A because the instruction is: A(56).A ARRY [ ... ] Array object, which can have 1 or 2 dimensions. ARRY [ [ . ] [ . ] ] Note 7: If using Fn fields, be careful if non nibble bounded masks are All objects in the array must be of same type used. xRplName If RplName is an RPL instruction, compiles the RPL instruction (or RegSR.f ASR.W Shift register right by 4 bit on the specified field, set SB if bits are lost. xlib depending on the instruction) Note: this instruction is not available on the Fn fields CHR character Character object. See rules on " for more information ASL.W RegSL.f Shift register left by 4 bit on the specified field, set carry if bits are lost. LABEL labelname Note: this instruction is not available on the Fn fields Creates a label at this position. Use carefully A=AReg2.f A=A>B.W Shift register right by n bits (as defined by the value of Reg2) on the fptrname Reg1>Reg2.f specified field CODE Size Data Code object ($02DCC). BSRB.X RegSRB.f Shift register right by 1 bit on the specified field, set SB if bits are lost. CODE Include a code object, change to ASM mode and close the code object RegSRC ASRC Circular right shift by 1 nibble Assembly stuff ENDCODE on the next ENDCODE. RegSLC BSLC Circular left shift by 1 nibble NIBB Size Data or Includes hexadecimal data directly (no prolog). Reg1=Reg1&Reg2.f A=A&B.X Logical and on the specified field NIBHEX Data or Reg1&Reg2.f A&C.B NIBBHEX Data or Reg1=Reg1!Reg2.f A=A!B.X Logical or on the specified field CON(Size) Expr Reg1!Reg2.f A!C.B INCLOB FileName Includes the content of the file FileName . INCLUDE FileName Includes the source of the file FileName to be compiled (Like ' in ASM Reg1=Reg1^Reg2.f A=A^B.X Logical xor on the specified field mode). Reg1^Reg2.f A^C.B LABEL label Defines a label (like * in ASM mode). Reg1=Reg1.f C=C.A Mathematical not on the specified field EQU CstName ExpHex Defines a constant (Like DC in ASM mode). Reg1=Reg11.f C=C1.A Logical not on the specified field Reg1=~Reg1.f C=~C.A EQUCP Interleave Defines a constant (Like DCCP in ASM mode). CstName RReg=Reg.f R0=A.W Sets the specified field of RReg to the value of the specified field of Reg DEFINE name ... Only A and C are valid for Reg. Associate the data compiled between the name and the end of the line If f is W, the shorter encoding of the instruction is used with the name. After that, if the name is used again, the associated data Reg=RReg.f A=R0.A Sets the specified field of Reg to the value of the specified field of RReg is placed in the compiled file Only A and C are valid for Reg. DIR Creates a directory containing the objects in the given variables. If f is W, the shorter encoding of the instruction is used VARNAME name1 obj1 VARNAME name2 obj2 RegRRegEX.f AR0EX.A Exchanged the value of the specified field of RReg with the value of the ... specified field of Reg Only A and C are valid for Reg. ENDDIR If f is W, the shorter encoding of the instruction is used Data=Reg.f DAT1=C.A Write the content of the specified field of the specified register in the Data=Reg.x DAT0=A.10 memory location pointed by Data register (POKE) Reg can only be A or C Reg= Data.f C=DAT1.A Read the content of the memory location pointed by Data register in the Reg Data.x A=DAT0.10 specified field of the REG register (PEEK) Reg can only be A or C

624 The Development Library The Development Library 637

Syntax Example Notes System RPL mode SB=1 See above. This is only valid in emulated Saturn XM=1 MASD can also compile System RPL programs (you should read the book “An Introduction to System RPL” SR=1 before trying to write System RPL programs). MP=1 HST=a The !RPL directive will switch MASD in RPL mode. ?SB=1 ?XM=1 Note: if the Flag –92 is set, MASD starts in !RPL and !NO CODE mode. ?SR=1 ?MP=1 Instructions ?HST=1.a P=a The HP ≠ character can be used instead of # In RPL mode, MASD interprets instructions/tokens in the following order. P=P+1 P+1 P=P1 P1 Reals and system binary ?P=a ?P#a P=C.a C=P.a If the instruction is a decimal number, a system binary is created (MASD will try, if possible, to use the internally CPEX.a defined system binary). If that number has a decimal point (in the middle, or starts with the decimal point), a real C=C+P+1 C+P+1 number is created. GOTO label GOTO is limited to 1KB jumps GOTOL label GOTOL can jump over 16KB of code GOLONG Lab Unnamed local variables GOVLNG hex This jumps to a specific address GOVLNG =Label If the instruction is a recall or a set of a local variables defined by {{ the correct instruction is generated. GOVLNG ="COMND" GOSUB label GOSUB is limited to 1KB jumps A local environment is created using: GOSUBL label GOSUBL is limited to 16KB jumps {{ var1 var2 ... varN }} with N<23 GOSBVL hex GOSBVL jumps to a specific address GOSBVL =Label These variables have names during compile time, but they are implemented as unnamed local variables, which are GOSBVL ="COMND" GO if Carry set (limited to 64 bytes) faster to access than named local variables. GOC label GO if no carry (limited to 64 bytes) GONC label Equivalent to SKNC { GOTO label } A local variable is recalled by typing its name or with an optional ending @. Data can be stored in a local variable by GOTOC label ! === GOTONC label Equivalent to SKC { GOTO label } typing its name, with a leading or ending or a leading . RTN Return from subroutine (GOSUB call) Notes: RTNSXM RTN + XM=1 RTNCC RTN + set carry 1. Local variables are available until the next local definition. RTNSC RTN + clear carry RTNC 2. The local environment is not closed automatically; use ABND or other provided words. RTNNC RTN if carry set RTI RTN if carry not set Example: Return from interrupt RTNYES RTY Return if test true (see test section) {{ label1 label2 … labelN }} will become: C=RSTK Pop value from RSTK in Ca ' NULLLAM <#N> NDUPN DOBIND (or 1LAMBIND if there is only one variable) RSTK=C Push value from Ca in RSTK And: OUT=CS Set the first 2 nibbles of the OUT register to the value of Cb OUT=C Set the OUT register to the value of C4 label1 → 1GETLAM A=IN Copy the IN register in Ax or Cx (buggy instruction, do not use if you do label1@ → 1GETLAM C=IN not know what you are doing) =label1 → 1PUTLAM SETDEC SETHEX Set the SPU in DECIMAL or HEXADECIMAL mode !label1 → 1PUTLAM UNCNGF CONFIG Deconfigure/Configure memory modules label1! → 1PUTLAM RESET Deconfigure ALL memory modules SHUTDN STOP the CPU waiting for an interrupt Program example: INTON INTOFF RSI Enable/disable keyboard interrupts :: :: Reset interrupt system {{ A B }} ' NULLLAM TWO NDUPN DOBIND LC(5)label& B A! 2GETLAM 1PUTLAM GOINC label Equivalent to . (& is the address of the instruction) ABND ABND GOINA label Equivalent to LA(5)label& (& is the address of the instruction) ; ; $hhh ... hhh Includes hexadecimal data in the program. Example: Note that it is your responsibility to destroy the local environment using ABND and that MASD does not handle NIBHEX hhh ... hh $12ACD545680B . multiple level of definition of local variables, nor does it destroy the current environment, even if ABND is used. $/ hhhh ... hhh Includes hexadecimal data in reverse order. Example: $/123ABC is equivalent to $CBA321 . Variables defined this way will be valid until a new set of variables is defined.

626 The Development Library The Development Library 635

Syntax Example Notes In all cases, Cte must be a decimal value or an expression that can be evaluated immediately. RPL2 Simulates a LOOP (A=DAT0.A D0+5 PC=(A)). KEYDN (C[A]) kbd peeks with immediate rtn CS if keydn. A_mode can be: Also Sets DOUSEALARM flag if [ON][9] sequence. Form Description Entry: P=0, HEX Mode, C[A]: #kbd peeks (loop count) [Rn +/Cte] Value of rn + or constant CRTMP Abstract: Creates a hole in the tempob area of the specified size [Rn +/Rm] Value of rn + or – value of rm + 6 (5 for the link field and 1 for marker nibble). [Rn +/Rm LSL Cte] Value of rn + or – value of rm shifted left Sets the link field of the “hole” to size+6 and adjusts [Rn +/Rm < Cte] AVMEM, RSKTOP and TEMPTOP. [Rn +/Rm LSR Cte] Value of rn + or – value of rm shifted right Entry Conditions: RPL variables in system RAM [Rn +/Rm > Cte] C(A) contains desired size of hole [Rn +/Rm ASR Cte] Value of rn + or – value of rm shifted arithmetically right Exit Conditions: carry clear, RPL variables in system RAM [Rn +/Rm >> Cte] D1 → link field of hole, D0 → object position [Rn +/Rm ROR Cte] Value of rn + or – value of rm rotated right B(A), C(A)= desired size+6 [Rn +/Rm >>> Cte] Error Exits: Returns with carry set when there’s not enough memory [Rn +/Cte]! Value of rn + or – constant to create a hole of size+6. Rn is updated with that value BEEP2 Entry: C[A]: d ;d=Beep duration (msec) [Rn +/Rm]! Value of rn + or – value of rm D[A]: f ;f=Beep frequency (hz) Rn is updated with that value P=0 [Rn +/Rm LSL Cte]! Value of rn + or – value of rm shifted left Exit: CARRY:0 [Rn +/Rm < Cte]! Rn is updated with that value REMON Enables the remote control mode (ON+R). [Rn +/Rm LSR Cte]! Value of rn + or – value of rm shifted right SERIAL Copy serial number to address pointed to by D1 in Saturn memory. [Rn +/Rm > Cte]! Rn is updated with that value OUTBYT Purpose: Send byte to IR printer [Rn +/Rm ASR Cte]! Value of rn + or – value of rm shifted arithmetically right Entry: A[B]: Byte [Rn +/Rm >> Cte]! Rn is updated with that value Exit: CC, P=0, Byte Sent [Rn +/Rm ROR Cte]! Value of rn + or – value of rm rotated right Alters: P:0, CARRY:0, SETHEX. [Rn +/Rm >>> Cte]! Rn is updated with that value MOVEUP Abstract: Used to move block of memory to higher address. [Rn] +/Cte The value used is the value of rn, but rn is then updated with Value of rn + or – No check is made to ensure that the source and destination do not overlap. constant Code is moved from high to low addresses. [Rn] +/Rm The value used is the value of rn, but rn is then updated with Value of rn + or – Entry Conditions: D0 → end of source + 1 value of rm D1 → end of destination + 1 [Rn] +/Rm LSL Cte The value used is the value of rn, but rn is then updated with Value of rn + or – C(A) = number of nibs to move (unsigned) [Rn] +/Rm < Cte value of rm shifted left Exit Conditions: HEX mode, P=0, carry clear [Rn] +/Rm LSR Cte The value used is the value of rn, but rn is then updated with Value of rn + or – D0 → start of source [Rn] +/Rm > Cte value of rm shifted right D1 → start of destination [Rn] +/Rm ASR Cte The value used is the value of rn, but rn is then updated with Value of rn + or – MOVEDN Abstract: Used to move block of memory to lower address. [Rn] +/Rm >> Cte value of rm shifted arithmetically right No check is made to ensure that the source and destination do not overlap. Code is moved from lower to higher addresses. [Rn] +/Rm ROR Cte Value of rn + or – value of rm rotated right [Rn] +/Rm >>> Cte Entry Conditions: D0 → start of source; D1 → start of destination; C(A) Rn is updated with that value = number of nibs to move (unsigned) Exit Conditions: P=0, carry clear; D0 → end of source + 1; D1 → end of ARMSAT instruction destination + 1 When using the ARMSAT instruction, the Saturn pc is in register r0 and the address chipset structure that contains ARMSYS Call a function at global dword address C[07]&~3. the state of the Saturn CPU is in r1. The function takes should be of the form: U32 f(U32 pc, Chipset* c) { /* put your code here */ return pc; } That structure has the following elements at the following offsets: ARMSAT Call a function at Saturn address C.A&~7. Offset Element The function should have the following format: U32 f(U32 pc, Chipset* c) { /* put your code here */ return pc; } 0 P_U32 read_map[256+1]; read_map[x] points on the 2Kb of Saturn address space at In RAM asm, this means that as you enter the function, pc is in R0, Saturn address x<<12 @Chipset is in R1 and the return address is in LP. R2 and R3 are free to 1028 P_U32 write_map[256+1]; read_map[x] points on the 2Kb of Saturn address space use, and R0 should normally not be modified except if you want to change at Saturn address x<<12 for write purpose (write_map[x]=0 if x points on some non the PC when exiting the function. readable memory) REMOFF Stops the remote control (ON+S). 2056 enum ModulePriority top_map[256+1]; // Type of block on top, to know if new GOSLOW Wait for (C[A]/183) ms. configured block takes over WSCREEN Return how many columns the screen contains in Ca 2316 REG A; SETTIME Sets the RTC time from C[W] in ticks. 2324 REG B; SETLNED Set number of lines of disp0 from C[B], refresh display.

628 The Development Library The Development Library 633

ARM mode Instruction set Note: For instruction names, the case does not matter. ARM architecture Register names are: For all user intents and purposes the ARM CPU has sixteen 32 bit registers noted R0 to R15 (R15 is also the R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13 (or SP), R14 (or LP or LR) and R15 (or PC). program counter, R14 is the link register (ie: a BL (GOSUB) instruction copies the return address in R14 before jumping, a Return From Subroutine is performed by doing MOV PC, LR), and R13 is the Stack pointer). Setting the S flag on an instruction causes the instruction to modify the flags. Each instruction can be conditionally executed depending on the value of 5 flags. Every instruction is evaluated ONLY if the attached condition is true. By default, the instruction is always evaluated. Each instruction can be told to modify or not modify these 5 flags (add the S suffix to the instruction). Separation between arguments can be either ‘,’ or spaces. Please read the ARM ARM (ARM Architecture and Reference Manual) for more information. In the following examples, cond can be any of:

Please look at the ARMSAT Saturn instruction and the ARM mode documentation to see the instruction set and the EQ NE CS CC MI PL VS VC HI LS GE LT GT LE rules of calling ARM code from Saturn code. HS LO Equal equal Not >= unsigned set, Carry < clear Carry Negative 0 or Positive Overflow overflow No > Unsigned <= Unsigned >= <= > <=

Skips Skips are a first step from ML to a third generation language, even if they are only another way to write ASM

instructions.

Skips are wonderful as they allow you to: - structure your program - avoid using gotos And Oprnd can be of the form: - make programs and piece of code that can be easily copied and past (because there is no label) Description Form The foundation of Skips is the Block structure. Immediate value Cte A block is enclosed in { and }, and can be nested within another block. Note: cte is encoded on 8 bits + a rotation right encoded The following instructions deal with blocks. on 4 bits. This means that not every value is possible. Logical shift left Rm LSL Cte SKIPS instructions Equivalents Rm < Cte { ... } Defines a block (generates no code) Logical shift right Rm LSR Cte SK { ... } B .S ... *.S Rm > Cte Arithmetic shift right Rm ASR Cte SKUB { ... } BL .S ... *.S Rm >> Cte Rotate right Rm ROR Cte Once blocks are defined, special instructions can be used in them. The instructions called EXIT and UP allow Rm >>> Cte jumping to the end or to the beginning of a block. Register Rm Logical shift left Rm LSL Rs These instructions are equivalent to Rm < Rs { *.Beginning Logical shift right Rm LSR Rs EXIT B .End Rm > Rs UP B.Beginning } *.End Arithmetic shift right Rm ASR Rs Rm >> Rs

Rotate right Rm ROR Rs EXIT and UP can jump to the beginning or to the end of an upperlevel block by specifying the number of blocks Rm >>> Rs to exit, after the UP or EXIT instructions. These instructions Are equivalent to { *.Beg3 { *.Beg2 { *.Beg1 UP2 B .Beg2 UP3 B .Beg3 EXIT1 B .End1 EXIT3 B .End3 } *.End1 } *.End2 } *.End3

Note: EXIT1 is equivalent to EXIT, and UP1 is equivalent to UP.

630 The Development Library The Development Library 631

Messages Listed Alphabetically (continued) Messages Listed Numerically (continued) Message Meaning # (hex) # (hex) Message BA4D 2400 NonEmpty Directory Attempted to purge nonempty directory. 12B BA4E 4800 Execution of HP Solve application, ROOT, BA4F 9600 NonReal Result DRAW, or ∫ returned result other than real 12F USB number or unit. BA50 Execution of HP Solve application, ROOT, BA51 Serial NonReal Result DRAW, or ∫ returned result other than real 12F Statistics Prompts number or unit. BB01 1.Singlevar… Alarm list did not contain alarm specified Nonexistent Alarm BB02 2.Frequencies… by alarm command. D04 BB03 3.Fit data… Statistics command executed when ΣDAT Nonexistent ΣDAT BB04 4.Summary stats… did not exist. 602 BB05 SINGLEVARIABLE STATISTICS Attempted PURGE or STO into a backup BB06 ΣDAT: Object In Use 009 object when its stored object was in use. BB07 Type: BB08 Mean Attempted to access a nonexistent backup Object Not in Port object or library. 00C BB09 Std Dev BB0A Variance Function value, root, extremum, or BB0B Total ( OFF SCREEN ) intersection was not visible in current 61F display. BB0C Maximum Minimum One or more objects must be purged to BB0D Out of Memory 135 continue calculator operation. BB0E Enter statistical data Enter variable column Math exception: Calculation returned result BB0F Overflow 303 greater in absolute value than MAXR. BB10 Choose statistics type Indicates packet number during send or BB11 Calculate mean? Packet # C10 receive. BB12 Calculate standard deviation? Received bytes’ parity bit doesn’t match Calculate variance? Parity Error C05 BB13 current parity setting. BB14 Calculate column total? Plot Type: Label introducing current plot type. 61D BB15 Calculate column maximum? Possible I/R or serial hardware failure. Run BB16 Calculate column minimum? Port Closed C09 selftest. BB17 Sample Used a port command on an empty port, or BB18 Population one containing ROM instead of RAM. FREQUENCIES Port Not Available 00A BB19 Attempted to execute a server command BB1A XMin: that itself uses the I/O port. BB1B Bin Count: Math exception: Calculation returned Bin Width: Positive Underflow 301 BB1C positive, nonzero result less than MINR. BB1D Enter minimum first bin X value Calculator turned on following a power BB1E Enter number of bins Power Lost 006 loss. Memory may have been corrupted. BB1F Enter bin width Indicates processing of host command BB20 FIT DATA Processing Command C11 packet. BB21 XCol:

A6 Error and Status Messages Error and Status Messages A35

Messages Listed Alphabetically (continued) Messages Listed Numerically (continued) Message Meaning # (hex) # (hex) Message The name supplied to CONST isn’t in the Undefined Constant E129 BA03 3.Print display Constants Library. BA04 4.Print… The element supplied to PTPROP doesn’t Undefined Element E502 5.Transfer… exist. BA05 BA06 6.Start Server Undefined FPTR Name Executed a Flash Pointer that did not exist. 011 BA07 Enter names of vars to send Executed or recalled local name for which BA08 Vars in Undefined Local Name 003 corresponding local variable did not exist. BA09 SEND TO CALCULATOR Executed or recalled global name for which BA0A Port: Undefined Name 204 corresponding variable did not exist. BA0B DblSpace The property number supplied to PTPROP BA0C Delay: Undefined Property E503 isn’t in the Periodic Table BA0D Xlat: Calculation such as 0/0 generated BA0E Linef Undefined Result 304 mathematically undefined result. BA0F Baud: The variable name supplised to BA10 Parity: Undefined TVM Variable TVMROOT isn’t N, I%YR , PV , PMT , or E607 BA11 Len: FV . BA12 Choose print port Executed an XLIB name when specified Undefined XLIB Name 004 BA13 Enter object(s) to print library absent. BA14 Print extra space between lines? Warning: Label introducing current status message. 007 BA15 Enter delay between lines BA16 Choose character translations Userdefined function evaluated with an BA17 Print linefeed between lines? Wrong Argument Count incorrect number of parenthetical 128 BA18 Choose baud rate arguments. BA19 Choose parity x and yaxis zoom. Identifies zoom option. 627 BA1A Enter printer line length BA1B PRINT x axis zoom. Identifies zoom option. 625 BA1C Type: x axis zoom OvrW w/AUTO. Identifies zoom option. 624 BA1D BA1E Fmt: y axis zoom. Identifies zoom option. 626 BA1F Chk: Result returned by the HP Solve application BA20 Choose transfer port or ROOT is a root (a point at which current ZERO BA21 Choose type of transfer equation evaluates to A04 BA22 Enter names of vars to transfer zero). BA23 Choose transfer format Identifies no execution action when BA24 Choose checksum type "" 61E %EXECS% pressed. BA25 Overwrite existing variables? BA26 TRANSFER

BA27 Local vars

A8 Error and Status Messages Error and Status Messages A33

Messages Listed Numerically (continued) Messages Listed Numerically (continued) # (hex) Message # (hex) Message 026 Invalid File Mode B99B 37 Doublespace prnt 027 Disk Full B99C 38 No linefeeds 028 Disk Format Error B99D 39 No I/O messages 029 Disk Change B99E 40 Show clock 02A No SD card inserted B99F 41 24hour clock 02B Not enough ARM memory B9A0 42 dd.mm.yy format 02C DOS call unsupported B9A1 43 Don't reschedule 02D DOS unknown error B9A2 44 Save alarm 02E Disk Protected B9A3 51 Fraction mark: , 101 No Room to Save Stack B9A4 52 Show one line 102 Can't Edit Null Char. B9A5 53 Show all parens 103 Invalid User Function B9A6 54 Use tiny element 104 No Current Equation B9A7 55 No last args 106 Invalid Syntax B9A8 56 Standard beep off 107 Real Number B9A9 57 Alarm beep off 108 Complex Number B9AA 58 Don't show INFO 109 String B9AB 59 Show names only 10A Real Array B9AC 60 [Œ] locks Alpha 10B Complex Array B9AD 61 [USR] locks User 10C List B9AE 62 User keys on 10D Global Name B9AF 63 Custom ENTER on 10E Local Name B9B0 65 Level 1 multiline 10F Program B9B1 66 Stk: 1 line str 110 Algebraic B9B2 67 Analog clock 111 Binary Integer B9B3 68 AutoIndent 112 Graphic B9B4 69 Infinite line edit 113 Tagged B9B5 70 →GROB x lines str 114 Unit B9B6 71 No addresses 115 XLIB Name B9B7 72 Stack:mini font 116 Directory B9B8 73 Edit:mini font 117 Library B9B9 74 Left stack disp 118 Backup B9BA 75 Key click on 119 Function B9BB 76 No purge confirm 11A Command B9BC 79 Textbook off 11B System Binary B9BD 80 EQW mini stk font 11C Long Real B9BE 81 GRB Alg mini font

A10 Error and Status Messages Error and Status Messages A31

Messages Listed Numerically (continued) Messages Listed Numerically (continued) # (hex) Message # (hex) Message 141 Symbolic Matrix B951 53 No extra parens 142 Font B952 54 Tiny element → 0 143 Aplet B953 55 Save last args 144 Extended Real B954 56 Standard beep on 145 Extended Complex B955 57 Alarm beep on 146 FlashPtr B956 58 Show INFO 147 Extended Ptr B957 59 Show variables 148 MiniFont B958 60 [Œ][Œ] locks 149 Extended 1 B959 61 [USR][USR] locks 14A Extended 2 B95A 62 User keys off 14B Extended 3 B95B 63 Custom ENTER off 14C YES B95C 65 All multiline 14D NO B95D 66 Stack:x lines str 14E TRUE B95E 67 Digital clock 14F FALSE B95F 68 No AutoIndent 150 Are you sure? B960 69 Line edit 151 Low Memory Condition B961 70 →GROB 1 line str Please Wait... B962 71 Show addresses Object Editing Messages B963 72 Stack:current fnt 152 CATALOG B964 73 Edit:current font 153 Nonexistent Find Pattern B965 74 Right stack disp 154 Not Found B966 75 Key click off 155 Nonexistent Replace Pattern B967 76 Purge confirm 156 Can't Find Selection B968 79 Textbook on 157 Y= not available B969 80 EQW cur stk font 158 Warning: Changes will not be saved B96A 81 GRB Alg cur font 159 Result not editable in EQW B96B 82 EQW edit cur font Stack Errors and Messages B96C 83 Display grobs on 201 Too Few Arguments B96D 85 Normal stk disp 202 Bad Argument Type B96E 90 CHOOSE:cur font 203 Bad Argument Value B96F 91 MTRW:matrix 204 Undefined Name B970 92 MASD asm mode 205 LASTARG Disabled B971 94 Result = LASTCMD Equation Writer Application Messages B972 95 RPN mode Incomplete B973 97 List:horiz disp 206 Subexpression B974 98 Vector:horiz disp 207 Implicit () off B975 99 CAS:quiet 208 Implicit () on

A12 Error and Status Messages Error and Status Messages A29

Messages Listed Numerically (continued) Messages Listed Numerically (continued) # (hex) Message # (hex) Message B905 Reset all Enter alarm, press SET 61A B906 Valid object types: Select repeat interval 61B B907 Valid object type: I/O setup menu 61C B908 Any object Plot type: 61D B909 Real number 61E "" B90A (Complex num) 61F (OFF SCREEN) B90B "String" 620 Invalid PTYPE B90C [ Real array ] 621 Name the stat data, press ENTER B90D [(Cmpl array)] 622 Enter value (zoom out B90E { List } if>1), press ENTER B90F Name 623 Copied to stack B910 « Program » 624 x axis zoom w/AUTO. B911 'Algebraic' 625 x axis zoom. # Binary int 626 y axis zoom. B912 _Unit object 627 x and y axis zoom. B913 Invalid object type 628 IR/wire: B914 629 ASCII/binary: B915 Invalid object value 62A baud: B916 Calculator Modes 62B parity: B917 Number Format: 62C checksum type: B918 Angle Measure: 62D translate code: B919 Coord System: 62E Enter matrix, then NEW B91A Beep 62F No Associated Numeric View B91B Clock Mode and Plot Input Form Prompts B91C FM, 701 Algebraic B91D Choose number display format 702 RPN B91E Enter decimal places to display 703 Standard B91F Choose angle measure 704 Std B920 Choose coordinate system 705 Fixed B921 Enable standard beep? 706 Fix B922 Display ticking clock? Scientific 707 B923 Use comma as fraction mark? Sci 708 B924 Standard Engineering 709 B925 Std Eng 70A B926 Fixed 70B Degrees B927 Fix 70C Radians B928 Scientific 70D Grads B929 Sci 70E Rectangular B92A Engineering B92B Eng

A14 Error and Status Messages Error and Status Messages A27

Messages Listed Numerically (continued) Messages Listed Numerically (continued) # (hex) Message # (hex) Message 735 Edit in full page? 89A FIND REPLACE 736 Automatically indent new lines? 89B FIND 737 Edit in EQW using small font? 89C Goto Line: 738 Display EQW using small font? 89D Specify a line to go to 739 Choose header height 89E GOTO LINE 73A Display ticking clock? 89F Goto Position: 73B Analog clock? 8A0 Specify a position to go to 73C DISPLAY MODES 8A1 GOTO POSITION 73D Indep var: 8A2 HFactor: 73E Modulo: 8A3 VFactor: 73F Verbose 8A4 Recenter on cursor 740 Step/Step 8A5 Enter horizontal zoom factor 741 Complex 8A6 Enter vertical zoom factor 742 Approx 8A7 Recenter plot on cursor? ZOOM FACTOR 743 Incr Pow 8A8 Object: 744 Simp NonRational 8A9 Name: 745 Rigorous 8AA 8AB Directory 746 Numeric 8AC Enter New Object 747 Enter independent variable name Enter variable name 748 Enter modulo value 8AD 8AE Create a new directory? 749 Display calculus information? 8AF NEW VARIABLE 74A Perform operations step by step? 8B0 Select Object 74B Allow complex numbers? 74C Perform approx calculations? Statistics Help Messages (Help messages for Hypothesis Tests and Confidence 74D Increasing polynomial ordering? 90190C Intervals) 74E Simplify non rational expr? 90D Inconclusive result 74F Don't simplify |X| to X? HP Solve Application Messages 750 Replace constants by values? A01 Bad Guess(es) 751 CAS MODES A02 Constant? 752 Goto row: A03 Interrupted 753 Goto column: A04 Zero 754 Specify a row to go to A05 Sign Reversal 755 Specify a column to go to A06 Extremum 756 Matrix Writer A07 Left 757 Bad range value A08 Right 758 Start: A09 Expr 759 Step: 75A Type:

A16 Error and Status Messages Error and Status Messages A25

Messages Listed Numerically (continued) Messages Listed Numerically (continued) # (hex) Message # (hex) Message 781 VTick: 850 N: 782 Pixels 851 C: 783 Depnd: 852 Sample mean 784 Save Animation 853 Population standard deviation 785 ΣDAT: 854 Sample size 786 Col: 855 Confidence level 787 Cols: 856 CONF. INT.: 1 , KNOWN ˜ 788 F: 857 1: 789 HVar: 858 ˜1: 78A VVar: 859 N1: 78B Stiff 85A C: 78C ˆFˆY: 85B 2: 78D ˆFˆT: 85C ˜2: 78E Choose type of plot 85D N2: 78F Choose angle measure 85E Sample mean for population 1 790 Enter function(s) to plot 85F Std deviation for sample 1 791 Enter independent variable name 860 Size of sample 1 792 Connect plot points? 861 Sample mean for population 2 793 Plot functions simultaneously? 862 Std deviation for sample 2 794 Enter horizontal tick spacing 863 Size of sample 2 795 Enter vertical tick spacing 864 Confidence level 796 Tick spacing units are pixels? 865 CONF. INT.: 2 , KNOWN ˜ 797 Enter dependent variable name 866 x: 798 Save slices animation? 867 N: 799 Enter data to plot 868 C: 79A Enter col to use for horizontal 869 Sample success count 79B Enter col to use for vertical 86A Sample size 79C Enter horizontal variable 86B Confidence level 79D Enter vertical variable 86C CONF. INT.: 1 P 79E Use stiff diff eq solver? 86D 1: 79F Enter derivative w.r.t. soln 86E N1: 7A0 Enter derivative w.r.t. indep 86F C: 7A1 PLOT SETUP 870 2: 7A2 HView: 871 N2: 7A3 VView: 872 Sample 1 success count 7A4 Indep Low: 873 Sample 1 size 7A5 High: 874 Sample 2 success count 7A6 Step: 875 Sample 2 size 7A7 Pixels

A18 Error and Status Messages Error and Status Messages A23

Messages Listed Numerically (continued) Messages Listed Numerically (continued) # (hex) Message # (hex) Message 7CD Enter Z eyepoint coordinate 804 : 7CE Enter absolute error tolerance 805 N: 7CF Enter minimum XX range value 806 Œ: 7D0 Enter maximum XX range value 807 ˜: 7D1 Enter minimum YY range value 808 Null hypothesis population mean 7D2 Enter maximum YY range value 809 Sample mean 7D3 PLOT WINDOW 80A Sample Size 7D4 Default 80B Significance level 7D5 FUNCTION 80C Population standard deviation 7D6 POLAR 80D ZTEST: 1 , KNOWN ˜ 7D7 PARAMETRIC 80E Alternative Hypothesis 7D8 DIFF EQ 80F 1: 7D9 CONIC 810 ˜1: 7DA TRUTH 811 N1: 7DB HISTOGRAM 812 Œ: 7DC BAR 813 2: 7DD SCATTER 814 ˜2: 7DE SLOPEFIELD 815 N2: 7DF FAST3D 816 Sample mean for population 1 7E0 WIREFRAME 817 Std deviation for population 1 7E1 PSCONTOUR 818 Sample size for population 1 7E2 YSLICE 819 Significance level 7E3 GRIDMAP 81A Sample mean for population 2 7E4 PRSURFACE 81B Std deviation for population 2 7E5 PLOT WINDOW 81C Sample size for population 2 7E6 Enter minimum X viewvolume val 81D ZTEST: 2 , KNOWN ˜ 7E7 Enter maximum X viewvolume val 81E π0: 7E8 Enter minimum Y viewvolume val 81F x: 7E9 Enter maximum Y viewvolume val 820 N: 7EA Enter indep var sample count 821 Œ: 7EB Enter depnd var sample count 822 Null hyp. population proportion 7EC Goto Level: 823 Success count 7ED Specify a level to go to 824 Sample size 7EE HISTORY 825 Significance level Advanced Statistics Messages 826 ZTEST: 1 P 801 Must be >= 0 827 X1: 802 Must be bewteen 0 and 1 828 N1: 803 0: 829 Œ:

A20 Error and Status Messages Error and Status Messages A21

Messages Listed Numerically (continued) Four user flags are also used by the system: # (hex) Message

BC2A 10 October User Flags BC2B 11 November Flag Description BC2C 12 December 60 Units Type. BC2D Week Clear : The Equation Library and Constants Library use SI units. BC2E Day Set : The Equation Library and Constants Library use English units. BC2F Hour 61 Units Usage. BC30 Minute Clear : The Equation Library and Constants Library display units. Set : The Equation Library and Constants Library do not display units. Second BC31 62 Payment Mode. BC32 Weeks Clear : The Time Value of Money solver uses End payment mode. BC33 Days Set : The Time Value of Money solver uses Begin payment mode. BC34 Hours 63 State Change Mode. Clear : Must use the MUSE, MCAL, and ALL softkeys in the Multiple Equation BC35 Minutes Solver to change the state of a variable from undefined to userdefined. BC36 Seconds Set : Simply pressing a softkey in the Multiple Equation Solver toggles its BC37 Month/Day/Year undefined/userdefined status, hiding the MUSE and MCAL softkeys, but BC38 M/D/Y making it more difficult to retrieve the variable’s value. BC39 Day.Month.Year BC3A D.M.Y BC3B ALARMS Symbolic Application Prompts BD01 1.Integrate… BD02 2.Differentiate… BD03 3.Taylor poly… BD04 4.Isolate var… BD05 5.Solve quad… BD06 6.Manip expr… BD07 INTEGRATE BD08 Expr: BD09 Var: BD0A Result: BD0B Enter expression BD0C Enter variable name BD0D Enter lower limit BD0E Enter upper limit BD0F Choose result type BD10 Choose disp format for accuracy BD11 DIFFERENTIATE BD12 Value:

A38 Error and Status Messages System Flags C9

Messages Listed Numerically (continued) System Flags (continued) # (hex) Message Flag Description BE10 Enter complexvalued func(s) –94 Autosaving. BE11 Plot y'(t)=f(t,y) Clear : In RPN mode, results are stored in LASTCMD. Set : In RPN mode, results are not stored in LASTCMD. BE12 Enter function of INDEP and SOLN –95 Entry Mode. BE13 Enter derivative w.r.t. SOLN Clear : RPN mode BE14 Enter derivative w.r.t. INDEP Set (default): Algebraic mode. BE15 Use Stiff diff eq solver? –96 Not used . (Originally intended to toggle the softmenu in the editor in the HP 49G, BE16 ΣDat: though it was never implemented.) Vertical Lists. Col: –97 BE17 Clear : Lists on stack are displayed horizontally only, like the HP 48GX. BE18 Wid: Set : Lists are displayed vertically. Enter data to plot BE19 –98 Vertical Vectors. BE1A Arrays in Clear : Vectors on stack are displayed horizontally only, like the HP 48GX. BE1B Enter column to plot Set : Vectors are displayed vertically. BE1C Enter bar width –99 Verbose CAS Mode. Clear : CAS concise mode. BE1D Cols: Set : CAS verbose mode. BE1E Enter col to use for horizontal –100 Stepbystep CAS Mode. Enter col to use for vertical BE1F Clear : Stepbystep mode. BE20 Steps: Set : Final result mode. BE21 Enter indep var sample count –101 Internal use only . (Set if VXXL success). BE22 Enter dep var sample count –102 GCD Computations. BE23 Plot Options Clear : GCD computations allowed. Set BE24 Lo: : No GCD computations. –103 Real/Complex Mode. BE25 Hi: Clear : Real mode. “R” annunciator in header. BE26 Axes Set : Complex mode. “C” annunciator in header. BE27 Simult –104 Internal use only . (If set, LN → –INV[–LN]]). BE28 Connect –105 Exact/Approximate Mode. BE29 Pixels Clear : Exact mode. “=” annunciator in header. Set : Approximate mode, like the HP 48GX calculator. “~” annunciator in header. BE2A HTick: –106 TSIMP Calls. VTick: BE2B Clear : TSIMP calls are allowed in SERIES. BE2C Enter minimum indep var value Set : TSIMP calls are not allowed in SERIES. BE2D Enter maximum indep var value –107 Internal use only . (Modular computation). BE2E Draw axes before plotting? –108 Internal use only . (Testing remainder to be zero). BE2F Connect plot points? –109 Numeric/Symbolic Factorization. Clear : Numeric factorization is not allowed. Plot functions simultaneously? BE30 Set : Numeric factorization is allowed. BE31 Enter indep var increment –110 Large Matrices. BE32 Indep step units are pixels? Clear : Use normalsizematrix code, like the HP 48GX calculator. BE33 Enter horizontal tick spacing Set : Use code optimized for large matrices. –111 Simplifying Inside Nonrational Expressions. BE34 Enter vertical tick spacing Clear : Recursive simplification in EXPAND and TSIMP. Set : No recursive simplification in EXPAND and TSIMP.

A40 Error and Status Messages System Flags C7

Messages Listed Numerically (continued) System Flags (continued) # (hex) Message Flag Description BE5A Enter minimum XX range value –65 Multiline Mode. BE5B Enter maximum XX range value Clear : Displays all levels over multiple lines. Set : Displays only the first level over multiple lines. Enter minimum YY range value BE5C Depends on flag –52. BE5D Enter maximum YY range value –66 Multiline Strings. BE5E XX and YY Plot Options Clear : Displays long strings in multiple lines. BE5F Zoom Factors Set : Displays long strings in single lines. BE60 HFactor: Depends on flags –52 and –65. BE61 VFactor: –67 Digital Clock. Clear : When the clock is displayed (see flag –40), it is digitalstyle. Recenter at Crosshairs BE62 Set : When the clock is displayed (see flag –40), it is analogstyle. BE63 Enter horizontal zoom factor –68 Autoindenting. Enter vertical zoom factor BE64 Clear : Command line does not automatically indent, like the HP 48GX. BE65 Recenter plot at crosshairs? Set : Command line automatically indents. BE66 Reset plot –69 Fullscreen Editing. BE67 Dflt Clear : The cursor cannot move out of the text line, like the HP 48GX. Set : Fullscreen editing allowed. BE68 Auto –70 Multiline Text Grobs. BE69 Function Clear : →GROB can accept only singleline strings. Newlines are turned into Polar BE6A blobs. BE6B Conic Set : →GROB can accept multiline strings. BE6C Truth –71 Disassembler Addresses. BE6D Parametric Clear : Disassembler shows (nonreassemblable) addresses. Set : Disassembler does not show addresses. BE6E Diff Eq Stack Font. BE6F Histogram –72 Clear : The stack display uses the current system font. Bar BE70 Set : The stack display uses minifont. Scatter BE71 –73 Command Line Font. BE72 Slopefield Clear : Command line editing uses the current system font. BE73 Wireframe Set : Command line editing uses minifont. BE74 PsContour –74 Stack Setting. Clear : The stack is rightjustified, like the HP 48GX calculator. BE75 YSlice Set : The stack is leftjustified. BE76 Gridmap –75 Keystroke Beep. PrSurface BE77 Clear : Silent keyboard. Solve Application Prompts Set : Key click activated if flag –56 is clear. BF01 1.Solve equation… –76 File Manager Purge Confirmation. BF02 2.Solve diff eq… Clear : File Manager purges need confirmation. Set : No purge confirmation in File Manager. BF03 3.Solve poly… –77 Not used . (Originally intended to be a filer confirmation flag in the HP 49G, BF04 4.Solve lin sys… though it was never implemented.) 5.Solve finance… BF05 –78 I/O Device for wire. Used only when flag –33 is clear, and only on the HP 50g BF06 SOLVE EQUATION and 48gII. Clear : I/O directed to USB port. Set : I/O directed to serial port.

A42 Error and Status Messages System Flags C5

Messages Listed Numerically (continued) System Flags (continued) # (hex) Message Flag Description BF2C Enter roots or press SOLVE –36 I/O Receive Overwrite. BF2D Coefficients Clear : If file name received by the calculator matches existing variable name, new variable name with number extension is created to prevent overwrite. Roots BF2E Set : If file name received by the calculator matches existing variable name, BF2F SOLVE SYSTEM AX=B existing variable is overwritten. BF30 A: BF31 B: –37 DoubleSpaced Printing. Clear : Singlespaced printing. BF32 X: Set : Doublespaced printing. Enter coefficients matrix A BF33 –38 Line Feed. BF34 Enter constants or press SOLVE Clear : Linefeed added at end of each print line. BF35 Enter solutions or press SOLVE Set : No linefeed added at end of each print line. BF36 Constants –39 I/O Messages. Clear : I/O messages displayed. BF37 Solutions Set : I/O messages suppressed. N: BF38 –40 Clock Display. BF39 I%YR: Clear : Clock is not displayed. BF3A PV: Set : Ticking clock displayed at all times, provided the header height is 2. BF3B PMT: –41 Clock Format. P/YR: Clear : 12hour clock. BF3C Set : 24hour clock. FV: BF3D –42 Date Format. BF3E Enter no. of payments or SOLVE Clear : Month/Day format. BF3F Enter yearly int rate or SOLVE Set : Day/Month format. BF40 Enter present value or SOLVE –43 Repeat Alarm Not Rescheduled. Clear : Unacknowledged repeat appointment alarms automatically rescheduled. Enter payment amount or SOLVE BF41 Set : Unacknowledged repeat appointment alarms not rescheduled. BF42 Enter no. of payments per year 44 Acknowledged Alarms Saved. Enter future value or SOLVE – BF43 Clear : Acknowledged appointment alarms deleted from alarm list. BF44 Choose when payments are made Set : Acknowledged appointment alarms saved in alarm list. BF45 TIME VALUE OF MONEY BF46 N –45 Number of Decimal Digits. through Combined states of flags –45 through –48 sets the number of decimal digits in BF47 I%/YR –48 Fix, Scientific, and Engineering modes. BF48 PV –49 Number Display Format. BF49 PMT thru Standard: –49 clear , –50 clear . BF4A FV –50 Fix: –49 set , –50 clear . BF4B End Scientific: –49 clear , –50 set . BF4C Begin Engineering: –49 set , –50 set . 51 Fraction Mark. BF4D Beg – Clear : Fraction mark is . (period). BF4E AMORTIZE Set : Fraction mark is , (comma). Payments: BF4F –52 SingleLine Display. BF50 Principal: Clear : Display gives preference to object in level 1, using multiple lines of stack display. Set : Display of object in level 1 restricted to one line.

A44 Error and Status Messages System Flags C3

Messages Listed Numerically (continued) C # (hex) Message DE1E Z is not prime DE1F Empty {} of equations DE20 Not reducible to a rational expression C. System Flags DE21 Non unary operator This appendix lists the calculator’s system flags. You can set, clear, and test all flags, although certain flags are used User function DE22 for specific purposes by the CAS and should not be altered. The default state of the flags is clear — except for flags DE23 Non isolable operator –17, –27, –34, –90, –95 and –128 and the Binary Integer Math flags (flags –5 through –12). DE24 Not exact system System Flags Parameters not allowed DE25 Flag Description CAS internal error DE26 –1 Principal Solution. DE27 Invalid ^ for SERIES Clear : Symbolic commands return a result representing all possible solutions. DE28 Operator not implemented (SERIES) Set : Symbolic commands return only the principal solution. No variable in expr. DE29 –2 Symbolic Constants. DE2A No solution found Clear : Symbolic constants (e, i, π, MAXR, and MINR) retain their symbolic form DE2B Invalid derivation arg when evaluated, unless the Numerical Results flag –3 is set. DE2C No solution in ring Set : Symbolic constants evaluate to numbers, regardless of the state of the Numerical results flag –3. DE2D Not a linear system DE2E Can't derive int. var –3 Numerical Results. DE2F Diff equation order>2 Clear : Functions with symbolic arguments, including symbolic constants, evaluate DE30 INT:invalid var change to symbolic results. DE31 Mode switch cancelled Set : Functions with symbolic arguments, including symbolic constants, evaluate to numbers. DE32 No name in expression –4 Not used . (Originally intended to control the careful evaluation mode in the Invalid user function DE33 HP 48SX, though it was never implemented.) DE34 Can't find ODE type –5 Binary Integer Wordsize. DE35 Integer too large through Combined states of flag –5 through –10 (the most significant bit) set the wordsize DE36 Unable to find sign –10 from 1 to 64 bits. DE37 Nonsymmetric matrix –11 Binary Integer Base. and HEX (default): –11 set , –12 set . DEC: –11 clear , –12 clear . OCT: –11 set , –12 clear . DE38 ATAN insufficent order –12 BIN: –11 clear , –12 set . ASIN at infinity undef DE39 –13 Not used . Unsigned inf error DE3A –14 Financial Payment Mode. DE3B LN[Var] comparison err Clear : TVM calculations assume endofperiod payments. DE3C Undef limit for var Set : TVM calculations assume beginningofperiod payments. DE3D Bounded var error –15 Coordinate System. and Rectangular: –16 clear . DE3E Got expr. indep of var –16 Polar/Cylindrical: –15 clear , –16 set . Can't state remainder DE3F Polar/Spherical: –15 set , –16 set . DE40 LN of neg argument –17 Trigonometric Angle Mode. DE41 Insufficient order and Radians (default): –17 set . DE42 ABS of nonsigned 0 –18 Degrees: –17 clear , –18 clear . Grads: –17 clear , –18 set . –19 Vector/Complex. Clear : →V2 creates a 2dimensional vector from 2 real numbers. Set : →V2 creates a complex number from 2 real numbers.

A46 Error and Status Messages System Flags C1

Constants Messages Listed Numerically (continued)

# (hex) Message Constant (Full Name) Value in SI Units DE67 Replacing strict with large inequality NA (Avogadro’s number) 6.0221367 x 10 23 1 / gmol DE68 No valid environment stored k (Boltzmann) 1.380658 x 10 23 J / K Filer Application Messages Vm (molar volume) 22.4141 l / gmol DF01 File Manager R (universal gas) 8.31451 J / (gmol•K) DF02 NO StdT (standard temperature) 273.15 K DF03 ABORT StdP (standard pressure) 101.325 kPa DF04 ALL σ (StefanBoltzmann) 5.67051 x 10 8 W / (m 2•K 4) DF05 YES c (speed of light) 299792458 m/s DF06 REN ε0 (permittivity) 8.85418781761 x 10 12 F / m DF07 Already Exists 0 (permeability) 1.25663706144 x 10 6 H / m DF08 Overwrite ? g (acceleration of gravity) 9.80665 m / s 2 DF09 Rename G (gravitation) 6.67259 x 10 11 m 3 / (s 2•kg) DF0A PICK DESTINATION h (Planck’s) 6.6260755 x 10 34 J•s DF0B Are You Sure? hbar (Dirac’s) 1.05457266 x 10 34 J•s DF0C Search Mode OFF q (electronic charge) 1.60217733 x 10 19 C DF0D Search Mode ON me (electron mass) 9.1093897 x 10 31 kg DF0E New DIR? qme (q/me ratio) 175881962000 C / kg DF0F Sort by: mp (proton mass) 1.6726231 x 10 27 kg DF10 Original mpme (mp/me ratio) 1836.152701 DF11 Type α (fine structure) 0.00729735308 DF12 Name ø (mag flux quantum) 2.06783461 x 10 15 Wb DF13 Size F (Faraday) 96485.309 C / gmol DF14 Inv. Type R∞ (Rydberg) 10973731.534 1/m DF15 Inv. Name a0 (Bohr radius) 0.0529177249 nm DF16 Inv. Size B (Bohr magneton) 9.2740154 x 10 24 J / T DF17 Sending with Xmodem: N (nuclear magneton) 5.0507866 x 10 27 J / T DF18 EDIT λ0 (photon wavelength) 1239.8425 nm DF19 COPY f0 (photon frequency) 2.4179883 x 10 14 Hz DF1A MOVE λc (Compton wavelength) 0.00242631058 nm DF1B RCL rad (1 radian) 1 r DF1C EVAL two ̟ (2π radians) 6.28318530718 r DF1D TREE angl ( € in trig mode) 180 ° DF1E PURGE c3 (Wien’s) 0.002897756 m•K DF1F RENAME kq (k/q) 0.00008617386 J / (K*C) DF20 NEW ε0q (ε0/q) 55263469.6 F / (m*C) DF21 ORDER qε0 (q*ε0) 1.4185978 x 10 30 F*C / m DF22 SEND εsi (dielectric constant) 11.9 εox (SiO2 dielectric constant) 3.9 I0 (ref intensity) 0.000000000001 W / m 2

A48 Error and Status Messages Tables of Units and Constants B5

Messages Listed Numerically (continued) # (hex) Message Units (continued) E117 Rydberg Unit (Full Name) Value in SI Units Bohr radius E118 lbmol (poundmole) 453.59237 mol Bohr magneton E119 lbt (troy pound) .3732417216 kg E11A nuclear magneton lm (lumen) 1 cd•sr E11B photon wavelength lx (lux) 1 cd•sr / m 2 E11C photon frequency lyr (light year) 9.46052840488 x 10 15 m E11D Compton wavelen m (meter) 1 m E11E 1 radian (micron) 1 x 10 6 m E11F 2π radians mho 2 3 2 E120 € in trig mode (mho) 1 A •s / kg•m E121 Wien's mi (international mile) 1609.344 m E122 k/q mil (mil) .0000254 m E123 “0/q min (minute) 60 s E124 q*“0 miUS (US statute mile) 1609.34721869 m E125 dielectric const mmHg (millimeter of mercury (torr), 0 oC) 133.322368421 kg / m•s 2 E126 SiO2 dielec cons mol (mole) 1 mol E127 ref intensity mph (miles per hour) .44704 m / s E128 CONSTANTS LIBRARY N (newton) 1 kg•m / s 2 E129 Undefined Constant nmi (nautical mile) 1852 m Equation Library Messages (ohm) 1 kg•m 2 / A 2•s 3 Starting Solver E301 oz (ounce) .028349523125 kg E302 OF ozfl (US fluid ounce) 2.95735295625 x 10 5 m 3 E303 Keyword Conflict ozt (troy ounce) .311034768 kg E304 No Picture Available ozUK (UK fluid ounce) 2.8413075 x 10 5 m 3 Minehunt Game Prompts P (poise) .1 kg / m•s E305 NEAR Pa (pascal) 1 kg / m•s 2 E306 MINE pc (parsec) 3.08567818585 x 10 16 m E307 MINES 2 E308 SCORE: pdl (poundal) .138254954376 kg•m / s 2 E309 YOU MADE IT!! ph (phot) 10000 cd•sr / m E30A YOU BLEW UP!! pk (peck) .0088097675 m 3 MultipleEquation Solver Messages psi (pounds per square inch) 6894.75729317 kg•m / s 2 E401 Invalid Mpar pt (pint) .000473176473 m 3 E402 Single Equation qt (quart) .000946352946 m 3 E403 EQ Invalid for MINIT r (radian) 1 r E404 Too Many Unknowns R (roentgen) .000258 A•s / kg All Variables Known E405 °°°R (degrees Rankine) 0.555555555556 K Illegal During MROOT E406 rad (rad) .01 m 2 / s 2 E407 Solving for

A50 Error and Status Messages Tables of Units and Constants B3

Messages Listed Numerically (continued) B # (hex) Message 1010F Forbidden 10110 Bad Expression 10111 Jump too Long B. Tables of Units and Constants 10112 Val betw 18 expected Units 10113 Insuffisant Memory Unit (Full Name) Value in SI Units 10114 Matrix Error 10115 Define Error a (are) 100 m 2 10116 [ or ] expected A (ampere) 1 A ARM register expected 10117 acre (acre) 4046.87260987 m 2 ARM invalid imediate 10118 arcmin (minute of arc) 2.90888208666 x 10 4 r 31401 No Message here arcs (second of arc) 4.8481368111 x 10 6 r 70000 (userdefined message created with DOERR ) atm (atmosphere) 101325 kg / m•s 2 au (astronomical unit) 1.495979 x 10 11 m Å (Angstrom) 1 x 10 10 m b (barn) 1 x 10 28 m 2 bar (bar) 100000 kg / m•s 2 bbl (barrel) .158987294928 m 3 Bq (becquerel) 1 1 / s Btu (international table Btu) 1055.05585262 kg•m 2 / s 2 bu (bushel) .03523907 m 3 oC (degree Celsius) 1K or 274.15 K c (speed of light) 299792458 m / s C (coulomb) 1 A•s cal (calorie) 4.1868 kg•m 2 / s 2 cd (candela) 1 cd chain (chain) 20.1168402337 m Ci (curie) 3.7 x 10 10 1 / s ct (carat) .0002 kg cu (US cup) 2.365882365 x 10 4 m 3 o (degree) 1.74532925199 x 10 2 r d (day) 86400 s dB (decibel) 1 (dimensionless value) dyn (dyne) .00001 kg / m•s 2 erg (erg) .0000001 kg•m 2 / s 2 eV (electron volt) 1.60217733 x 10 19 kg•m 2/s 2 F (farad) 1 A 2•s 4 / kg•m 2

A52 Error and Status Messages Tables of Units and Constants B1

51 [CONVERT] UNITS NXT POWR (CONVERT 1 10 or UNITS 10: "POWER") 52 [CONVERT] UNITS NXT PRESS (CONVERT 1 11 or UNITS 11: "PRESSURE") Reserved Variable What It Contains Used By 53 [CONVERT] UNITS NXT TEMP (CONVERT 1 12 or UNITS 12: "TEMPERATURE") 54 [CONVERT] UNITS NXT NXT ELEC (CONVERT 1 13 or UNITS 13: "ELECTRIC CURRENT") PPAR Plotting parameters. DRAW 55 [CONVERT] UNITS NXT NXT ANGL (CONVERT 1 14 or UNITS 14: "ANGLE") 56 [CONVERT] UNITS NXT NXT LIGHT (CONVERT 1 15 or UNITS 15: "LIGHT") PRTPAR Printing parameters. PRINT commands 57 [CONVERT] UNITS NXT NXT RAD (CONVERT 1 16 or UNITS 16: "RADIATION") PTPAR Periodic Table parameters. PERTBL 58 [CONVERT] UNITS NXT NXT VISC (CONVERT 1 17 or UNITS 17: "VISCOSITY") 59 [CONVERT] UNITS TOOLS (CONVERT 1 1 or UNITS 1: "TOOLS") STARTED Program run on EDIT. EDIT 60 PRG NXT NXT ERROR IFERR (PRG 14 6: "IF ERROR") 61 PRG NXT NXT ERROR (PRG 14: "ERROR") STARTEQW CST commands list for EQW. Equation Writer 62 PRG NXT CHARS (PRG 9: "CHAR") STARTERR Program run on error. Error processing 63 PRG NXT MODES (LS&MODE or PRG 10: "MODES") 64 PRG NXT MODES FMT (LS&MODE 1: "FORMAT") STARTOFF Program run at turnoff. OFF 65 PRG NXT MODES ANGLE (LS&MODE 2: "ANGLE") 66 PRG NXT MODES FLAG (LS&MODE 3: "FLAG") STARTRECV Program run at RECV. Filer, RECV 67 PRG NXT MODES KEYS (LS&MODE 4: "KEYS") STARTSEND Program run at SEND. Filer, SEND 68 PRG NXT MODES MENU (LS&MODE 5: "MENU") 69 PRG NXT MODES MISC (LS&MODE 6: "MISC") STARTUP Program run at reset. Reset 70 PRG MEM (PRG 2: "MEMORY") s1, s2,… Arbitrary signs. ISOL, QUAD 71 PRG MEM DIR (PRG 2 5: "DIRECTORY") 72 PRG MEM ARITH (PRG 2 6: "ARITH") TOFF Time in ticks until OFF. Turnoff delay 73 PRG/TOOL STACK (PRG 1 1: "STACK") 74 RS&NUM.SLV (similar to RSNUM.SLV; no name) TPAR Table parameters. Table of values 75 RS&NUM.SLV ROOT (74 MENU ROOT: "ROOT") VPAR Viewing parameters. DRAW 76 RS&NUM.SLV DIFFEQ (74 MENU DIFFEQ: "DIF EQ") 77 RS&NUM.SLV POLY (74 MENU POLY: "POLY") ZPAR Plot zoom factors. DRAW 78 RS&NUM.SLV SYS (74 MENU SYS: "SYS") 79 RS&NUM.SLV TVM (74 MENU TVM: "TVM") ΣDAT Statistical data. Statistics application, DRAW 80 RS&NUM.SLV TVM SOLVR (FINANCE is the inputform version) ΣPAR Statistical parameters. Statistics application, DRAW * 81 old softmenu PLOT (no choosebox version available) * 82 old softmenu PLOT PTYPE (no choosebox version available) * 83 old softmenu PLOT PPAR (no choosebox version available) Contents of the System Reserved Variables * 84 old softmenu PLOT 3D (81.02 MENU 3D: "3D") * 85 old softmenu PLOT 3D PTYPE (no choosebox version available) * 86 old softmenu PLOT 3D VPAR (no choosebox version available) αENTER * 87 old softmenu PLOT STAT (81.02 MENU STAT: "PLOT STAT") * 88 old softmenu PLOT STAT PTYPE (no choosebox version available) This is the vectored ENTER preprocessor. It is active when flags –62 and –63 are set. When ENTER is pressed, * 89 old softmenu PLOT STAT ΣPAR (no choosebox version available) the command line is placed on the stack as a string and αENTER is executed. * 90 old softmenu PLOT STAT ΣPAR MODL (no choosebox version available) * 91 old softmenu PLOT STAT DATA (87 MENU DATA: "PLOT ΣDAT") ALRMDAT * 92 old softmenu PLOT FLAG (no choosebox version available) * 93 old SYMBOLIC menu (93 DUP MENU MENU LS&PREV: "SYMBOLIC") ALRMDAT does not reside in a particular directory. You cannot access the variable itself, but you can access its 94 PRG NXT NXT TIME (RS&TIME or PRG 13: "TIME") data from any directory using the RCLALARM and STOALARM commands, or through the Alarm Catalog. 95 PRG NXT NXT TIME ALRM (RS&TIME 6 or TIME 4 6 or PRG 13 6 or APPS 5 4 6: "ALARM") ALRMDAT contains a list of these alarm parameters: * 96 old softmenu STAT (97 MENU STAT: "STATISTIC") * 97 old softmenu STAT DATA (96 MENU DATA: "STAT DATA") * 98 old softmenu STAT ΣPAR (no choosebox version available) * 99 old softmenu STAT ΣPAR MODL (no choosebox version available) *100 old softmenu STAT 1VAR (96 MENU 1VAR: "STAT 1VAR") *101 old softmenu STAT PLOT (96 MENU PLOT: "STAT PLOT") *102 old softmenu STAT FIT (96 MENU FIT: "STAT FIT") *103 old softmenu STAT SUMS (96 MENU SUMS: "STAT SUM")

D2 Reserved Variables The MenuNumber Table H3 H You can specify menu labels and key actions independently by replacing a single object within the custommenu list with a list of the form {“labelobject ” actionobject }. To provide different shifted actions for custom menu keys, actionobject can be a list containing three action objects in this order: The unshifted action (required if you want to specify the shifted actions). H. The MenuNumber Table The leftshifted action. The rightshifted action. Menu Numbers EQ “*” in the first column means the menu is not one of the keyboard menus and is therefore only available through EQ contains the current equation or the name of the variable containing the current equation, the MENU command. EQ supplies the equation for ROOT, as well as for the plotting command DRAW. ( ΣDAT supplies the information when the plot type is HISTOGRAM, BAR, or SCATTER.) Menus are identified by keyboard path (used when flag –117 is clear) followed by choosebox path (used when flag –117 is set) followed by its displayed name. The object in EQ can be an algebraic object, a number, a name, or a program. How DRAW interprets EQ depends on the plot type. RS9 means “press rightshift, let go, then press 9”. For graphics use, EQ can also be a list of equations or other objects. If EQ contains a list, then DRAW treats each RS&9 means “press rightshift, hold it down, and press 9”. object in turn as the current equation, and plots them successively. However, ROOT in the HP Solve application cannot solve an EQ containing al list. “Abandoned” means that the menu was used in a former ROM version but has been made obsolete by subsequent improvements to the operating system. To alter the contents of EQ , use the command STEQ. Syntax Example: EXITED EXITED can be stored in any directory. If there is an EXITED program that exists in the path, it will be called 16 [MTH] BASE NXT LOGIC (MTH 6 7 or BASE 7: "LOGIC") upon exiting the command line. This can be used in conjunction with STARTED, for instance, to set a header size of 0 when entering the command line and restore it to 2 when exiting (in order to increase the editor window size). This means that menu 16 can be reached in eight different ways: Note, this is only valid when entering the command line through a EDIT function. In algebraic mode: (1) MENU(16)

(2) TMENU(16) EXPR In RPL mode: EXPR contains the current algebraic expression (or the name of the variable containing the current expression) (3) 16 MENU used by the SYMBOLIC application and its associated commands. The object in EQ must be an algebraic or a (4) 16 TMENU name. In either algebraic or RPL mode: With flag –117 set (softmenu mode):

(5) Press MTH BASE NXT LOGIC IOPAR (6) Press BASE NXT LOGIC IOPAR is a variable in the HOME directory that contains a list of the I/O parameters needed for a communications With flag –117 clear (choosebox mode): link with a computer. It is created the first time you transfer data or open the serial port (OPENIO), and is (7) Press MTH 6 ENTER 7 ENTER automatically updated whenever you change the I/O settings. All IOPAR parameters are integers. (8) Press BASE 7 ENTER

... and the name shown at the top of the choose box is “LOGIC MENU”.

Note: When a choosebox path is “1”, just press ENTER since the first choice is automatically highlighted in menu choose boxes.

D4 Reserved Variables The MenuNumber Table H1

MASD.INI Keycode Keystroke Definition MASD.INI must contain valid MASD source code. This source code will be parsed/compiled before the source on the stack. It is useful to always include a basic set of commands or definitions in all compiled source. 93.61 ~@& 2 ¡ (upside down exclamation point) 94.61 ~@& 3 ¿ (upside down question mark) MHpar 104.31 @ & í (@& †) ; or . (depends on flag –51) MHpar stores the status of an interrupted Minehunt game. MHpar is created when you exit Minehunt by pressing K. If MHpar still exists when you restart Minehunt, the interrupted game resumes and MHpar is purged. 104.61 ~@&í(@&†) ; or . (depends on flag –51) 105.31 @ & ï(@& `) Toggles exact/approximate mode (flag –105) Mpar Mpar is created when you use the Equation Library’s MultipleEquation Solver, and it stores the set of equations you’re using. When the Equation Library starts the MultipleEquation Solver, it first stores a list of the equation set in EQ , and Shifted softkeys stores the equation set, a list of variables, and additional information in Mpar . Mpar is then used to set up the Solver menu for the current equation set. This section describes the effect of using the shift keys and menu labels displayed above the A through F keys. Mpar is structured as library data dedicated to the Multiple Equation Solver application. This means that although you can view and edit Mpar directly, you can edit it only indirectly by executing commands that modify it. @%VARNAME% = 'varname' !©. !£ You can also use the MINIT command to create Mpar from a set of equations on the stack. Applies to the VAR menu, CUSTOM menus obtained by pressing , or via the programmable MENU or TMENU commands, and any menu containing a variable (e.g. pressing @%EQ% in the ROOT menu [menu number 75] yields 'EQ' !©even in program mode.) n1, n2, The ISOL and QUAD commands return general solutions (as opposed to principal solutions) or operations. A general ! %VARNAME% = 'varname' ‰. solution contains variables for arbitrary integers or arbitrary signs, or both. Applies to the VAR menu, CUSTOM menus obtained by pressing !£, (the left shift of the Hkey)or via the ! %EQ% The variable n1 represents an arbitrary integer 0, ±1, ±2, etc. Additional arbitrary integers are represented by n2 , n3 , programmable MENU or TMENU commands, and any menu containing a variable (e.g. pressing in the etc. ROOT menu [menu number 75] yields 'EQ' ‰ even in program mode.)

If flag –1 is set, then ISOL and QUAD return principal solutions, in which case the arbitrary integer is always zero. The function !î(the left shift of the `key) is really the LASTARG key in RPL mode. It performs the LASTARG command EXCEPT when pressed immediately after pressing a ‰ or %PURGE% key, including a Nmines !varname ‰. If !îis pressed immediately after a ‰, then the PREVIOUS contents of the variable !î %PURGE% Nmines is a variable you create in the current directory to control the number of mines used in the Minehunt game. are returned (if any). If is pressed immediately after a key is pressed, then the purged variable Nmines contains an integer in the range 1 to 64; if Nmines is negative, the mines are visible during the game. AND ITS CONTENTS are both returned to the stack. This does not apply if the variable is a directory object. The purpose of these exceptions is to prevent disaster: If you accidentally PURGE a variable, or wipe out a variable’s contents by accidentally STOing something else into it, you can recover simply by pressing !î. PPAR PPAR is a variable in the current directory. It contains a list of plotting parameters used by the DRAW command Pressing %EDIT% by itself is the same as pressing ˜: it performs an EDITB. ! %EDIT% performs an EDIT. for all mathematical and statistical plots, by AUTO for autoscaling, and by the interactive (nonprogrammable) graphics operations. In the ROOT SOLVR ( @& Ï, %ROOT% , %SOLVR% ), pressing %VARNAME% performs 'varname' K. @%VARNAME% performs 'varname' ! ©. ! %VARNAME% solves for varname in the current equation. Pressing ANY key (other than $) while the solver is working causes it to display the current solution interval until a solution is found. Watching the progress of the solver this way lets you avoid waiting for solutions when the process is not converging.

Menus that contain modetoggling keys (e.g. the MISC menu ( !°L%MODES% L%MISC% ) handle the shift keys in a special way. Pressing ! %MODE% sets the corresponding system flag (unrelated to the previous or subsequent presence or absence of the “bullet” in the menu key), and in program mode types nn SF where nn is the flag number. @%MODE% performs the opposite: nn CF. Modes that do not behave this way (e.g. STK and CMD) are not programmable modes.

D6 Reserved Variables Keyboard Shortcuts G3 G The $RESET$ operation ( „&ôL %RESET% ) resets the PPAR parameters (except ptype ) to their default values, and erases PICT . (Note: the & means to press and hold the „key while pressing ô). Note that res behaves differently for the statistical plot types BAR, HISTOGRAM, and SCATTER than for other plot types. For BAR, res specifies bar width; for HISTOGRAM, res specifies bin width; res does not affect G. Keyboard Shortcuts SCATTER.

Each key on the calculator performs so many different functions that only the most fundamental ones are actually PRTPAR shown on the keyboard (on the keys themselves or on the space around the keys). The following is the complete list of the “hidden” functions of the calculator’s keyboard. PRTPAR is a variable in the HOME directory that contains a list of printing parameters. It is created automatically the first time you use a printing command. Notation: In this appendix, there are two ways of showing key presses: @` means: press Right Shift, release it, then press `. Default @ ` ` Parameter (Command) Description Value & means: while holding Right Shift, press .

delay time (DELAY) A real number, in the range 0 to 6.9, specifying the 0 number of seconds the calculator waits between Onkey combinations sending lines. This should be at least as long as the $ time required to print the longest line. If the delay is The table lists functions that include the key. These are not programmable. too short for the printer, you will lose data. The delay Keystroke Definition setting also affects serial printing if transmitpacing Holding these two keys during the entire turnon routine prevents all added ƒ& $ (in IOPAR ) is not being used. libraries from being attached AND prevents 'STARTUP' from being executed. This is useful if the calculator seems to hang up during turnon. remap (OLDPRT stores the A string defining the current remapping of the Empty characterremapping string extended character set for printing. The string can string. $& C Warmstart. Clears the stack, PICT, LASTARG, and other temporary things for the HP 82240A Infrared contain as many characters as you want to remap, with like those, and turns off USER Mode. Doesn’t clear any variables. Useful Printer) the first character being the new character 128, the when the calculator is taking too long to finish a complicated function and second being the new character 129, etc. (Any pressing $ doesn’t seem to interrupt it. Also useful if you lock out the character number that exceeds the string length will keyboard with a bad USER mode set of key assignments. not be remapped.) See the example below. $& D Displays the current ROM’s version and build numbers, then enters Factory line length A real number specifying the number of characters in 80 Test Mode. Press $& C to exit a line for serial printing. This does not affect infrared printing. $& F Like $& D but a friendlier and more complete set of tests, designed for the enduser. Follow the instructions on the screen. Do NOT format the SD line termination A string specifying the linetermination method for Control card unless you wish to lose all of its contents! serial printing. This does not affect infrared printing. characters $ A F Clears the calculator’s RAM, returning everything to the factory state. Note that control character 13 is the carriage return 13 and 10. & & Anything in port 2 (flash ROM) will remain untouched. and 10 is the line feed. $& — Print Screen. Send the current display to the current printer Parameters without modified commands can be modified with a program by storing new values in the list contained $ + Adjusts the display contrast up. in PRTPAR (use the PUT command). & Example: If the remapping string were “ABCDEFGH” and the character to be printed had value 131, then the $& Adjusts the display contrast down. character actually printed would be “D”, since 131 –128=3 and “A” has the value zero. A character code of 136 or $& R Begins a “remote control” mode, where the calculator transmits the screen greater would not be remapped since 136 –128=8, which exceeds the length of the string. bitmap through the USB port and accepts keypresses through the same way.

Terminates the remote control mode. PTPAR $& S PTPAR is created when you use the Periodic Table, and it stores the current pointer position information. $& Ó ($&9) Forces the very next system interrupt to be ignored. This is intended to allow the user to shutdown rapidly repeating alarms, but it must be noted that STARTED keystrokes also cause a system interrupt, so be sure NOT to press any key $ Ó If it exists, the STARTED variable is evaluated when the commandline editor is evaluated. between pressing & and the next repeating alarm, or the alarm will come due and continue repeating.

D8 Reserved Variables Keyboard Shortcuts G1

TPAR TPAR is a variable in the current directory. It contains a list of parameters used by the table of values plotting Group 7: Two argument, one result commands operation. Twoargument commands can operate in parallel in any of three different ways: Parameter Description Default Value {list } {list } (Command) {list } object object {list } startingvalue Real number that specifies the first value to show in the 0 table. In the first form, parallel elements are combined by the command: step Real number that specifies the amount to increment .1 { 1 2 3 } { 4 5 6 } returns { .04 .1 .18 } . from startingvalue for each row in the table. In the second form, the level 1 object is combined with each element in the level 2 list in succession: tableformat 0 for “Automatic”, for generating the table based on 0 { 1 2 3 } 30 %CH returns { 2900 1400 900 } . automaticallycreated values, or 1 for “Build Your Own”, for generating the table based on values stored in In the third form, the level 2 object is combined with each element of the level 1 list in succession: a vector stored in filename and saving any userentered 50 { 1 2 3 } %T returns { 2 4 6 } . values. zoomfactor Real number that specifies the zoom factor for the table. 4 Group 8: Multipleargument, oneresult commands fontsize 0 for the small font or 1 for the large font. 0 Commands that take multiple (3, 4, or 5) arguments can perform parallel processing only if all arguments are lists. filename The name of a variable containing a vector with values TAB For example, { 'SIN(X)' 'COS(X)' 'TAN(X)' } { X X X } { 0 0 0 } ROOT returns { 0 to use for input into the table. 90 0 } . Notice that lists must be used even though the level 1 and level 2 lists each contain multiples of the same element.

VPAR Group 9: Multipleresult commands VPAR is a variable in the current directory. It contains a list of parameters used by the 3D plot types. The main data Any command that allows parallel processing, but produces multiple results from its input data, will return its results structure stored in VPAR describes the “view volume,” the abstract threedimensional region in which the function as a single list. For example, { 1 2 3 } { 4 5 6 } R→C C→R produces { 1 4 2 5 3 6 } rather is plotted. than the more expected { 1 2 3 } { 4 5 6 } . The following UNMIX program will unmix the data given the number of expected result lists: « OVER SIZE → l n s Parameter Description Default Value « 1 n (Command) FOR j j s FOR i l i GET n (xleft , xright ) (XVOL) Real numbers that specify the width of the view volume. (–1, 1) STEP s n / →LIST NEXT (yfar , ynear ) (YVOL) Real numbers that specify the depth of the view volume. (–1, 1) » » (z low , z high ) (ZVOL) Real numbers that specify the height of the view volume. (–1, 1) Taking { 1 4 2 5 3 6 } from above as the result of C→R (a command which should return two results), (xeye , yeye , z eye ) (EYEPT) Real numbers that specify the point in space from which (0, –3, 0) 2 UNMIX gives { 1 2 3 } { 4 5 6 } . the plot is viewed.

(xstep , ystep ) Real numbers that specify the increments between of x (10, 8) Group 10: Quirky commands (NUMX, NUMY) coordinates and ycoordinates plotted. The increments A few commands behave uniquely with respect to parallel processing: are equal to the range for the axes divided by the number of steps. Used instead of (or in combination with) res . DELALARM. This command can take a list of arguments. Note, however, that deletions from early in the alarm list will change the alarm indices of the later alarm entries. Thus, if there are only three alarms, (xx left , xx right ) (XXRNG) Real numbers that specify the width of the input plane (–1, 1) { 1 3 } DELALARM will cause an error, whereas { 3 1 } DELALARM will not. (domain). Used by GRIDMAP and PARSURFACE. DOERR. This command forces an error state that causes all running programs and commands to halt. Thus, (yy far , yy near ) (YYRNG) Real numbers that specify the depth of the input plane (–1, 1) even though providing the command with a list argument will cause the command to perform parallel processing, (domain). Used by GRIDMAP and PARSURFACE. the first error state will cause the command to abort and none of the rest of the list arguments will be used.

FREE, MERGE. These commands are for the HP 48SX and do not apply to these calculators. Parameters without commands can be modified programmatically by storing new values in the list contained in RESTORE. This command performs a system warmstart after installing the backup object into memory. All VPAR (use the PUT command). functions are terminated at that time. Thus, only the first backup object in a list will be restored.

D10 Reserved Variables Parallel Processing with Lists F3 F ΣPAR ΣPAR is a variable in the current directory that contains either the current statistical parameter list or the name of the variable containing this list. F. Parallel Processing with Lists

Parallel processing is the idea that, generally, if a command can be applied to one or more individual arguments, Parameter (Command) Description Default then it can also be extended to be applied to one or more sets of arguments. (Note: some examples assume Value approximate mode.) column indep (XCOL) A real number specifying the independentvariable’s 1 Some examples: column number. 5 INV returns .2 , so { 4 5 8 } INV returns { .25 .2 .125 } .

column dep (YCOL) A real number specifying the dependentvariable’s 2 4 5 * returns 20 , so { 4 5 6 } { 5 6 7 } * returns { 20 30 42 } , and { 4 5 6 } 5 column number. * returns { 20 25 30 } .

intercept (LR) A real number specifying the coefficient of intercept as 0 General rules for parallel processing determined by the current regression. As a ruleofthumb, a given command can use parallel list processing if all the following are true: slope (LR) A real number specifying the coefficient of slope as 0 The command checks for valid argument types. Commands that apply to all object types, such as DUP, SWAP, determined by the current regression. ROT, and so forth, do not use parallel list processing. The command takes exactly one, two, three, four, or five arguments, none of which may itself be a list. model (LINFIT, etc.) A command specifying the regression model (LINFIT, LINFIT Commands that use an indefinite number of arguments (such as →LIST) do not use parallel list processing. EXPFIT, PWRFIT, or LOGFIT). The command isn’t a programming branch command (IF, FOR, CASE, NEXT, and so forth). The remainder of this appendix describes how the many and various commands available on the calculator are grouped with respect to parallel processing. Group 1: Commands that cannot parallel process A command must take arguments before it can parallel process, since a zeroargument command (such as RAND, VARS, or REC) has no arguments with which to form a group.

Group 2: Commands that must use DOLIST to parallel process This group of commands cannot use parallel processing directly, but can be “coerced” into it using the DOLIST command (see Using D later in this appendix). This group consists of several subgroups: Stack manipulation commands. A stack manipulation command cannot parallel process because the stack is manipulated as a whole and list objects are treated the same as any other object. Stack commands (such as DROP) that take level 1 arguments will not accept level 1 list arguments. Commands that operate on a list as a whole. Certain commands accept lists as arguments but treat them no differently than any other data object. They perform their function on the object as a whole without respect to its elements. For example, →STR converts the entire list object to a string rather than converting each individual element, and the == command tests the level 1 object against the level 2 object regardless of the objects’ types. List manipulation commands. List manipulation commands will not parallel process since they operate on list arguments as lists rather than as sets of parallel data. However, a list manipulation command can be forced to parallel process lists of lists by using the DOLIST command. For example, { { 1 2 3 } { 4 5 6 } } « œLIST » DOLIST returns { 6 120 } . Other commands that have list arguments. Because a list can hold any number of objects of any type, it is commonly used to hold a variable number of parameters of various types. Some commands accept such lists, and because of this are insensitive to parallel processing, except by using DOLIST. Indexoriented commands. Many array commands either establish the size of an array in rows and columns or manipulate individual elements by their row and column indices. These commands expect these row and column indices to be real number pairs collected in lists. For example, { 3 4 } RANM will generate a random

D12 Reserved Variables Parallel Processing with Lists F1

MODULO Precedence of Operations The variable MODULO contains a real prime number for use with the modular operations. The default value is 13. It is used by ADDTMOD, DIV2MOD, DIVMOD, EXPANDMOD, FACTORMOD, GCDMOD, INVMOD, Evaluation of an algebraic object is carried according to the order of precedence of the operators — those with MODSTO, MULTMOD, POWMOD, RREFMOD, and SUBTMOD. higher precedence are executed first. Operations with the same order of precedence are executed from left to right. PERIOD From highest precedence to lowest, the order of precedence is: Contains the period for CAS periodic operations. The default value is 2π. Order Operation PRIMIT 1. Unit attachment: Contains a primitive (subexpression) used temporarily for antiderivitive expression during CAS operations. 1.1 Parenthesized expressions from innermost to outermost 1.2 Power (^) from bottom to top (i.e. 1_m^2^3^4 = 1_m^24) REALASSUME 1.3 Multiplication (*) and Division (/) The variable REALASSUME contains a list of variables which the CAS assumes are real values. 2. Parenthesized expression from innermost to outermost

3. Functions that require arguments (i.e. SIN, LOG) VX The variable VX contains the name of the default variable to use for CAS commands which operate on a default 4. Factorial (!) variable. It is used by DERVX, INTVX, SIGMAVX, and SOLVEVX. 5. Power (^) from top to bottom (i.e. 2^2^3^4 = 2^(2^(3^4))) and Root (√, XROOT)

6. Negation (), Multiplication (*), Division (/) and Modulus (MOD) 7. Addition (+) and Subtraction (–) 8. Relational operators (==, ≠, <, >, ≤, ≥) 9. Logical operators AND and NOT 10. Logical operators OR and XOR 11. Left argument of “Where” (|) 12. Equal (=)

D14 Reserved Variables Technical Reference E5

Symbolic Integration (continued) Object Size, continued Object Type Size (bytes) Pattern Antiderivative Unit object 7.5 + 1/(SIN( φ)×TAN( φ)) –INV(SIN( φ)) real magnitude 2.5 or 10.5 1/(SIN( φ)2) –INV(TAN( φ)) each prefix 6 SINH( φ) COSH( φ) each unit name 5 + number of characters 1/(SINH( φ)×COSH( φ)) LN(TANH( φ)) each ×, ^, or / 2.5 1/(SINH( φ)×TANH( φ)) –INV(SINH( φ)) each exponent 2.5 or 10.5 Unquoted global or 3.5 + number of characters SQ( φ) φ 3/3 local name TAN( φ)2 TAN( φ)–φ Vector 12.5 + 8 × number of elements TAN( φ) –LN(COS( φ)) XLIB name 5.5 TAN( φ)/COS( φ) INV(COS( φ)) 1/TAN( φ) LN(SIN( φ)) Symbolic Integration Patterns 1/TAN( φ)×SIN( φ)) –INV(SIN( φ)) This table lists the symbolic integration patterns used by the calculator. These are the integrands that the calculator TANH( φ) LN(COSH( φ)) can integrate symbolically. TANH( φ)/COSH( φ) INV(COSH( φ)) φ is a linear function of the variable of integration. The antiderivatives should be divided by the first –order 1/TANH( φ) LN(SINH( φ)) coefficient in φ to reduce the expression to its simplest form. Also, patterns beginning with 1 / match INV: for 1/TANH( φ)×SINH( φ)) –INV(SINH( φ)) example, 1 / φ is the same as INV( φ). φ 2× φ 1.5 /3 Symbolic Integration 1/ φ 2× φ Pattern Antiderivative 1/(2× (φ)) 2× (φ)×.5 ACOS( φ) φ×ACOS( φ)– (1 –φ 2) φ z(z symbolic) IFTE(z = = –1,LN( φ), φ (z+1) /(z+1)) ALOG( φ) .434294481904×ALOG( φ) φ z(z real, ≠0, –1) φ (z+1) /(z+1) ASIN( φ) φ×ASIN( φ)+ (1 –φ 2) φ 0 φ ATAN( φ) φ×ATAN( φ)–LN(1+ φ 2)/2 φ –1 LN( φ) COS( φ) SIN( φ) 1/ φ LN( φ) 1/(COS( φ)×SIN( φ)) LN(TAN( φ)) 1/(1 –φ 2) ATANH( φ) COSH( φ) SINH( φ) 1/(1+ φ 2) ATAN( φ) 1/(COSH( φ)×SINH( φ)) LN(TANH( φ)) 1/( φ 2+1) ATAN( φ) φ 2 φ 1/(COSH( ) ) TANH( ) 1/( (φ–1)× (φ+1)) ACOSH( φ) EXP( φ) EXP( φ) 1/ (1 –φ 2) ASIN( φ) EXPM( φ) EXP( φ) 1/ (1+ φ 2) ASINH( φ) LN( φ) φ×LN( φ)–φ 1/ (φ 2+1) ASINH( φ) LOG( φ) .434294481904× φ×LN( φ)–φ SIGN( φ) ABS( φ) SIN( φ) –COS( φ) 1/(SIN( φ)×COS( φ)) LN(TAN( φ)) 1/(SIN( φ)×TAN( φ)) –INV(SIN( φ))

E2 Technical Reference Technical Reference E3

Command Type Library Size Keys Menu ? First VANDERMONDE C 78883 5.5 MATRICES CREAT NXT NXT 6.03 H 1.05 MTH MATRX MAKE NXT NXT 137.03 «MATR» NXT NXT 146.03 VAR C 2301 2.5 100.02 MENU 100.02 28C VARS C 236 2.5 PRG MEM DIR NXT 71.02 28S VER F 788140 5.5 140 DUP MENUXY H 1.05 VERSION C 17115 5.5 CAT 2219.03 48GX VISIT C 2218 5.5 key LSdownarrow 2269.02 1.05 VISITB C 22110 5.5 CAT 2269.02 1.05 VPOTENTIAL C 22257 5.5 CAT H 1.20 VTYPE C 2167 2.5 PRG TYPE NXT NXT 33.03 48SX V→ C 2180 2.5 MTH VECTR 4 48SX WAIT C 255 2.5 PRG NXT IN 39 28C WHILE C 17925 2.5 PRG BRCH [WHILE] 31 28C 145.02 WIREFRAME C 1718 5.5 85 MENU 85 48GX 2219.02 WSLOG C 219 2.5 CAT 48SX XCOL C 2306 2.5 89/98 MENU 89 48SX 98 XGET C 171112 5.5 CAT 2219.19 1.16 XLIB~ C 25633 5.5 256.06 MENU 256.06 1.16 XMIT C 2360 2.5 109 MENU 109 48SX XNUM C 788103 5.5 «REWRITE» 142.02 H 1.05 142.02 MENU XOR F 2232 2.5 PRG TEST NXT 16 28C [MTH/CONVERT] BASE NXT LOGIC 32.02 169 XPON F 2105 2.5 MTH REAL NXT 14.02 28C XPUT C 171113 5.5 CAT 2219.19 1.16 XQ C 788104 5.5 «REWRITE» 142.02 H 1.05 142.02 MENU XRECV C 17180 5.5 104.02 MENU 104.02 48GX 2219.14 XRNG C 2218 2.5 83 MENU 83 48SX XROOT A 274 2.5 key 52.3: xrootofy 48SX 275 XSEND C 17179 5.5 104.02 MENU 104.02 48GX 2219.14 XSERV C 171110 5.5 CAT 2219.19 1.16 XVOL C 1710 5.5 86 MENU 86 48GX 2219 XXRNG C 1713 5.5 86 MENU 86 48GX 2219 YCOL C 2307 2.5 89/98 MENU 89 48SX 98 YRNG C 2219 2.5 83 MENU 83 48SX

The Command MenuPath Table I29

Command Type Library Size Keys Menu ? First Command Type Library Size Keys Menu ? First ! F 299 2.5 key ALPHARS2 13 28C TESTS C 22246 5.5 «MATHS» NXT H 1.20 MTH NXT PROB 141 TEVAL C 788101 5.5 101 DUP MENUXY H 1.05 % F 2124 2.5 key ALPHALS1 14 28C TEXPAND C 78819 5.5 EXP&LN 121 H 1.05 MTH REAL SYMB ALG 122.02 %CH F 2126 2.5 MTH REAL 14 28C SYMB TRIG 124.02 %T F 2125 2.5 MTH REAL 14 28C ALG NXT 139 ' F 179220 2.5 key 43.1 28C TRIG NXT 151 179221 SYMB NXT EXPLN 155 * A 271 2.5 key 75.1 28C «EXP&LN» «TRIGO» NXT *H C 2189 2.5 alias for SCALEH 28C «ALGB» NXT *W C 2190 2.5 alias for SCALEW 28C TEXT C 2217 2.5 PRG NXT OUT 40 48SX + A 268 2.5 key 95.1 28C THEN C 179226 2.5 PRG BRCH IF/CASE 24 28C 269 17921 PRG NXT NXT ERROR IFERR 25 A 270 2.5 key 85.1 28C 179224 60 / A 272 2.5 key 65.1 78 28C 145 RS&NUM.SLV SYS TICKS C 218 2.5 RS&TIME 94 48SX ; C 2388 2.5 key RS&SPC 1.05 PRG NXT NXT TIME 167 key ALPHALS2 APPS 5 4 < F 2235 2.5 key 63.3 32 28C TIME C 216 2.5 RS&TIME 94 48SX PRG TEST PRG NXT NXT TIME 167 «TESTS» APPS 5 4 = A 259 2.5 key 62.3 28C TINC F 171101 5.5 APPS 12 UTILS NXT 117.02 48GX == F 2233 2.5 PRG TEST 32 28C 117.02 MENU 2219.17 «TESTS» NXT TLIN C 78825 5.5 SYMB TRIG 122.02 H 1.05 > F 2236 2.5 key 64.3 32 28C TRIG NXT 139 PRG TEST CONVERT TRIG NXT 140.02 «TESTS» «TRIGO» NXT ? F 788137 5.5 key ALPHARS3 H 1.05 TLINE C 2207 2.5 PRG NXT PICT 38 48SX ABCUV C 78848 5.5 ARITH POLY 126 H 1.05 TMENU C 2348 2.5 LS&MODE MENU 68 48SX ABS F 261 2.5 key 65.2 4 28C PRG NXT MODES MENU CMPLX 7 TOT C 2300 2.5 100 MENU 100 28C MATRICES OPER 14.02 TRACE C 17139 5.5 MATRICES OPER NXT NXT 7.02 48GX MTH VECTR 20 MTH MATRX NORM NXT 147.02 MTH REAL NXT 130 156.03 MTH MATRX NORM 147 2219.07 MTH NXT CMPLX 156 TRAN C 78869 5.5 MATRICES OPER NXT NXT 7.02 H 1.05 «CMPLX» MTH MATRX NORM NXT 137.03 ACK C 221 2.5 RS&TIME ALRM 95 48SX «MATR» 147.02 PRG NXT NXT TIME ALRM 156.03 ACKALL C 220 2.5 RS&TIME ALRM 95 48SX TRANSIO C 2373 2.5 106 MENU 106 48SX PRG NXT NXT TIME ALRM TRIG C 78827 5.5 SYMB TRIG 122.03 H 1.05 ACOS A 288 2.5 key 54.2 28C TRIG NXT NXT 139 ACOS2S C 78837 5.5 TRIG 122 H 1.05 CONVERT TRIG NXT 140.02 CONVERT TRIG 140 «TRIGO» NXT NXT «TRIGO» TRIGCOS C 78828 5.5 TRIG NXT NXT 122.03 H 1.05 ACOSH A 291 2.5 MTH HYP 12 28C CONVERT TRIG NXT 140.02 TRIG HYP 161 «TRIGO» NXT NXT «HYPERBOLIC» TRIGO C 788130 5.5 «MAIN» H 1.05

I2 The Command MenuPath Table The Command MenuPath Table I27

Command Type Library Size Keys Menu ? First Command Type Library Size Keys Menu ? First ATAN2S C 78834 5.5 TRIG 122 H 1.05 SRB C 28 2.5 [MTH/CONVERT] BASE NXT BYTE 18 28C CONVERT TRIG 140 171 «TRIGO» SRECV C 2361 2.5 109 MENU 109 48SX ATANH A 292 2.5 MTH HYP 12 28C SREPL C 22116 5.5 RS&CHARS NXT 62.02 1.05 TRIG HYP 161 PRG NXT CHARS NXT 2269.03 «HYPERBOLIC» SREV C 25615 5.5 256.03 MENU 1.05 ATICK C 17116 5.5 83.02 MENU 83.02 48GX START C 17929 2.5 PRG BRCH [START] 26 28C 2219.03 145 ATTACH C 2358 2.5 110 MENU 110 48SX STD C 2141 2.5 LS&MODE FMT 64 28C AUGMENT C 22219 5.5 MATRICES CREAT 146 H 1.20 PRG NXT MODES FMT AUTO C 2192 2.5 81.02 MENU 81.02 48SX STEP C 179212 2.5 PRG BRCH START/FOR 26 28C AXES C 2186 2.5 83.02 MENU 83.02 28C 27 AXL C 78874 5.5 CONVERT MATRX 135 H 1.05 145.02 MATRICES OPER 156 STEQ C 2250 2.5 RS&NUM.SLV ROOT LSEQ 75 + 28C «MATR» 173 [LS]EQ AXM C 78873 5.5 MATRICES OPER 135 H 1.05 STIME C 2376 2.5 109 MENU 109 48SX «MATR» 156 STO C 2341 2.5 key 32.1 71 28C AXQ C 78876 5.5 CONVERT MATRIX 157 H 1.05 PRG MEM DIR MATRICES QUADF 173 STO* C 2330 2.5 PRG MEM ARITH 72 28C «MATR» NXT STO+ C 2327 2.5 PRG MEM ARITH 72 28C A→ C 2563 5.5 256 MENU 256 1.05 STO C 2328 2.5 PRG MEM ARITH 72 28C A→H C 2564 5.5 256 MENU 256 1.05 STO/ C 2329 2.5 PRG MEM ARITH 72 28C BAR C 2227 2.5 88 MENU 88 48SX STOALARM C 225 2.5 RS&TIME ALRM 95 48SX BARPLOT C 2316 2.5 101 MENU 101 48SX PRG NXT NXT TIME ALRM BASIS C 22217 5.5 MATRICES NXT VECT 160 H 1.20 STOF C 2151 2.5 LS&MODE FLAG NXT 66.02 28C BAUD C 2371 2.5 106 MENU 106 48SX PRG NXT MODES FLAG NXT BEEP C 252 2.5 PRG NXT OUT NXT 40.02 28C STOKEYS C 2381 2.5 LS&MODE KEYS 67 48SX BESTFIT C 2323 2.5 90/99 MENU 90 48SX PRG NXT MODES KEYS 99 STORE F 22236 5.5 «ALGB» NXT H 1.20 BIN C 2144 2.5 [MTH/CONVERT] BASE 15 28C STOVX C 22264 5.5 CAT H 1.20 168 STOΣ C 2283 2.5 91/97 MENU LSΣDAT 91 28C BINS C 2315 2.5 100 MENU 100 48SX 97 BLANK C 2209 2.5 PRG NXT GROB 37 48SX STREAM C 17188 5.5 PRG LIST PROC 36 48GX BOX C 2208 2.5 PRG NXT PICT 38 48SX 2219.15 BUFLEN C 2375 2.5 109 MENU 109 48SX STR→ C 2163 2.5 CAT 28C BYTES C 238 2.5 PRG MEM 70 48SX STRM C 2550 5.5 APPS 14 2.15 BetaTesting C 25625 5.5 256.05 MENU 256.05 1.05 STURM C 22222 5.5 ARITH POLY PREV 126.04 H 1.20 B→R C 210 2.5 [MTH/CONVERT] BASE 15 28C STURMAB C 22223 5.5 ARITH POLY PREV 126.04 H 1.20 168 STWS C 2148 2.5 [MTH/CONVERT] BASE NXT 15.02 28C C2P C 22230 5.5 ARITH PERM 174 H 1.20 168.02 CASCFG C 788126 5.5 «MAIN» H 1.05 SUB C 2156 2.5 RS&CHARS 6.02 28C CASCMD C 22251 5.5 TOOL NXT 1.20 PRG LIST 34 CASE C 179225 2.5 PRG BRCH CASE 25 48SX PRG NXT GROB 37 145.03 PRG NXT CHARS 62 CD→ C 2567 5.5 256.02 MENU 256.02 1.05 MATRICES CREAT NXT NXT 146.03 MTH MATRX MAKE NXT CEIL F 2104 2.5 MTH REAL NXT NXT 14.03 28C SUBST F 7882 5.5 ALG NXT 124.02 H 1.05 CENTR C 2187 2.5 83.02 MENU 83.02 28C SYMB ALG 151 «ALGB» NXT

I4 The Command MenuPath Table The Command MenuPath Table I25

Command Type Library Size Keys Menu ? First Command Type Library Size Keys Menu ? First COND C 17138 5.5 MATRICES OPER 7 48GX R→I F 2389 2.5 CONVERT REWRITE NXT NXT 172.03 1.05 MTH MATRX NORM 147 SAME C 2228 2.5 PRG TEST NXT 32.02 28C 156 SBRK C 2377 2.5 109 MENU 109 48SX 2219.07 SB~B C 25620 5.5 256.04 MENU 256.04 1.05 CONIC C 2221 2.5 82 MENU 82 48SX SCALE C 2194 2.5 83.02 MENU 83.02 48SX CONJ F 262 2.5 CMPLX 20.02 28C SCALEH C 2189 2.5 83.02 MENU 83.02 1.05 MTH NXT CMPLX NXT 130 SCALEW C 2190 2.5 83.02 MENU 83.02 1.05 «CMPLX» SCATRPLOT C 2318 2.5 101 MENU 101 48SX CONLIB C 17124 5.5 APPS 3 115 48GX APPS 12 COLIB 2219.05 SCATTER C 2225 2.5 88 MENU 88 48SX 115 MENU SCHUR C 17151 5.5 MATRICES FACT 8 48GX CONST C 17125 5.5 APPS 12 COLIB 115 48GX MTH MATRX FACTR 148 115 MENU 2219.05 2219.09 CONSTANTS C 22242 5.5 «MATHS» H 1.20 SCI C 2139 2.5 LS&MODE FMT 64 28C PRG NXT MODES FMT CONT C 258 2.5 key 101.02 48SX SCLΣ C 2313 2.5 CAT 28C CONVERT C 211 2.5 [CONVERT] UNITS TOOLS 59 28C 118 SCONJ C 2326 2.5 PRG MEM ARITH NXT 72.02 28C CORR C 2289 2.5 102 MENU 102 28C SCROLL C 788125 5.5 TOOL VIEW is the same as SCROLL DROP H 1.05 125 DUP MENUXY COS A 282 2.5 key 54.1 28C SDEV C 2299 2.5 100 MENU 100 28C COSH A 285 2.5 MTH HYP 12 28C TRIG HYP 161 SEND C 2364 2.5 104 MENU 104 48SX «HYPERBOLIC» SEQ C 17183 5.5 PRG LIST PROC NXT 36.02 48GX COV C 2290 2.5 102 MENU 102 28C 2219.14 CR C 2243 2.5 107 MENU 107 28C SERIAL C 25629 5.5 256.05 MENU 256.05 1.16 CRC C 25627 5.5 256.05 MENU 256.05 1.16 SERIES C 7887 5.5 SYMB CALC 136.03 H 1.05 CALC LIMIT 152 CRDIR C 232 2.5 PRG MEM DIR 71 28S «DIFF» NXT 163 CRLIB C 25626 5.5 256.05 MENU 256.05 1.05 SERVER C 2369 2.5 105 MENU 105 48SX CROSS C 2122 2.5 MTH VECTR 4 28C SEVAL F 788100 5.5 100 DUP MENUXY H 1.05 MATRICES NXT VECT 137 160 SF C 2131 2.5 LS&MODE FLAG 32.03 28C PRG TEST NXT NXT 66 CSWP C 17165 5.5 MTH MATRX COL 9 48GX PRG NXT MODES FLAG MATRICES CREAT COL 149 165 SHOW C 2338 2.5 93 MENU 93 28C 2219.11 SIDENS F 17199 5.5 APPS 12 UTILS 117 48GX CURL C 78887 5.5 CALC DERIV 136 H 1.05 117 MENU 2219.17 162 SIGMA F 2222 5.5 CALC DERIV NXT 162.02 H 1.16 CYCLOTOMIC F 22221 5.5 ARITH POLY 126 H 1.20 SIGMAVX F 2221 5.5 CALC DERIV NXT NXT 162.03 H 1.16 CYLIN C 17118 5.5 LS&MODE ANGLE 4.02 48GX SIGN F 278 2.5 CMPLX NXT 14.02 28C MTH VECTR NXT 65 MTH REAL NXT 20.02 PRG NXT MODES ANGLE 2219.04 MTH NXT CMPLX NXT 130.02 C→PX C 2199 2.5 PRG NXT PICT NXT 38.02 48SX «CMPLX» NXT C→R C 2159 2.5 PRG TYPE NXT 20 28C SIGNTAB C 78895 5.5 SYMB GRAPH 142 H 1.05 MTH NXT CMPLX 33.02 CALC GRAPH 153 177 DARCY F 17197 5.5 APPS 12 UTILS 117 48GX 117 MENU 2219.17 SIMP2 C 78851 5.5 ARITH NXT 125.02 H 1.05 SIMPLIFY F 22234 5.5 in EQW 1.20 DATE C 217 2.5 RS&TIME 94 48SX 172.02 H PRG NXT NXT TIME 167 CONVERT REWRITE NXT APPS 5 4 «REWRITE» «EQW»

I6 The Command MenuPath Table The Command MenuPath Table I23

Command Type Library Size Keys Menu ? First Command Type Library Size Keys Menu ? First DIR C 179227 2.5 CAT 48SX RCLΣ C 2286 2.5 91/97 MENU RSΣDAT 91 28C DISP C 250 2.5 PRG NXT OUT 40 28C 97 DISPXY C 22122 5.5 CAT 2269.04 1.20 RCWS C 2149 2.5 [MTH/CONVERT] BASE NXT 15.02 28C DISTRIB F 22225 5.5 CONVERT REWRITE 172 H 1.20 168.02 «REWRITE» RDM C 2172 2.5 MTH MATRX MAKE 6 28C DIV C 78886 5.5 CALC DERIV 136 H 1.05 MATRICES CREAT NXT NXT 146.03 162 RDZ C 2128 2.5 MTH NXT PROB 13 28C DIV2 C 78838 5.5 ARITH POLY 126 H 1.05 RE F 2154 2.5 CMPLX NXT 20 28C DIV2MOD C 788114 5.5 ARITH MODUL 128 H 1.05 MTH NXT CMPLX 130.02 138 «CMPLX» NXT 141.02 DIVIS C 78868 5.5 ARITH 125 H 1.05 RECN C 2366 2.5 104.02 MENU 104.02 48SX SYMB ARITH 134 RECT C 17117 5.5 LS&MODE ANGLE 4.02 48GX «INTEGER» MTH VECTR NXT 65 DIVMOD F 788113 5.5 ARITH MODUL 128 H 1.05 PRG NXT MODES ANGLE 2219.03 «MODULAR» 138 RECV C 2367 2.5 104 MENU 104 48SX DIVPC F 78898 5.5 CALC LIMIT 136 H 1.05 REF C 78872 5.5 MATRICES LINS 137.03 H 1.05 «DIFF» 163 «MATR» 158 DO C 17927 2.5 PRG BRCH [DO] 29 28C REMAINDER F 78842 5.5 ARITH POLY PREV 126.04 H 1.05 145.02 «POLYNOMIAL» NXT DOERR C 242 2.5 PRG NXT NXT ERROR 61 48SX RENAME C 22119 5.5 CAT 2269.04 1.05 DOLIST C 17191 5.5 PRG LIST PROC 36 48GX REORDER F 788105 5.5 105 DUP MENUXY H 1.05 2219.16 REPEAT C 17926 2.5 PRG BRCH WHILE 31 28C DOMAIN C 22233 5.5 CAT H 1.20 145.02 DOSUBS C 17184 5.5 PRG LIST PROC 36 48GX REPL C 2157 2.5 RS&CHARS 6.02 48SX 2219.15 PRG LIST 34 DOT C 2121 2.5 MTH VECTR 4 28C PRG NXT GROB 37 MATRICES NXT VECT 137 PRG NXT CHARS 62 160 MTH MATRX MAKE NXT 146.03 DRAW C 2191 2.5 81 MENU 81 28C MATRICES CREAT NXT NXT DRAW3DMATRIX C 171107 5.5 CAT 2219.18 H 1.05 RES C 2188 2.5 83 MENU 83 48GX DRAX C 2193 2.5 81 MENU 81 28C RESTORE C 2354 2.5 PRG MEM NXT 70.02 48SX DROITE F 22235 5.5 «CMPLX» H 1.20 RESULTANT F 2225 5.5 ARITH POLY PREV 126.04 H 1.16 DROP C 2272 2.5 PRG/TOOL STACK 73 28C REVLIST C 17193 5.5 MTH LIST 11 48GX backspace key when not editing PRG LIST PROC 36 DROP2 C 2273 2.5 PRG/TOOL STACK NXT NXT 73.03 28C 2219.16 DROPN C 2277 2.5 PRG/TOOL STACK NXT NXT 73.03 28C REWRITE C 22240 5.5 «MAIN» NXT H 1.20 DTAG C 2385 2.5 PRG TYPE NXT 33.02 48SX RISCH F 78813 5.5 CALC DERIV NXT 136.03 H 1.05 DUP C 2269 2.5 PRG/TOOL STACK 73 28C «DIFF» NXT 162.02 ENTER key when not editing RKF C 17132 5.5 RS&NUM.SLV DIFFEQ 76 48GX DUP2 C 2270 2.5 PRG/TOOL STACK NXT NXT 73.03 28C 2219.06 DUPDUP C 2398 2.5 PRG/TOOL STACK NXT NXT 73.03 1.05 RKFERR C 17134 5.5 RS&NUM.SLV DIFFEQ 76 48GX 2219.06 DUPN C 2278 2.5 PRG/TOOL STACK NXT NXT 73.03 28C RKFSTEP C 17133 5.5 RS&NUM.SLV DIFFEQ 76 48GX D→R F 2112 2.5 MTH REAL NXT NXT 14.03 28C 2219.06 EDIT C 2217 5.5 key LSdownarrow 2269.02 1.05 RL C 21 2.5 [MTH/CONVERT] BASE NXT BIT 17 28C TOOL LSEDIT 170 EDITB C 2219 5.5 key downarrow 2269.02 1.05 RLB C 22 2.5 [MTH/CONVERT] BASE NXT BYTE 18 28C TOOL 171 RND F 2108 2.5 MTH REAL NXT NXT 14.03 28C

I8 The Command MenuPath Table The Command MenuPath Table I21

Command Type Library Size Keys Menu ? First Command Type Library Size Keys Menu ? First EXPAN C 2334 2.5 93/142 MENU 93 28C POP C 22253 5.5 CAT H 1.20 142 POS C 2161 2.5 RS&CHARS 35 28C EXPAND C 7880 5.5 ALG 124 H 1.05 PRG LIST ELEM 62 SYMB ALG 142 PRG NXT CHARS «ALGB» 151 POTENTIAL C 22256 5.5 CAT H 1.20 EXPANDMOD F 788118 5.5 ARITH MODUL 128 H 1.05 POWEXPAND F 22227 5.5 CONVERT REWRITE NXT 172.02 H 1.20 «MODULAR» 138 «REWRITE» EXPFIT C 2321 2.5 90/99 MENU 90 48SX POWMOD F 788115 5.5 ARITH MODUL NXT 128.02 H 1.05 99 «MODULAR» NXT 138.02 EXPLN C 78823 5.5 EXP&LN 121 H 1.05 PR1 C 2240 2.5 104/107 MENU 104 28C CONVERT REWRITE 135 107.02 SYMB NXT EXPLN 155 PREDV C 2303 2.5 CAT 28C «EXP&LN» 172 PREDX C 2305 2.5 102 MENU 102 48SX «REWRITE» PREDY C 2304 2.5 102 MENU 102 48SX EXPM A 298 2.5 EXP&LN 12.02 28C PREVAL F 78812 5.5 CALC DERIV NXT 136.03 H 1.05 MTH HYP NXT 121 «DIFF» NXT 162.02 141 PREVPRIME F 78862 5.5 ARITH INTEG NXT 127.02 H 1.05 EYEPT C 1715 5.5 86.02 MENU 86.02 48GX «INTEGER» NXT 2219 PRLCD C 2246 2.5 107 MENU (hotkey: ON+uparrow) 107 28C F0λ F 17198 5.5 APPS 12 UTILS 117 48GX 117 MENU 2219.17 PROMPT C 179228 2.5 PRG NXT IN NXT 39.02 48SX FACT F 2100 2.5 CAT 48GX PROMPTSTO C 788139 5.5 139 DUP MENUXY H 1.05 PROOT C 17168 5.5 RS&NUM.SLV POLY 77 48GX FACTOR C 7881 5.5 ALG 124 H 1.05 SYMB ALG 126 ARITH POLY NXT NXT 126.03 ARITH POLY 142 2219.12 «ALGB» 151 PROPFRAC C 78853 5.5 SYMB ARITH 125.02 H 1.05 «INTEGER» ARITH NXT 134 «POLYNOMIAL» «POLYNOMIAL» NXT in EQW PRST C 2242 2.5 107 MENU 107 28C FACTORMOD F 788119 5.5 ARITH MODUL 128 H 1.05 PRSTC C 2241 2.5 107 MENU 107 28C «MODULAR» 138 PRVAR C 2244 2.5 107 MENU 107 28C FACTORS C 78867 5.5 ARITH 125 H 1.05 PSDEV C 17129 5.5 100.02 MENU 100.02 48GX FANNING F 17196 5.5 APPS 12 UTILS 117 48GX 2219.05 117 MENU 2219.17 PSI F 2224 5.5 MTH NXT SPECIAL 176 H 1.16 FAST3D C 2400 2.5 CAT 1.05 PTAYL F 78854 5.5 ARITH POLY NXT NXT 126.03 H 1.05 FC? C 2134 2.5 LS&MODE FLAG 32.03 28C «POLYNOMIAL» NXT PRG TEST NXT NXT 66 PTPROP F 2291 5.5 APPS 13 2.15 PRG NXT MODES FLAG PURGE C 2344 2.5 TOOL 70 28C FC?C C 2143 2.5 LS&MODE FLAG 32.03 28C PRG MEM 71 PRG TEST NXT NXT 66 PRG MEM DIR PRG NXT MODES FLAG PUSH C 22252 5.5 CAT H 1.20 FCOEF C 78865 5.5 ARITH POLY NXT 126.02 H 1.05 PUT C 2176 2.5 PRG LIST ELEM 6.02 28C «SOLVER» MATRICES CREAT NXT 35 FDISTRIB F 22224 5.5 CONVERT REWRITE 172 H 1.20 MTH MATRX MAKE NXT 146.02 «REWRITE» PUTI C 2177 2.5 PRG LIST ELEM 6.02 28C FFT C 17126 5.5 MTH NXT FFT 19 48GX MATRICES CREAT NXT 35 2219.05 MTH MATRX MAKE NXT 146.02 FILER C 22112 5.5 key 21.2 2269.03 1.05 PVAR C 17130 5.5 100.02 MENU 100.02 48GX CAT 2219.06 PVARS C 2351 2.5 110 MENU 110 48SX

I10 The Command MenuPath Table The Command MenuPath Table I19

Command Type Library Size Keys Menu ? First Command Type Library Size Keys Menu ? First GRAPH C 2200 2.5 alias for PICTURE 48SX MULTMOD F 788112 5.5 ARITH MODUL NXT 128.02 H 1.05 GREDUCE C 22259 5.5 CAT H 1.20 «MODULAR» NXT 138.02 GREY C 179229 2.5 must be typed in 1.20 MUSER C 171117 5.5 APPS 12 MES 116 48GX GRIDMAP C 17110 5.5 85 MENU 85 48GX 116 MENU 2219.2 2219.02 NDIST C 17128 5.5 MTH NXT PROB NXT 2219.05 48GX GROB C 179229 2.5 CAT 48SX NDUPN C 2399 2.5 PRG/TOOL STACK PREV 73.04 1.05 GROBADD C 788124 5.5 SYMB GRAPH 153 H 1.05 NEG A 260 2.5 key 62.1: +/ 20.02 28C CALC GRAPH 177 CMPLX 130 GXOR C 2212 2.5 PRG NXT GROB 37 48SX MTH NXT CMPLX NXT HADAMARD C 78870 5.5 MATRICES OPER NXT 137 H 1.05 «CMPLX» NXT «MATR» 156.02 NEWOB C 239 2.5 PRG MEM 70 48SX HALFTAN C 78832 5.5 TRIG 122 H 1.05 NEXT C 179211 2.5 PRG BRCH START/FOR 26 28C SYMB TRIG 139 27 CONVERT TRIG 140 145.02 «TRIGO» NEXTPRIME F 78861 5.5 ARITH INTEG NXT 127.02 H 1.05 HALT C 179214 2.5 PRG NXT NXT RUN 41 28C «INTEGER» NXT HEAD C 17181 5.5 RS&CHARS NXT 35.02 48GX NIP C 2396 2.5 PRG/TOOL STACK NXT NXT 73.03 1.05 PRG LIST ELEM NXT 62.02 NOT F 2231 2.5 PRG TEST NXT 16 28C PRG NXT CHARS NXT 2219.14 [MTH/CONVERT] BASE NXT LOGIC 32.02 HEADER→ C 2215 5.5 CAT 2269 1.05 «TESTS» NXT 169 HELP C 22250 5.5 TOOL NXT 1.20 NOVAL C 2391 2.5 PRG NXT IN 39 48GX HERMITE F 78892 5.5 ARITH POLY NXT 126.02 H 1.05 NSUB F 17186 5.5 PRG LIST PROC 36 48GX «POLYNOMIAL» 2219.15 HESS C 78889 5.5 CALC DERIV 136.02 H 1.05 NUM C 2164 2.5 RS&CHARS 33.02 28C 162 PRG TYPE NXT 62 HEX C 2146 2.5 [MTH/CONVERT] BASE 15 28C PRG NXT CHARS 168 NUMX C 1716 5.5 86.02 MENU 86.02 48GX HILBERT C 78884 5.5 MATRICES CREAT NXT 6.03 H 1.05 2219.02 MTH MATRX MAKE NXT NXT 137.02 NUMY C 1717 5.5 86.02 MENU 86.02 48GX 146.02 2219.02 HISTOGRAM C 2226 2.5 88 MENU 88 48SX NΣ C 2288 2.5 103 MENU 103 28C HISTPLOT C 2317 2.5 101 MENU 101 48SX OBJ→ C 2169 2.5 PRG TYPE 33 48SX HMS+ C 2116 2.5 RS&TIME NXT 94.02 28C PRG LIST 34 PRG NXT NXT TIME NXT 167.02 RS&CHARS NXT 62.02 APPS 5 4 NXT PRG NXT CHARS NXT HMS C 2117 2.5 RS&TIME NXT 94.02 28C OCT C 2147 2.5 [MTH/CONVERT] BASE 15 28C PRG NXT NXT TIME NXT 167.02 168 APPS 5 4 NXT OFF C 241 2.5 PRG NXT NXT RUN NXT 41.02 48SX HMS→ C 2115 2.5 RS&TIME NXT 94.02 28C OLDPRT C 2239 2.5 108 MENU 108 48SX PRG NXT NXT TIME NXT 167.02 OPENIO C 2362 2.5 109 MENU 109 48SX APPS 5 4 NXT OR F 2230 2.5 PRG TEST NXT 16 28C HOME C 234 2.5 key LS&UPDIR 28S [MTH/CONVERT] BASE NXT LOGIC 32.02 HORNER C 78855 5.5 ARITH POLY NXT 126.02 H 1.05 «TESTS» NXT 169 HYPERBOLIC C 22243 5.5 «MATHS» H 1.20 ORDER C 2346 2.5 PRG MEM DIR NXT 71.02 28C H→ C 2561 5.5 256 MENU 256 1.05 OVER C 2275 2.5 PRG/TOOL STACK 73 28C H→A C 2565 5.5 256 MENU 256 1.05 P2C C 22231 5.5 ARITH PERM 174 H 1.20 H→S C 2569 5.5 256.02 MENU 256.02 1.05 PA2B2 F 78857 5.5 ARITH INTEG NXT 127.02 H 1.05 IABCUV C 78849 5.5 ARITH INTEG 127 H 1.05 PARAMETRIC C 2413 2.5 82 MENU 82 48SX PARITY C 2372 2.5 106 MENU 106 48SX

I12 The Command MenuPath Table The Command MenuPath Table I17

Command Type Library Size Keys Menu ? First Command Type Library Size Keys Menu ? First IREMAINDER F 78843 5.5 SYMB ARITH 127.02 H 1.05 LIN C 78820 5.5 ALG 121 H 1.05 ARITH INTEG NXT 134 EXP&LN 124 «INTEGER» NXT SYMB ALG 135 ISOL C 2336 2.5 S.SLV 93 28C CONVERT REWRITE 151 «SOLVER» 120 SYMB NXT EXPLN 155 ISOM C 22213 5.5 MATRICES LINAP 175 H 1.20 «EXP&LN» 172 ISPRIME? F 78860 5.5 SYMB ARITH 127.02 H 1.05 «REWRITE» ARITH INTEG NXT 134 LINE C 2206 2.5 PRG NXT PICT 38 48SX «INTEGER» NXT LINFIT C 2319 2.5 90/99 MENU 90 48SX I→R F 2390 2.5 CONVERT REWRITE 172 1.05 99 JORDAN C 78880 5.5 MATRICES NXT EIGEN 137.02 H 1.05 LININ F 17121 5.5 PRG TEST PREV 32.04 48GX «MATR» NXT 159 2219.04 KER C 22215 5.5 MATRICES LINAP 175 H 1.20 LINSOLVE C 78882 5.5 S.SLV 120 H 1.05 KERRM C 2374 2.5 104.02 MENU 104.02 48SX SYMB SOLVE 137.02 KEY C 257 2.5 PRG NXT IN 39 28C MATRICES LINS 154 «SOLVER» 158 KEYEVAL C 788123 5.5 123 DUP MENUXY H 1.05 «MATR» NXT NXT KEYTIME→ C 171109 5.5 CAT 2219.19 1.05 LIST→ C 2158 2.5 CAT 28C KGET C 2365 2.5 105 MENU 105 48SX LN A 294 2.5 key 51.3 141 28C KILL C 240 2.5 PRG NXT NXT RUN 41 28C 141 MENU LABEL C 2201 2.5 81.02 MENU 81.02 48SX LNAME C 788109 5.5 109 DUP MENUXY H 1.05 LAGRANGE C 78893 5.5 ARITH POLY NXT 126.02 H 1.05 LNCOLLECT C 78822 5.5 ALG 121 H 1.05 142 EXP&LN 124 LANGUAGE→ C 2211 5.5 CAT 2269 1.05 SYMB NXT EXPLN 155 LAP F 78816 5.5 CALC DIFF 136.02 H 1.05 CONVERT REWRITE NXT 172.02 «DIFF» NXT NXT 164 «EXP&LN» LAPL C 78888 5.5 CALC DERIV NXT 136.02 H 1.05 «REWRITE» 164 LNP1 A 297 2.5 EXP&LN 12.02 28C LAST C 254 2.5 alias for LASTARG 28C MTH HYP NXT 121 LASTARG C 254 2.5 key 105.2 in RPL mode 61 48SX 141 PRG NXT NXT ERROR LOCAL C 22260 5.5 CAT H 1.20 LCD→ C 2213 2.5 PRG NXT GROB NXT 37.02 28S LOG A 295 2.5 key 61.3 141.02 28C LCM F 78845 5.5 ARITH POLY NXT NXT 126.03 H 1.05 141.02 MENU «POLYNOMIAL» LOGFIT C 2320 2.5 90/99 MENU 90 48SX «INTEGER» NXT 99 LCXM C 78885 5.5 137.02 MENU 137.02 H 1.05 LQ C 17150 5.5 MATRICES FACT 8 48GX 85 DUP MENUXY MTH MATRX FACTR 148 LC~C C 25623 5.5 256.04 MENU 256.04 1.05 2219.09 LDEC C 78818 5.5 S.SLV 120 H 1.05 LR C 2302 2.5 102 MENU 102 28C SYMB SOLVE 136.03 LR~R C 25621 5.5 256.04 MENU 256.04 1.05 CALC DIFF 154 LSQ C 17143 5.5 MTH MATRX 5 48GX «SOLVER» 164 RS&NUM.SLV SYS 78 LEGENDRE F 78890 5.5 ARITH POLY NXT NXT 126.03 H 1.05 MATRICES OPER NXT 156.02 «POLYNOMIAL» 2219.08 LGCD C 78850 5.5 ARITH NXT 125.02 H 1.05 LU C 17148 5.5 MATRICES FACT 8 48GX LIBEVAL C 17122 5.5 CAT 2219.04 48GX MTH MATRX FACTR 137.02 LIBS C 2357 2.5 110 MENU 110 48SX 148 LIMIT F 7885 5.5 alias for lim 1.05 2219.09 LVAR C 788106 5.5 106 DUP MENUXY H 1.05

I14 The Command MenuPath Table The Command MenuPath Table I15

Command Type Library Size Keys Menu ? First →HMS C 2114 2.5 RS&TIME NXT 94.02 28C PRG NXT NXT TIME NXT 167.02 APPS 5 4 NXT →KEYTIME C 171108 5.5 CAT 2219.19 1.05 →LANGUAGE C 2210 5.5 CAT 2269 1.05 →LCD C 2214 2.5 PRG NXT GROB NXT 37.02 28S →LIST C 2154 2.5 PRG TYPE 33 28C PRG LIST 34 →LST C 25610 5.5 256.02 MENU 256.02 1.05 →MINIFONT C 22117 5.5 CAT 2269.04 1.05 →NDISP C 2216 5.5 CAT 2269.02 1.05 →NUM C 253 2.5 key 105.3 172.02 28C CONVERT REWRITE NXT →PRG C 25612 5.5 256.03 MENU 256.03 1.05 →Q C 2263 2.5 CONVERT REWRITE NXT 93.02 48SX 172.02 →Qп C 2264 2.5 CONVERT REWRITE NXT 93.02 48SX 172.02 →RAM C 25614 5.5 256.03 MENU 256.03 1.05 →ROW C 17154 5.5 MTH MATRX ROW 10 48GX MATRICES CREAT ROW 150 166 2219.1 →S2 C 25632 5.5 256.06 MENU 256.06 1.16 →STR C 2162 2.5 PRG TYPE 33 28C RS&CHARS NXT 62.02 PRG NXT CHARS NXT →TAG C 2384 2.5 PRG TYPE 33 48SX →TIME C 223 2.5 RS&TIME 94 48SX PRG NXT NXT TIME 167 APPS 5 4 →UNIT C 213 2.5 PRG TYPE 33 48SX [CONVERT] UNITS TOOLS 59 118 →V2 C 2181 2.5 MTH VECTR 4 48SX →V3 C 2182 2.5 MTH VECTR 4 48SX ↓MATCH C 2266 2.5 93.02 MENU 93.02 48SX ↑MATCH C 2265 2.5 93.02 MENU 93.02 48SX LIST C 17185 5.5 MTH LIST 11 48GX 2219.15 ΠLIST C 17190 5.5 MTH LIST 11 48GX 2219.16 ∞ F 788138 5.5 key 102.2 H 1.05 «CONSTANTS» « C 179218 2.5 key 95.3 28C » C 179217 2.5 key 95.3 28C 179219

I32 The Command MenuPath Table

The following table shows the relation between character codes (results of NUM, arguments to CHR) and characters (results of CHR, arguments to NUM), as well as the translation codes to be used to transmit characters between the calculator and a remote device, for the upper half of the character set.

Character Codes 128255 With ASCII Character Translations

Code Trans. Description Code Trans. Description Code Trans. Description 128 € \<) angle 170 ª \170 feminine ordinal 212 Ô \212 O circumflex 129  \x x bar 171 « \<< begin program 213 Õ \213 O tilde 130 ‚ \.V gradient 172 ¬ \172 logical negation 214 Ö \214 O dieresis/umlaut 131 ƒ \v/ square root 173 − \173 negative 215 × \.x multiplication 132 „ \.S integration 174 ® \174 registered 216 Ø \O/ O slash 133 Σ \GS Sigma trademark 217 Ù \217 U grave 134 ► \|> store 175 \175 macron 218 Ú \218 U acute 135 π \pi pi 176 ° \^o degree 219 Û \219 U circumflex 136 ˆ \.d derivation 177 ± \177 plus/minus 220 Ü \220 U dieresis/umlaut 137 ‰ \<= less than or equal 178 ² \178 superscript 2 221 Ý \221 Y acute 138 Š \>= greater than or 179 ³ \179 superscript 3 222 Þ \222 Thorn equal 180 ´ \180 acute accent 223 ß \Gb beta 139 ‹ \=/ not equal 181 \Gm mu 224 à \224 a grave 140 Œ \Ga alpha 182 ¶ \182 paragraph 225 á \225 a acute 141 → \> right arrow 183 \183 dot 226 â \226 a circumflex 142 ← \< left arrow 184 ¸ \184 cedilla 227 ã \227 a tilde 143 ↓ \|v down arrow 185 ¹ \185 superscript 1 228 ä \228 a dieresis/umlaut 144 ↑ \|^ up arrow 186 º \186 masculine ordinal 229 å \229 a ring 145 ‘ \Gg gamma 187 » \>> end program 230 æ \230 ae ligature 146 ’ \Gd delta 188 ¼ \188 vulgar 1/4 231 ç \231 c cedilla 147 “ \Ge epsilon 189 ½ \189 vulgar 1/2 232 è \232 e grave 148 ” \Gn eta 190 ¾ \190 vulgar 3/4 233 é \233 e acute 149 • \Gh theta 191 ¿ \191 upsidedown 234 ê \234 e circumflex 150 – \Gl lambda question 235 ë \235 e umlaut 151 — \Gr rho 192 À \192 A grave 236 ì \236 i grave 152 ˜ \Gs sigma 193 Á \193 A acute 237 í \237 i acute 153 ™ \Gt tau 194  \194 A circumflex 238 î \238 i circumflex 154 š \Gw omega 195 à \195 A tilde 239 ï \239 i dieresis 155 › \GD Delta 196 Ä \196 A dieresis/umlaut 240 ð \240 eth 156 œ \PI Pi 197 Å \197 A ring 241 ñ \241 n tilde 157 \GW Omega 198 Æ \198 AE ligature 242 ò \242 o grave 158 ā \[] box 199 Ç \199 C cedilla 243 ó \243 o acute 159 Ÿ \oo infinity 200 È \200 E grave 244 ô \244 o circumflex 160 € \160 euro 201 É \201 E acute 245 õ \245 o tilde 161 ¡ \161 upsidedown 202 Ê \202 E circumflex 246 ö \246 o dieresis/umlaut exclamation 203 Ë \203 E dieresis/umlaut 247 ÷ \: division 162 ¢ \162 cents 204 Ì \204 I grave 248 ø \248 o slash 163 £ \163 pounds 205 Í \205 I acute 249 ù \249 u grave 164 ¤ \164 general currency 206 Î \206 I circumflex 250 ú \250 u acute 165 ¥ \165 yen 207 Ï \207 I dieresis 251 û \251 u circumflex 166 ¦ \166 broken pipe 208 Ð \208 Eth 252 ü \252 u dieresis/umlaut 167 § \167 section 209 Ñ \209 N tilde 253 ý \253 y acute 168 ¨ \168 dieresis/umlaut 210 Ò \210 O grave 254 þ \254 thorn 169 © \169 copyright 211 Ó \211 O acute 255 ÿ \255 y dieresis

J2 ASCII Character Codes and Translations

alpha keyboard B automatically locking...... 142 B→R...... 330 ALRMDAT...... D2 BAR ...... 326 alternant...... 3269 BARPLOT...... 327 AMORT ...... 311 BASIS...... 327 AND ...... 311 BAUD ...... 327 angular motion...... 536 BDISP ...... 27 ANIMATE...... 312 BEEP...... 328 animation...... 231, 239 beeper annunciators in programs ...... 148 user flags...... 127 BER ...... 229 ANS...... 312 Bernoulli equation ...... 519 APEEK ...... 62 Bessel functions...... 229 APLY ...... 220 BESTFIT ...... 328 applications ...... 153 BetaTesting...... 63 APPLY...... 313 BIN...... 328 ARC...... 313 binary integers ARCHIVE ...... 314 comparing...... 112 ARG...... 314 custom display...... 25 arguments representing flags...... 128, 129 verifying...... 224 wordsize...... 112 ARIT...... 315 binary operations ARM→ ...... 63, 641 and ...... 311 arrays convert to real...... 330 applying a program to ...... 220 converting to binary...... 3214 manipulating ...... 212, 234 exclusive OR ...... 3277 maximum and minimum elements...... 216 not...... 3157 sorting elements ...... 216 regular or...... 3161 ARRY→...... 315 rotate...... 3204, 3205, 3209 ASIN...... 315 set wordsize...... 3242 ASIN2C...... 317 shift...... 319, 3227, 3232 ASIN2T...... 317 BINS...... 329 ASINH...... 317 bipolar transistors...... 554 ASM ...... 63 black body...... 382 asm (internal) ...... 642 black body radiation...... 531 ASM→...... 63, 641 BLANK...... 329 ASM2 ...... 642 BOX ...... 329 ASN...... 318 branching structures ASR ...... 319 conditional structures ...... 113, 135 Assembler...... 611 loop structures ...... 117 Assembler syntax ...... 611 program element...... 12 ASSUME...... 319 BRCH menu...... 113, 117 ATAN...... 320 Brewster angle...... 538 ATAN2S...... 321 buckling...... 54 ATANH ...... 322 BUFLEN ...... 330 ATICK...... 322 business ATTACH ...... 323 amortization ...... 311 AUGMENT ...... 323 time value of money...... 3261 AUTO...... 324 BYTES ...... 330 AXES...... 324 AXL...... 325 C AXM ...... 325 C$...... 331 AXQ...... 326 C→PX...... 349 C→R...... 349 C2P ...... 331

Index 2

CROSS...... 347 Directives...... 617 CST...... D3 Disassembler ...... 641 CSWP...... 347 DISP...... 360 CURL...... 348 display current...... 59, 531, 550 area numbers...... 139 cursor (command line) ...... 142 clearing ...... 149 custom menus freezing...... 139 in programs...... 152 DISPXY...... 361 menubased applications...... 153 DISTRIB...... 361 customization DIV...... 362 keyboard...... 318 DIV2...... 362 cycle...... 331, 3163 DIV2MOD...... 362 CYCLOTOMIC...... 348 Divide...... 3300 CYLIN...... 348 DIVIS...... 363 cylinder...... 548 DIVMOD...... 363 DIVPC ...... 363 D dn ...... 364 D→R...... 371 DO...... 364 DARCY...... 349 do looping...... 122, 214, 229 DATE...... 349 DOERR ...... 365 DATE+...... 350 DOLIST...... 365 DBUG ...... 350 DOMAIN...... 366 DDAYS ...... 351 DOSUBS ...... 366 debugging ...... 131, 132 DOT...... 367 DEC...... 351 drag force...... 524 DECR ...... 351 DRAW ...... 368 DEDICACE...... 352 DRAW3DMATRIX ...... 368 DEF ...... 352 DRAX ...... 368 DEFINE ...... 352 DROITE...... 369 defining procedures DROP ...... 369, 3304 compiled local variables in ...... 110 DROP2 ...... 369 local variable structures...... 17 DROPN...... 370 local variables i ...... 19 DTAG...... 370 definite loops ...... 21, 218, 232, 234, 239 DUP...... 370 with counters ...... 28, 212 DUP2...... 370 DEG ...... 353 DUPDUP ...... 371 DEGREE...... 353 DUPN...... 371 degreeminuteseconds...... 3107 E DELALARM...... 353 DELAY ...... 354 e ...... 371 DELKEYS...... 354 EDIT...... 372 DEPND ...... 355 EDITB ...... 372 DEPTH...... 355 editing DERIV ...... 356 programs...... 16 Derivative...... 3291 EGCD...... 372 DERVX...... 356 EGV ...... 373 DESOLVE ...... 356 EGVL...... 373 DET ...... 357 EIZ ...... 154 DETACH...... 357 elastic buckling...... 54 DIAG→...... 358 elastic collisions...... 524 DIAGMAP ...... 358 electricity...... 53, 59 DIFF ...... 359 ellipse...... 544 DIFFEQ...... 359 ELSE ...... 373 diodes...... 552 END...... 373 DIR...... 360 ENDSUB...... 374

Index 4

Fibonacci numbers ...... 21 G FIBT...... 24 GAMMA...... 395 Filename conventions ...... 617 Gamma function...... 3291 FILER...... 387 garbage collection...... 3146 FINDALARM...... 387 gas compressibility...... 3285 FINISH ...... 387 gascompressibility factor...... 527 FIX...... 387 gases...... 525 flags GAUSS...... 395 annunciators...... 127 GBASIS...... 395 binary integer form...... 129 GCD...... 396 clearing...... 127 GCDMOD...... 396 control behavior...... 127 geometry...... 543, 547 controlling logic with...... 216, 218 GET...... 397 default states ...... C1 GETADR ...... 642 preserving and restoring status...... 26, 234 GETI...... 397 program control ...... 127 GETNAME ...... 642 recalling states...... 128, 129 GETNAMES...... 642 restoring states...... 128 global variables setting...... 127, 28, 216, 218, 237 action in programs...... 11 storing states...... 128 disadvantages in programs...... 17 system ...... 127, 128 GOR...... 398 testing...... 127, 216, 218 GRAD...... 398 types ...... 127 GRAMSCHMIDT ...... 399 user...... 127 GRAPH ...... 399 FLASHEVAL...... 388 graphics FLOOR ...... 388 animation ...... 312 fluids...... 518 appending ...... 3101 focal length...... 537 blank ...... 329 FONT→ ...... 389 box drawing...... 329 FONT6...... 388 clearing PICT...... 375 FONT7...... 389 custom...... 239 FONT8...... 389 display text...... 360, 361 FOR...... 390 displaying ...... 3128 for looping....120, 121, 28, 212, 218, 232, 233, 239 drawing arc ...... 313 electrostatic force...... 510 exclusive OR ...... 3101 force ...... 521, 522, 532 freeze display...... 391 FOURIER...... 391 line drawing ...... 3254 Fourier transform...... 386 pixel check...... 3170 Fourier transform, inverse...... 3113 pixel off...... 3171 FP ...... 391 pixel on...... 3171 fractions screenshot...... 3128 converting ...... 3187, 3278 subset...... 3242 FREE...... 391 graphics commands free fall motion...... 535 parallel processing with ...... F2 FREEZE...... 391 graphics objects frequency manipulating...... 232, 234, 239 resonant...... 516 gravitation...... 524, 535, 536 friction losses...... 521 Greater than ...... 3295 FROOTS...... 392 Greater than or Equal...... 3295 FS?...... 392 GREDUCE...... 399 FS?C...... 393 GRIDMAP...... 3100 FUNCTION...... 393 GROB ...... 3101 FXND...... 394 GROBADD...... 3101 GXOR...... 3101

Index 6

L defining procedure ...... 17, 19 UNTIL...... 3265 X entering ...... 17 UPDIR...... 3265 LABEL ...... 3126 XCOL...... 3276 operation...... 12, 17 UPs...... 621, 630 Labels...... 613 XGET ...... 3276 program element...... 12 user input LAGRANGE ...... 3126 XLIB~...... 69 syntax...... 12, 17 reading key ...... 3123 LANGUAGE→ ...... 3126 XMIT...... 3276 local variables ...... 26 waiting...... 3272 LAP ...... 3127 XNUM ...... 3277 action in programs...... 11 userdefined errors...... 133 LAPL...... 3127 XOR ...... 3277 compiled ...... 110 userdefined functions LAST...... 3127 XPON...... 3278 creating...... 17 internal structure...... 110, 111 last argument XPUT ...... 3278 evaluating...... 214 utility programs...... 226 recalling...... 28 XQ ...... 3278 exist temporarily ...... 17, 18, 19 UTPC...... 3265 LASTARG ...... 3128 XRECV...... 3279 naming...... 17 UTPF ...... 3266 LC~C...... 65 XRNG...... 3279 nested ...... 229, 234 UTPN ...... 3266 LCD→...... 3128 XROOT...... 3279 passing between programs...... 233 UTPT...... 3267 LCM ...... 3129 XSEND...... 3280 storing objects in ...... 214, 226 UVAL ...... 3267 LCXM...... 3129 XSERV...... 3280 LOG ...... 3138 LDEC ...... 3129 V XVOL...... 3281 LOGFIT ...... 3138 LEGENDRE ...... 3130 XXRNG...... 3281 logic V→...... 3267 length factor...... 54 controlling...... 218 VANDERMONDE...... 3269 Y Less than...... 3293 controlling with flags ...... 216, 219 VAR ...... 3269 Less than or Equal...... 3294 YCOL...... 3282 functions ...... 216, 218, 225, 226 variables LGCD...... 3130 YRNG...... 3283 Logical Equality ...... 3302 action in programs...... 11 LIBEVAL...... 3130 YSLICE...... 3283 logical functions...... 111, 112 decrementing ...... 125 LIBS ...... 3131 YVOL...... 3284 longitudinal waves ...... 559 incrementing...... 125 light...... 537 YYRNG...... 3284 loop structures VARS ...... 3270 lim...... 3131 counters...... 118, 119, 120, 121, 125 vectored enter...... 237 Z LIMIT...... 3131 definite...... 117, 22, 218, 232, 234, 239 VER...... 3270 LIN...... 3131 ZEROS ...... 3284 do looping...... 122 VERSION...... 3270 LINE...... 3132 ZFACTOR ...... 3285 for looping...... 120, 121 VFY...... 226 linear motion...... 535 ZVOL...... 3285 indefinite...... 117, 122, 25, 214, 216 waves...... 559 linear structure...... 113 keystroke input...... 149 VISIT ...... 3271 Α LINFIT...... 3133 negative steps ...... 119, 121 VISITB ...... 3271 LININ...... 3133 αENTER...... 237, D2 program element...... 11, 12 VOL ...... 14 Links...... 613 start looping ...... 119 voltage...... 59, 551 Π LINSOLVE ...... 3133 start looping ...... 118 VPOTENTIAL...... 3271 list concatenation ...... F2 ΠLIST ...... 3134 summation alternative ...... 126 VSPH ...... 141 list processing programming example ...... 220 test commands in ...... 122, 124 VTYPE...... 3272 Σ LIST→...... 3133 while looping...... 124 VX ...... D14 lists Σ (Sigma Minus)...... 3290 lowercase letters action in programs...... 11 W Σ (Summation)...... 3289 in names...... 17 adding ...... 39 Σ+ (Sigma Plus)...... 3289 LQ...... 3139 WAIT...... 3272 concatenation...... 323 ΣLINE ...... 3132 LR...... 3139 waiting parallel processing...... F1 ΣLIST...... 3134 LR~R...... 65 displaying output...... 151 reversing ...... 3202 ΣX...... 3275 LSQ...... 3139 for keystrokes ...... 148, 149 sorting...... 211, 3230 ΣX*Y...... 3281 LST ...... 153 WALK ...... 239 LN ...... 3135 ΣX^2 ...... 3276 LU ...... 3140 WGT...... 153 LNAME ...... 3136 ΣX2...... 3275 LVAR ...... 3140 Where...... 3286 LNCOLLECT...... 3137 ΣXY...... 3281 WHILE...... 3273 LNP1...... 3137 M ΣY...... 3282 while looping ...... 124, 25 LOCAL...... 3137 ΣY^2...... 3282 Mach number...... 526 WIREFRAME...... 3273 Local Names, Evaluating...... 19 ΣY2...... 3282 Macros...... 616, 622 WSLOG...... 3274 local variable structures MAD...... 3141 advantages...... 18 magnetic field...... 531, 533 as userdefined functions...... 110 magnetism...... 531 calculations with...... 12 magnification...... 537 create local variables...... 17

Index 8 Index 17

N P SSEC ...... 144 STEQ ...... 3235 STIME...... 3235 names P2C ...... 3163 ß STO ...... 3236 action in programs...... 11 PA2B2 ...... 3163 ßENTER...... 237, D3 STO...... 3239 NAMES...... 225 PAD...... 25 STO* ...... 3239 nBASE...... 222 parallel addition...... F2 S STO/...... 3239 NDIST...... 3154 parallel processing ...... F1 SST ...... 3233 STO+ ...... 3238 NDUPN...... 3155 DOLIST...... F1, F4 SST↓...... 3233 STOALARM...... 3236 NEG ...... 3155 multipleresult commands...... F3 stack STOF...... 3237 nested structures...... 228, 229 parallelepiped...... 548 calculations on...... 12 STOKEYS...... 3237 New MASD instructions ...... 626 PARAMETRIC ...... 3163 stack operations Store...... 3303 newlines ...... 13, 140 PARITY...... 3164 depth ...... 355 STORE...... 3238 NEWOB...... 3155 PARSURFACE...... 3164 drop...... 369, 3304 storing NEXT...... 3156 PARTFRAC ...... 3165 drop n ...... 370 programs...... 13 NEXTPRIME...... 3156 PATH...... 3165, 617 drop two...... 369 STOVX...... 3238 NIP...... 3156 PCAR...... 3166 duplicate ...... 370 STOΣ...... 3240 Nmines ...... D6 PCOEF ...... 3166 duplicate n...... 371 STR→...... 3240 NMOS transistors...... 553 PCONTOUR...... 3166 duplicate n, return n ...... 3155 strain ...... 556 nop...... 642 PCOV...... 3167 duplicate twice...... 371 STREAM ...... 3241 NOT...... 3157 PDIM ...... 3168 duplicate two...... 370 stress ...... 53, 556 Not equal...... 3296 PEEK...... 66 nip...... 3156 STRING ...... 621 NOVAL...... 3157 PEEKARM ...... 66 over ...... 3162 string operations NPN bipolar transistors...... 554 pendulum...... 541, 542 pick...... 3169 concatenating ...... 3298 NSUB...... 3158 Percent...... 3292 pick three...... 3169 converting...... 3240 nullspace...... 3123 PERINFO ...... 3168 roll down ...... 3206 first character ...... 3103 NUM...... 3158 PERIOD...... D14 roll up...... 3206 length...... 3226 number bases periodic table...... 3168 rotate...... 3207 parsing...... 3240 converting between ...... 222 properties...... 3183 swap ...... 3244 position ...... 3174 numbers PERM...... 3168 unpick...... 3264 replace ...... 3233 action in programs...... 11 permutation ...... 331, 336, 3163 unrotate...... 3265 substring...... 3242 NUMX...... 3159 PERTBL ...... 3168 stack syntax tail...... 3247 NUMY...... 3159 PEVAL...... 3169 in local variable structures ...... 12 strings NΣ...... 3157 PGDIR...... 3169 test commands ...... 111 action in programs...... 11 phaes delay...... 514 O START...... 3234 as program output...... 149 PHONES...... 146 start looping...... 118, 119, 22 input converted to...... 140 OBJ→...... 3159 Pi (constant) ...... 3290 STARTED ...... D8 manipulating...... 25 object type numbers ...... 113 PICK...... 3169 STARTEQW...... D9 STROBJ ...... 621 objects PICK3 ...... 3169 STARTERR...... D9 STURM...... 3241 action in programs...... 11 PICT...... 3170 STARTOFF...... D9 STURMAB ...... 3242 entering in programs ...... 13 PICTURE...... 3170 STARTRECV...... D9 STWS...... 3242 testing types ...... 113 PIE...... 234 STARTSEND ...... D9 SUB...... 3242 type numbers ...... 113 pie charts...... 234 STARTUP...... D9 subroutines ...... 24, 28, 215, 226 OCT ...... 3160 PINIT...... 3170 state change...... 526, 527 debugging...... 132 OFF...... 3160 PIX?...... 3170 statistics in programs ...... 129 Ohm’s law ...... 510 PIXOFF...... 3171 add to matrix...... 3289 operation...... 129 OLDPRT...... 3160 PIXON...... 3171 best fit...... 3132 singlestep execution...... 131 OPENIO...... 3161 PKT ...... 3171 frequency bins ...... 329 SUBST...... 3243 optics...... 537 plane geometry...... 543 linear fit...... 3133 SUBTMOD...... 3244 OR...... 3161 PLOT ...... 3172 purge matrix...... 338 Subtract ...... 3299 ORDER...... 3162 PLOTADD ...... 3172 remove from matrix ...... 3290 Summation...... 3289 oscillations...... 540 plotting standard deviation...... 3181 SVD ...... 3244 output axes ...... 368 sum...... 3275, 3281, 3282 SVL...... 3244 labeling...... 24 axis tickmark...... 322 STD...... 3234 SWAP...... 3244 OVER...... 3162 bar plots ...... 326 STEP...... 3235 SYLVESTER ...... 3245 conic ...... 343 step junction...... 552, 554 SYSEVAL...... 3245 contour...... 3166

Index 10 Index 15

using arrays...... 212 singlestep execution...... 131, 132 R→C...... 3215 RKF ...... 3203 using calculator clock ...... 24 size ...... 21 R→D...... 3215 RKFERR ...... 3203 using flags...... 220 stopping ...... 14 R→I ...... 3215 RKFSTEP...... 3204 using other programs ...... 24, 28, 215, 226 storing...... 13 RAD...... 3190 RL...... 3204 using statistics commands ...... 234 structures in...... 12 RAND ...... 3190 RLB...... 3205 utility programs ...... 226 subroutines ...... 129 random number...... 3190 RND...... 3205 vectored enter...... 237 test commands...... 111 range...... 3115 RNRM...... 3206 while loops...... 25 trapping errors ...... 135, 136 RANK...... 3191 ROLL ...... 3206 programs turning off calculator ...... 155 RANM ...... 3191 ROLLD...... 3206 newlines in...... 13 userdefined functions...... 110 RATIO...... 3191 ROM version...... 3270 programs using as arguments ...... 28, 214, 238 RCEQ ...... 3192 ROMUPLOAD...... 3206 action for object types...... 11 using as subroutines...... 24, 28, 215, 226 RCI...... 3192 ROOT ...... 3207 applying to elements of a matrix ...... 220 utility...... 226 RCIJ...... 3192 rootfinder are sequence of objects...... 11 verifying ...... 21 RCL...... 3193 in programs ...... 238 beeping ...... 148 verifying input...... 142, 224 RCLALARM...... 3193 ROOTR ...... 238 calculation styles...... 12 viewing ...... 16 RCLF...... 3194 roots causing errors...... 133 waiting for keystrokes...... 148 RCLKEYS...... 3194 in programs ...... 238 checksums...... 21 projectile motion...... 535 RCLMENU...... 3194 ROT...... 3207 comments in ...... 17 PROMPT...... 3179 RCLVX...... 3195 rounding...... 3205 conditional structures...... 113, 135 prompting...... 137, 139, 140 RCLΣ ...... 3195 ROW...... 3207 creating on computer ...... 17 PROMPTSTO ...... 3179 RCWS ...... 3195 ROW+ ...... 3208 cursor position during input ...... 142 PROOT...... 3179 RDM ...... 3195 ROW→...... 3208 debugging...... 131 PROPFRAC...... 3180 RDZ...... 3196 RPL mode...... 635 default input...... 140 PRST...... 3180 RE...... 3196 RPL>...... 3209 displaying input forms...... 145 PRSTC...... 3181 reactance...... 514 RPN syntax displaying menus...... 148, 152, 217, 218, 234 PRTPAR ...... D8 real gases...... 525 converting to...... 227 displaying output...... 149, 150, 151 PRVAR...... 3181 real numbers RR ...... 3209 displaying string output...... 150 PSDEV...... 3181 manipulating ...... 222 RRB ...... 3209 editing ...... 16 pseudoprime...... 3122 REALASSUME ...... D14 rref...... 3210 elapsed time ...... 24 Psi...... 3182 recalling RREF...... 3210 entering...... 13 PSI...... 3182 flag states...... 128 RREFMOD...... 3211 entry modes ...... 16 PTAYL...... 3182 menu numbers...... 152 RRK...... 3211 entry modes during input ...... 142 PTPAR...... D8 RECN ...... 3197 RRKSTEP ...... 3212 error actions...... 133 PTPROP...... 3183 RECT...... 3197 RSBERR ...... 3213 executing...... 13 PURGE...... 3183 rectangle...... 545 RSD ...... 3213 finding roots in...... 238 PUSH...... 3184 recursion...... 22, 228 RSWP ...... 3214 flags in...... 127 PUT ...... 3184 RECV...... 3197 RULES...... 3214 getting input...... 137, 139, 140, 148, 149 PUTI...... 3185 REF...... 3198 RUN menu ...... 133 HALT annunciator...... 131 PVAR ...... 3185 reflection...... 539 S halting ...... 132 PVARS ...... 3186 refraction ...... 537 in local variable structure...... 12, 17 PVIEW...... 3186 REMAINDER ...... 3198 S~N ...... 68 input as strings...... 140 PWRFIT...... 3187 RENAME...... 3198 S→H...... 68 introduction ...... 11 PX→C...... 3187 REORDER...... 3199 SAME...... 3215 killing...... 131, 132 REPEAT...... 3199 Saturn instruction set ...... 623 Q labeling output...... 150 REPL ...... 3199 SB~B...... 67 local variable structures...... 17 QR...... 3188 RES ...... 3200 SBRK...... 3216 loop structures...... 117 qr ...... 3188 resistance SCALE ...... 3216 naming ...... 13 QUAD...... 3189 wire...... 511 SCALEH...... 3216 not evaluating local variables ...... 19 QUOT...... 3189 resonant frequency...... 516 SCALEW...... 3216 objects in ...... 11 QUOTE...... 3189 RESTORE...... 3201 SCATRPLOT...... 3217 on the stack...... 12 QXA ...... 3190 RESULTANT ...... 3201 SCATTER ...... 3217 pausing for output ...... 151 REVLIST ...... 3202 SCHUR ...... 3218 R prompting...... 137, 138, 139, 140 REWRITE ...... 3202 SCI ...... 3218 resuming...... 131, 132, 137, 139, 153, 155 R~SB...... 67 ring...... 546 SCLΣ ...... 3218 scope of local variables in...... 19 R→B...... 3214 RISCH ...... 3202 SCONJ ...... 3219

Index 12 Index 13