4-4 Computer Algebra Commands
they will be returned as variables. Some other CAS commands will always replace variables with their
numeric results.
• Because of the above, variables used in symbolic operations should not have the same names as
variables stored in the current directory/folder (or in directories above this directory). If, for example,
x is the current variable, and a variable called ′x′ exists in the current directory or in the HOME
directory, then the value stored in ′x′ might be used instead of the symbolic variable x.
• The modulo value used in modulus calculations is 13 after the calculator is reset. If the CAS modes are
reset 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 out any modulus operations.
Using the CAS
Examples and Help
In addition to the examples in this Command Reference, the built-in CAS help provides examples of CAS
operations.
• If an operation is selected from the operations catalog,
…µ, and if help is available, then pressing the
!HELP key shows help information. Pressing the %OK% menu key copies the operation to the command line,
ready for use.
• If an operation is selected from the CASCMD list,
IL CASCMD, the same help information is available,
but instead of
%OK%, there is an !ECHO key to copy the name and example to the command line. Evaluating
the example and comparing it with the result shown in the help text is a quick way to check if the CAS
settings are correct.
Compatibility with Other Calculators
Some CAS operations replace similar operations that were available on older HP calculators. The older
operation names have been kept on the hp48gII and the hp49g+ so that programs written for the older
calculators will work on the new models without being rewritten. This means that some commands and
functions have more than one name; the CAS names are in this part of the Command Reference, the older
names are listed in Chapter 3. In other cases, operations that would naturally belong with the Computer
Algebra System were already available on the older models; these operations too are described in Chapter 3.
The older models whose programs can be run on the hp48gII and the hp49g+ are the HP 28C and HP 28S,
the HP 48S and the HP 48SX, and the HP 48G, HP 48GX and HP 48G+. These models only had the RPL
programming language, so programs written for them should be used in RPN mode. The HP 49G is a more
recent model which does have the CAS, and Algebraic mode, so programs written for it in either RPL or in
Algebraic mode can be used on the hp48gII and the hp49g+. The CAS of the hp48gII and the hp49g+ is also
very similar to the CAS of the HP40 models, so programs and books written for them may be helpful.
Extending the CAS
Users can extend the CAS by writing their own functions or commands. Functions can be written as UDFs
(User Defined Functions); see the descriptions of DEFINE in Chapter 3 of the calculator User’s Guide and in
Part A of this Command Reference, and also DEF in this part. The pattern matching commands ↑MATCH
and ↓MATCH allow the user to write programs to edit algebraic expressions. Here is an example of an RPL
program using ↑MATCH to replace the square root of a square of a symbol with the symbol itself. The
wildcard &A means that any symbol or expression squared can be replaced. The conditional expression &A≥0
means that the replacement is only carried out if the square root is not of a negative value.
« { '√(&A^2)' &A '&A≥0' } ↑MATCH »
Dealing with unexpected CAS results or messages
If a CAS operation gives an unexpected result or message, check the list of points given in the section on CAS
settings. Some problems can be caused by unexpected settings, so it can be helpful to reset all CAS settings to
their default values, with the CASCFG command, or with the
!RESET key in the CAS settings menu.