Entry modes The 35s supports both RPN and algebraic entry modes. Like most HP calculators, it defaults to RPN. The entry mode can be easily changed by the user. An annunciator on the display indicates the current entry mode. In RPN mode, it uses a four-level
stack, as have all HP's non-graphing RPN calculators since the earliest days. In contrast to the usual computer-science terminology, RPN calculators such as this refer to the operational end of the stack as the
bottom and the far end as the
top. The stack levels are named X (the bottom), Y, Z, and T (the top); they have no connection with the
variables of the same names. Level X appears on the lower line of the display and level Y on the upper line. Each stack level can contain any of the data types supported by the machine: real number, complex number, or vector. Various functions are provided for manipulating the stack, such as and to roll, to swap X and Y, to recall the last-used X value, and to swap X and a named variable. Algebraic mode works by the user entering an expression, then pressing to have it evaluated. The expression appears on the upper line of the display, the result on the lower line. The expression can be edited using the
arrow and
backspace keys, and re-evaluated as desired.
Units and fractions In keeping with the calculator's retro theme, conversions between
Imperial/
US units and the equivalent standard
metric units feature prominently on the 35s's keypad. To facilitate those who still use traditional units, and for other uses, the calculator also allows the entry of values as mixed
fractions and the display of values as mixed fractions. Entry of mixed fractions involves using
decimal points to separate the parts. For example, the sequence converts inches to 10.0 cm (approximately). The calculator may be set to automatically display values as mixed fractions by toggling the key. The maximum denominator may be specified using the function. Numbered
flags may be set to specify which of three denominator systems is to be used: most precise denominator,
factors of the maximum (for example 2, 4, 8, 16, when the maximum is 16), or a fixed denominator. Two small arrow symbols on the display indicate if the actual value is slightly above or below that displayed. There are no functions to directly extract the parts of the displayed fraction.
Complex numbers Previous (and other current) HP calculators have handled complex numbers in a variety of ways. In the HP 33s, complex numbers were stored as two separate values, and the "complex" modifier was used to indicate that an operation was to treat the stack as containing complex numbers. For example, adding and involved the following keystrokes: , which used up all four stack levels. The 35s stores complex numbers as single values, which can then be operated on in the standard ways. The above example of adding and then becomes: . On the 35s, the number of functions able to handle complex numbers is limited and somewhat arbitrary. For example, directly taking the
square root of a negative real number results in an
error message instead of a complex number. This is strictly correct given that a nonnegative
real number a has a unique nonnegative square root and this is called the
principal square root which is denoted by . The symbol √ is called the
radical sign or
radix. For example, the principal square root of 9 is 3, which is denoted by = 3, because and 3 is nonnegative. However raising x to the power of 0.5 using the key works if the number is entered as a real number with a complex part equal to zero. A vector may be stored on the stack, or in any variable, as a single value, and processed by various functions. It is entered by the user starting with a square bracket , then the element values separated by commas . Vectors can be added, subtracted, multiplied and divided by
scalars. Two vectors of similar dimensions may be added and subtracted, and multiplied to give their
dot product. The function will return a vector's
magnitude. A
cross-product function is not available, nor any function to extract individual elements from a vector, but these can be readily calculated by the user. Vectors can also be used to simply store up to three real numbers together, thereby increasing the calculator's storage capacity, though with more complexity and reduced speed. HP have published program code for the 35s which enables this.
Number bases The calculator can be set to display values in binary, octal, or hexadecimal form, as well as the default decimal. When a non-decimal base is selected, calculation results are truncated to integers. Regardless of which display base is set, non-decimal numbers must be entered with a suffix indicating their base, which involves three or more extra keystrokes. The permanently allocated variables and the statistics registers may also be accessed indirectly, using negative sequence numbers of -1 to -32. The calculator provides a set of 41
mathematical and
physical constants, which may be scrolled through and selected using the key. A set of 12 binary
flags are available; every flag can be set by the user to determine the behaviour of the calculator, five of these may be used for any purpose. Stored equations occupy a byte for each character and three bytes overhead. Program steps occupy three bytes. Steps which specify values or equations occupy more memory, as indicated above. The amount of used and available memory can be readily checked by the user, but not by programs. The user can clear all indirect variables above a specified number, with the function.
Equations As well as variables and programs, the user can store any number of
equations in the calculator. "Equations" in this context means
expressions (
f(
x,...) ),
equalities (
f1(
x,...) =
f2(
x,...) ), and
assignments (
y =
f(
x,...)), which are each handled in different ways. Equations typically include named variables whose values are to be supplied by the user at run time, but can also take values from the stack. Equations are entered in algebraic notation, even when RPN entry mode is active. They are stored in a list which is accessed with the key, allowing the user to scroll through the list, add, edit and delete equations, and select an equation to be processed. An equation may be processed in a number of ways. • It may be evaluated using the or key, with the user being prompted to enter values for the included variables. In the case of an assignment, the target variable receives the result. • It may be solved for any one of the included variables, using the function. The calculator uses its logic to attempt to isolate the value of the required variable, after prompting the user for the values of the other variables. Since this process takes time, and the equation may have more than one solution, it is guided by two "guesses" which it assumes to have been provided by the user, in the stack's X register, and in the variable's existing value. • It may be
integrated, using the function. The user first places the two
interval limits on the stack, then selects the equation and the function, which prompts for the name of the variable to be integrated and the values of the other variables. There are also two built-in entries in the equations list, to allow solving all variables in a
system of linear equations. Systems of two equations with two variables, and three equations with three variables, are supported. Solving and (especially) integrating equations take both time and memory. Efficiencies may be made by reducing the display precision and ensuring enough memory is available. Since the content of an equation is not validated unless and until it gets processed, it may contain any sequence of characters, including text strings. This may be taken advantage of in order to include lines of notes in the equations list (as is shown in the main picture at the top of this page).
Programming The HP 35s is keystroke-programmable, meaning that it can remember and later execute sequences of keystrokes to solve particular problems of interest to the user. Program keystrokes are fully merged: functions accessed via shift keys or menus are recorded as one keystroke, not two or more. These keystroke programs, in addition to performing any operation normally available on the keyboard, can also make use of conditional and unconditional branching and looping instructions, allowing programs to perform repetitive operations and make decisions. All programs are stored in one continuous program space, and may be created and edited by switching to programming mode, using the key. Within the program space, up to twenty-six alphabetic
labels may be defined in the form , and each label may be followed by up to 998 other steps, so that any step may be targeted by a ("
go to") or ("
execute") instruction in the form (or just for the label step itself, A001). Any steps before the first label are numbered with four digits, but these steps cannot be targeted. Subsequent insertion or deletion of steps in program space results in the automatic correction of GTO/XEQ instructions to reflect changes to the targeted step numbers. It is conventional to use each label to mark the start of a separate program, so that any program may be executed by a command in the form . Program execution can be interrupted or resumed by pressing the ("run/stop") key, and the program step pointer can be moved using the and keys. There is no connection between program labels and the variables of the same names. As in normal operation, programming can be done in either RPN or algebraic (infix) mode. RPN-mode programs are usually smaller and faster. Here is a sample program that computes the
factorial of an integer number from 2 to 69 (ignoring the calculator's built-in factorial/
gamma function). There are two versions of the example: one for algebraic mode and one for RPN mode. The RPN version is significantly shorter.
Algebraic version:
RPN version: Equations may be embedded in programs, as a single program step. The calculator's settings include a numbered flag which specifies whether equations in programs are to be evaluated or displayed at run time. Since an equation can contain any sequence of characters, it may be composed as a message to be displayed. After displaying a message, the program either stops until is pressed, or if a (pause) instruction follows the message then it pauses for one second before continuing. Programs may be solved and integrated in much the same way as equations. Instead of selecting an equation from a list, the user presses , then the program's label, and either or , which prompts for the name of the target variable. The existing values of the other variables are used, unless the program contains instructions to make the program prompt for a value. In the case of solving, the program is treated as an expression whose return value (the value left on the stack) should be zero. Programs can also contain instructions for solving and integrating other equations/programs. ==See also==