# Settings

The calculator has a number of user-configurable settings:

* [Display](#display-settings)
* [Angles](#angle-settings)
* [Command display](#command-display)
* [Decimal separator](#decimal-separator-settings)
* [Precision](#precision-settings)
* [Base](#base-settings)
* [User interface](#user-interface)
* [Compatibility](#compatibility)

The current preferences can be retrieved and saved using the `Modes` command.

## Modes

Returns a program that will restore the current settings.
This program can be saved into a variable to quickly restore user settings.
Use this command along with `ResetModes` to restore settings, as shown in the
example below, which displays `1.3` in `FIX` mode with 2 digits, then restores
the settings and displays `1.3` again using the user's initial settings:

```rpl
«
    Modes
    → M
    «
        @ Fixed mode
        2 FixedDisplay
        1.3 1 DrawText

        @ Restore standard mode
        ResetModes M Evaluate
        1.3 2 DrawText
    »
»
```

Note that the calculator automatically restores the mode when it
[loads a state](#States).

## ResetModes

Reset all the settings to their default value.

This can be used in combination with a stored value from the `Modes` command in
order to save and restore user preferences that a program may modify.

The following code creates a `SaveModes` program that evaluates a program on the stack and restores the settings to what they were before:

```rpl
«
    Modes
    → P M
    «
        P ResetModes M Evaluate
    »
» 'SafeRun' STO


@ Example of use: change display mode twice, restore it afterwards
1.3
«
    6 ENG
    «
        2 FIX
        1.3 1 DISP
    »
    SafeRun

    1.3 2 DISP
» SafeRun

@ Expecting: 1.3
```

## ModesMenu

The `ModesMenu` controls the primary modes of the calculator.

It includes commands to select [trigonometric angle units](#angle-settings), as
well as submenus for mathematical (`MathModesMenu`), user interface
(`UIModesMenu`) or display separators (`SeparatorModesMenu`) preferences .

# Display settings

The display mode controls how DB48X displays numbers. Regardless of the display
mode, numbers are always stored with full precision.

DB48X has five display mode (one more than the HP48)s:

* [Standard mode](#StandardDisplay)
* [Fixed mode](#FixedDisplay)
* [Scientific mode](#ScientificDisplay)
* [Engineering mode](#EngineeringDisplay)
* [Significant digits mode](#SignificantDisplay)

DB48X also features digit [grouping and spacing](#display-grouping-and-spacing)


## DisplayModesMenu

The `DisplayModesMenu` is accessible through 🟨_O_ and gives a quick access to
the various [display settings](#display-settings).

## StandardDisplay

Display numbers using full precision. All significant digits to the right of the
decimal separator are shown, up to 34 digits.

## FixedDisplay

Display numbers rounded to a specific number of decimal places.

## ScientificDisplay

Display numbers in scientific notation, i.e. with a mantissa and an
exponent. The mantissa has one digit to the left of the decimal separator and
shows the specified number of decimal places.

## EngineeringDisplay

Display numbers as a mantissa with a specified number of digits, followed by an
exponent that is a multiple of 3.

## SignificantDisplay

Display up to the given number of digits without trailing zero. This mode is
useful because DB48X can compute with large precision, and it may be useful to
not see all digits. `StandardDisplay` is equivalent to `34 SignificantDisplay`,
while `12 SignificantDisplay` should approximate the HP48 standard mode using
12 significant digits.

## StandardExponent

Select the maximum exponent before switching to scientific notation. The default value is 9, meaning that display uses scientific notation for exponents outside of -9..9.

## MinimumSignificantDigits

Select the minimum number of significant digits before switching to scientific
notation in `FIX` and `SIG` mode. The default value is `3`, meaning that at
least 3 significant digits will be shown.

A value of 0 is similar to how HP calculators before the HP Prime perform. For
example, with `2 FIX`, the value `0.055` will display as `0.06`, and `0.0055`
will display as `0.01`.

A higher value will switch to scienfic mode to show at least the given number of
digits. For instance, with `2 FIX`, if the value is `1`, then `0.055` will still
display as `0.06` but `0.0055` will display as `5.50E-3`. If the value is `2`,
then `0.055` will display as `5.5E-2`. A setting of `1` correspond to what the
HP Prime does.

A value of `-1` indicates that you do not want `FIX` mode to ever go to
scientific notation for negative exponents. In that case, `0.00055` will display
as `0.00`. This corresponds to how older HP calculators render numbers.


## TrailingDecimal

Display a trailing decimal separator to distinguish decimal from integer types. With this setting, `1.0` will display as `1.`. This can be disabled with [NoTrailingDecimal](#NoTrailingDecimal).


## NoTrailingDecimal

Hide the trailing decimal separator for decimal values with no fractional part. In that mode, `1.0` and `1` will both display identically, although the internal representation is different, the former being a floating-point value while the latter is an integer value.

## FancyExponent

Display the exponent in scientific mode using a fancy rendering that is visually similar to the normal mathematical notation.

## ClassicExponent

Display the exponent in scientific mode in a way reminiscent of classical HP48 calculators, for example `1.23E-4`.

## LeadingZero

Display a leading zero for fractional decimal values, i.e. display `0.5` and not
`.5`. This corresponds to the way most HP calculators display decimal values,
with the notable exception of RPL calculators in ` STD ` mode.

## NoLeadingZero

Do not display the leading zero for fractional decimal values, i.e. display `.5`
and not `0.5`. This corresponds to the way HP RPL calculators display numbers in
` STD ` mode.

## MixedFractions

Display fractions as mixed fractions when necessary, e.g. `3/2` will show up as `1 1/2`.

## ImproperFractions

Display fractions as improper fractions, e.g. `3/2` will show up as `3/2` and not `1 1/2`.

## SmallFractions

Show fractions using smaller characters, for example `¹²/₄₃`

## BigFractions

Show fractions using regular characters, for example `12/43`

## ModernBasedNumbers

Display based numbers using the modern DB48x syntax, i.e. `#12AB₁₆` for
hexadecimal on the stack, and `16#12AB` on the command line.
This is the opposite of `CompatibleBasedNumbers`.

## CompatibleBasedNumbers

Display based numbers using the HP syntax, i.e. `#12ABh` for hexadecimal.
This is the opposite of `ModernBasedNumbers`.

# Polynomial settings

Settings for `PRoot`, `PCoef`, `PEval`, `Zeros`, and related polynomial commands.
Numeric limits apply to coefficient vectors, expressions converted to
polynomials, and internal root-finding. Assign a new value on the command line
(e.g. `200 MaxPolynomialDegree`) or use `{ MaxPolynomialDegree } Purge Std` to
restore defaults after tests.

## NewStylePolynomials

Use DB48X polynomial objects for polynomial-oriented commands where the result
is a polynomial in one variable (typically `X` from `AlgebraVariable`).

With this flag active (the default), `PCoef` returns a polynomial built from
the given roots. Coefficient vectors in descending degree order—the form expected
by `PEval`, `PRoot`, and related commands—are obtained with `ToArray` on that
polynomial, or by building the vector directly.

`PRoot`, `PCoef`, and `PEval` accept a coefficient array, list,
polynomial, or univariate expression as input; non-vectors are converted
internally to a coefficient vector.

This is the opposite of [CompatiblePolynomials](#compatiblepolynomials).

## CompatiblePolynomials

Use HP-style coefficient vectors for polynomial root and coefficient commands.

With this flag active, `PCoef` returns a coefficient array in descending
degree order, matching classic RPL calculators. `PRoot` still accepts arrays,
lists, and polynomials; use `ToPolynomial` to turn a coefficient vector into a
polynomial object for symbolic work.

This is the opposite of [NewStylePolynomials](#newstylepolynomials).

## MaxPolynomialDegree

Maximum degree accepted by `PRoot`, `PCoef`, `PEval`, `Zeros`, and coefficient
conversion (`ToPolynomial`, `ToArray` on a polynomial). The value is the highest
power in the univariate polynomial (e.g. `[ 1 2 1 ]` has degree 2).

Range 5 to 100,000; default 100. Inputs with more coefficients than
`MaxPolynomialDegree + 1` report a dimension error.

## MaxLaguerreIterations

Maximum iterations of Laguerre’s method per root when `PRoot` or `Zeros` uses
numerical root finding (after low-degree formulas and rational root search).

Range 5 to 1000; default 80. Increasing the value may help difficult
polynomials converge; lowering it fails faster on pathological cases.

## MaxRootDivisor

Largest integer tested as a candidate divisor when `PRoot` or `Zeros` searches
for rational roots (via divisors of the constant term).

Range 5 to 100,000,000; default 1,000,000. Larger values allow more exact
rational roots on polynomials with big constant terms, at higher cost.

## ShowAsDecimal

Show integer numbers like `25` and fractions like `3/2` as decimal values.
This enables formatting with `FIX` or `SCI` to apply to integer numbers and
fractions. For example, if `25` is on the stack, after `2 FIX`, it will show on
the stack as `25.00`.

This is the opposite of `ShowIntegersAndFractions`.

## ShowIntegersAndFractions

Show integer numbers like `25` and fractions like `3/2` as is.
With this setting in effect, `25` after `2 FIX` will show as `25` and not
`25.00`.

# Display Grouping and Spacing

DB48X can group digits in a way similar to the HP business calculators like the
HP17B. The DB48X version is fully configurable through the `SeparatorModesMenu`.

## SeparatorModesMenu

This menu contains the configuration of separators used when displaying numbers.

## MantissaSpacing

Select the spacing for the non-fractional part of the mantissa.

The default value is `3`, meaning that a spacing separator is inserted every
third digit. `123456789` will show as `123 456 789`. After `4 MantissaSpacing`,
it would show as `1 2345 6789`. A value of `0` disables spacing.

## FractionSpacing

Select the spacing for the fractional part of the mantissa.

The default value is `5`, meaning that a spacing separator is inserted every
fifth digit. `1.23456789` will show as `1.23456 789`. After `3 FractionSpacing`,
it would show as `1.234 567 89`. A value of `0` disables spacing.

## BasedSpacing

Select the spacing for based numbers.

The default value is `4`, meaning that a spacing separator is inserted every
fourth digit. `#1234ABCDE` will show as `#1 234A BCDE₁₆`.
After `2 BasedSpacing`, it would show as `#1 23 4A BC DE₁₆`.
A value of `0` disables spacing.

## NumberSpaces

Separate digits with thin spaces. This is the default.

For example, `1234.567890123` will display as `1 234.56789 012`.

## NumberDotOrComma

Separate digits with dots if `DecimalComma` is active, and with commas if
`DecimalDot` is active.

For example, `1234.567890123` will display as `1,234.56789,012` when the decimal
separator is a `.`, and as `1.234,56789.012` if it is `,`.

## NumberTicks

Separate digits with ticks `’`.

For example, `1234.567890123` will display as `1’234’567’890’123`.

## NumberUnderscore

Separate digits with underscores `_`.

For example, `1234.567890123` will display as `1_234_567_890_123`.


## DecimalDot

Select the dot as a decimal separator, e.g.  `1.23`

## DecimalComma

Select the comma as a decimal separator, e.g.  `1,23`


# Angle settings

The angle mode determines how the calculator interprets angle arguments and how
it returns angle results.

DB48X has four angle modes:

* [Degrees](#Degrees): A full circle is 360 degress
* [Radians](#Radians): A full circle is 2π radians
* [Grads](#Grads): A full circle is 400 radians
* [PiRadians](#PiRadians): Radians shown as multiple of π

## Degrees

Select degrees as the angular unit. A full circle is 360 degrees.

## Radians

Select radians as the angular unit. A full circle is 2π radians,
and the angle is shown as a numerical value.

## Grads

Select grads as the angular unit. A full circle is 400 grads.

## PiRadians

Select multiples of π as the angular unit. A full circle is 2π radians,
shown as a multiple of π.

## SetAngleUnits

When this setting is active, inverse trigonometric functoins `asin`, `acos` and
`atan` return a unit value with a unit corresponding to the current `AngleMode`.
This makes it possible to have values on the stack that preserve the angle mode
they were computed with. The opposite setting is `NoAngleUnits`.

Note that the `sin`, `cos` and `tan` will copmute their value according to the
unit irrespective of this setting. In other words, `30_° SIN` will always give
`0.5`, even when computed in `Rad` or `Grad` mode,

## NoAngleUnits

This is the opposite setting to `SetAngleUnits`. Inverse trigonometric functions
behave like on the original HP-48 calculator, and return a numerical value that
depends on the current angle mode.


# Command display

DB48X can display commands either using a short legacy spelling, usually
identical to what is used on the HP-48 series of calculators, or use an
alternative longer spelling. For example, the command to store a value in a
variable is called `STO` in the HP-48, and can also be spelled `Store` in DB48X.

Commands are case insensitive, and all spellings are accepted as input
irrespective of the display mode.

DB48X has four command spelling modes:

* [Lowercase](#LowerCase): Display ` sto `
* [Uppercase](#UpperCase): Display ` STO `
* [Capitalized](#Capitalized): Display ` Sto `
* [LongForm](#LongForm): Display ` Store `

There are four parallel settings for displaying a variable name such as
`varName`:

* [LowercaseNames](#LowerCaseNames): Display as ` varname `
* [UppercaseNames](#UpperCaseNames): Display as ` VARNAME `
* [CapitalizedNames](#CapitalizedNames): Display as ` VarName `
* [LongFormNames](#LongFormNames): Display as ` varName `


## LowerCase

Display comands using the short form in lower case, for example `sto`.

## UpperCase

Display comands using the short form in upper case, for example `STO`.

## Capitalized

Display comands using the short form capitalized, for example `Sto`.

## LongForm

Display comands using the long form, for example `Store`.

## LowerCaseNames

Display names using the short form in lower case, for example `varName` will show as `varname`.

## UpperCaseNames

Display names using the short form in upper case, for example `varName` will show as `VARNAME`.

## CapitalizedNames

Display names using the short form capitalized, for example `varName` will show as `VarName`.

## LongFormNames

Display names using the long form, for example `varName` will show as `varName`.



# Precision settings

## Precision

Set the default computation precision, given as a number of decimal digits. For
example, `7 Precision` will ensure at least 7 decimal digits for computation,
and `1.0 3 /` will compute `0.3333333` in that case.

DB48X supports an arbitrary precision for [decimal numbers](#decimal-numbers),
limited only by memory, performance and the size of built-in constants needed
for the computation of transcendental functions.

## SolverImprecision

Set the number of digits that can be ignored when solving. The default value is
6, meaning that if the current precision is 24, we only solve to an accuracy of
18 digits (i.e. 24-6).

See also `IntegrationImprecision`

## MaxNumberBits

Define the maxmimum number of bits for numbers.

Large integer operations can take a very long time, notably when displaying them
on the stack. With the default value of 1024 bits, you can compute `100!` but
computing `200!` will result in an error, `Number is too big`. You can however
compute it seting a higher value for `MaxNumberBits`, for example
`2048 MaxNumberBits`.

This setting applies to integer components in a number. In other words, it
applies separately for the numerator and denominator in a fraction, or for the
real and imaginary part in a complex number. A complex number made of two
fractions can therefore take up to four times the number of bits specified by
this setting.

## MaxFactorsBits

Maximum number of bits for integers accepted by prime-related commands:
`IsPrime`, `Factors`, `NextPr`, and `PrevPr`.

The value can range from 64 to 1024 bits (default 160). Integers exceeding this
limit trigger a `Number is too big` error. Raising the value allows factoring
larger numbers but increases memory use and computation time for Pollard's Rho
and Miller-Rabin. Lowering it can prevent excessive CPU usage on large inputs.

## MaxFactorIterations

Maximum number of Pollard's Rho iterations per attempt when factoring integers
with `Factors`.

The value can range from 1024 to 16,777,216 (default 4,194,304). If no factor
is found within this limit for a given Rho attempt, the algorithm tries the
next random starting point. Exhausting all attempts yields a `Bad argument
value` error. Lowering the value speeds up failure detection for numbers that
are hard to factor (e.g. products of two large primes); raising it allows
factoring tougher semiprimes at the cost of longer run time.

## SolverIterations

Number of times the solver will try to find a solution.

## SolverImprecision

Relative imprecision that is tolerated by the solver

## SolverShuffles

Number of times the solver will shuffle the test vector around errors and
singularities.


## MathModesMenu

The `MathModesMenu` controls settings related to mathematical computations.

* `SymbolicResults`
* `AutoSimplify`


# Base settings

Integer values can be reprecended in a number of different bases:

* [Binary](#Binary) is base 2
* [Ocgtal](#Octal) is base 8
* [Decimal](#Decimal) is base 10
* [Hexadecimal](#Hexadecimal) is base 16

## Binary

Selects base 2

## Octal

Selects base 8

## Decimal

Selects base 10

## Hexadecimal

Selects base 16

## Base

Select an arbitrary base for computations

## WordSize

Store the current [word size](#wordsize) in bits. The word size is used for
operations on based numbers. The value must be greater than 1, and the number of
bits is limited only by memory and performance.

## RecallWordSize

Return the current [word size](#wordsize) in bits.


# Command tuning

Various settings can be used to tune specific commands.
See also `IntegrationIterations` and [Polynomial settings](#polynomial-settings).

## MaxRewrites

Defines the maximum number of rewrites in an equation.

[Equations rewrites](#rewrite) can go into infinite loops, e.g. `'X+Y' 'A+B'
'B+A' rewrite` can never end, since it keeps rewriting terms. This setting
indicates how many attempts at rewriting will be done before erroring out.

## →QIterations

Define the maximum number of iterations converting a decimal value to a
fraction. For example, `1 →FracIterations 3.1415926 →Frac` will give `22/7`,
whereas `3 →FracIterations 3.1415926 →Frac` will give `355/113`.

## →QDigits

Define the maximum number of digits of precision converting a decimal value to a
fraction. For example, `2 →FracDigits 3.1415926 →Frac` will give `355/113`.

## →QπMaxPrime

Define the largest prime used when extracting square factors during [→Qπ](#toqπ)
conversion. When converting a decimal to a rational form with π, √*n*, ln, or *e*
factors, the algorithm squares the value, converts to a fraction, then factors out
perfect squares from the numerator and denominator. This setting limits which
primes are tried (2 to 10000, default 100). Lower values speed up conversion on
DM32/DM42 at the cost of missing some √*n* simplifications for numbers whose
square has large prime factors.


# User interface

Various user-interface aspects can be customized, including the appearance of
Soft-key menus. Menus can show on one or three rows, with 18 (shifted) or 6
(flat) functions per page, and there are two possible visual themes for the
labels, rounded or square.

## Header

The `Header` command updates a special variable also called `Header`.

When that variable is present, it must evaluate to something that can render
graphically, either directly a graphic object or a (possibly multi-line) text.

When a header is provided, the normal content of the header, i.e. date, time and
name of the state file, is no longer shown.  However, annunciators and battery
status are still overimposed.

It is the responsibility of the programmer to ensure that the header program
does not draw important data at these locations, and also to make sure that the
header program is "well behaved", i.e. does not leave things on stack. If the
header program generates an error, then that error may get in the way of normal
calculator operations.

For example, the following shows the current time, the current path, the date
and free memory in a two-line header, with a 10 second `CustomHeaderRefresh`.

```rpl
« TIME " " PATH TAIL TOTEXT + + "
" + DATE + " Mem: " + MEM + »
HEADER
10000 CustomHeaderRefresh
```

## CustomHeaderRefresh

This setting indicates how frequently a custom `Header` should be evaluated. The
time interval is expressed in milliseconds.

## ThreeRowsMenus

Display menus on up to three rows, with shift and double-shift functions showns
above the primary menu function.

## SingleRowMenus

Display menus on a single row, with labels changing using shift.

## FlatMenus

Display menus on a single row, flattened across multiple pages.

## RoundedMenus

Display menus using rounded black or white tabs.

## SquareMenus

Display menus using square white tabs.

## CursorBlinkRate

Set the cursor blink rate in millisecond, between 50ms (20 blinks per second)
and 5000ms (blinking every 5 seconds).

## ShowBuiltinUnits

Show built-in units in the `UnitsMenu` even when a units file was loaded.

## HideBuiltinUnits

Hide built-in units in the `UnitsMenu` when a units file was loaded.
The built-in units will still show up if the units file fails to load.

## MultiLineResult

Show the result (level 1 of the stack) using multiple lines.
This is the opposite of [SingleLineResult](#singlelineresult).
Other levels of the stack are controled by [MultiLineStack](#multilinestack)

## SingleLineResult

Show the result (level 1 of the stack) on a single line.
This is the opposite of [MultiLineResult](#multilineresult).
Other levels of the stack are controled by [SingleLineStack](#singlelinestack)

## MultiLineStack

Show the levels of the stack after the first one using multiple lines.
This is the opposite of [SingleLineStack](#singlelinestack).
Other levels of the stack are controled by [MultiLineResult](#multilineresult)

## SingleLineStack

Show the levels of the stack after the first one on a single line
This is the opposite of [MultiLineStack](#multilinestack).
Other levels of the stack are controled by [SingleLineResult](#singlelineresult)

## GraphicResultDisplay

Display the first level of the stack (result) using a graphical representations
for objects such as expressions or matrices. Note that enabling this setting may
increase CPU utilization and reduce battery life compared to text-only
rendering.

This is the opposite of [TextResultDisplay](#textresultdisplay)

## TextResultDisplay

Display the first level of the stack (result) using a text-only representations.

This is the opposite of [TextResultDisplay](#textresultdisplay)

## GraphicStackDisplay

Display the stack levels above the first one using a graphical representations
for objects such as expressions or matrices. Note that enabling this setting may
increase CPU utilization and reduce battery life compared to text-only
rendering.

This is the opposite of [TextStackDisplay](#textstackdisplay)

## TextStackDisplay

Display the stack levels above the first one using a text-only representation.

This is the opposite of [GraphicStackDisplay](#graphicstackdisplay)

## AutoScaleStack

When using [graphic result display](#graphicresultdisplay), automatically scale
down the font size in order to make stack elements fit. Enabling this setting
may increase CPU utilization and reduce battery life compared to fixed-size
rendering.

This is the opposite of [NoStackAutoScale](#nostackautoscale).


## NoStackAutoScale

When using [graphic result display](#graphicresultdisplay), do not automatically
scale down the font size in order to make stack elements fit.

This is the opposite of [AutoScaleStack](#autoscalestack).

## MaximumShowWidth

Maximum number of horizontal pixels used to display an object with
[Show](#show).

## MaximumShowHeight

Maximum number of vertical pixels used to display an object with [Show](#show).

## EditorWrapColumn

Column at which the editor will start wrapping long lines of code.
Wrapping occurs at the end of an object, not in the middle of it.

## TabWidth

Width of a tab in the editor, in pixels.

## ExitKeepsMenu

By default, the `EXIT` key clears the current menu if not editing.
When `ExitKeepsMenu` is set, the `EXIT` key does not clear the menu.

## ExitClearsMenu

Restore the default behaviour where `EXIT` clears the current menu when not
editing.

## ShowEmptyMenu

Show empty menu entries. For example, when selecting the `VariablesMenu` and
there is no variable defined, an empty menu shows up.

## HideEmptyMenu

Restore the default behaviour where empty menus entries are not shown, leaving
more space for the stack display.

## ExplicitConstants

Require an explicit marker to identify a constant from the constant library.
This is the opposite of `AutomaticConstants`

## AutomaticConstants

When parsing, identify the constants from the constants library without an
explicit `Ⓒ` constant marker. For example, `G` will parse as `ⒸG`.

Note that constants, unlike symbols or commands, are always case sensitive,
because there are constants that differ only in case, such as `ⒸG`
(gravitational constant) and `Ⓒg` (gravitational acceleration on Earth).

If a global variable with the same name exists at the time of parsing, it takes
precedence over the constant.

This is the opposite of `ExplicitConstants`

## ExplicitXLibs

Require an explicit marker to identify a library item from the library.
This is the opposite of `AutomaticConstants`

## AutomaticXLibs

When parsing, identify the library entries from the library without an
explicit `Ⓛ` library marker.

```rpl
AutomaticXlibs
```

With this setting, a named library entry like `SiDensity` will work as if it
were a built-in command, and will invoke the library-provided `SiDensity` entry.


```rpl
255_°C SiDensity
@ Expecting 5.11894 93475 7⁳¹⁴ (cm↑3)⁻¹
```

The `AutomaticXLibs` flag is the opposite of `ExplicitXLibs`:

```rpl
ExplicitXLibs
```

With `ExplicitXLibs`, typing `'SiDensity'` will simply produce a name:

```rpl
SiDensity
@ Expecting 'SiDensity'
```


# Statistics settings

## LinearFitSums

When this setting is active, statistics functions that return sums, such as
`ΣXY` or `ΣX²`, operate without any adjustment to the data, i.e. as if the
fitting model in `ΣParameters` was `LinearFit`.

## CurrentFitSums

When this setting is active, statistics functions that return sums, such as
`ΣXY` or `ΣX²`, will adjust their input according to the current fitting model
in special variable `ΣParameters`, in the same way as required for
`LinearRegression`.

## RandomGeneratorBits

Define the number of random bits generated by ACORN random number generator,
between 32 and 4096 bits. The default value is 128 bits. A lower value uses less
memory and accelerates computations, but some digits in the resulting numbers
may not be adequately random. Conversely, a higher value increases true
randomness in the resulting numbers and should be used if you need random
numbers with higher [Precision](#precision) than the default 24 digits.

For example, with a value of 64, the generated random numbers will very often
contain zeros after the 12th digit. The reason is that 64 bits of randomness
corresponds to only 20 digits, which is less than the default 24-digits
precision of DB48X.

## RandomGeneratorOrder

Define the order of the ACORN random number generator, i.e. the value called `k`
in the ACORN documentation. This is the number of seed numbers preserved between
generations. A higher value requires more memory and takes more time to compute
but generates higher-quality random numbers. On DB48X, the ACORN order can be
set between 10 and 256. The default value is 32.


# Compatibility settings

Various settings control the compatibility of DB48X with various classes of HP calculators.

## DetailedTypes

The `Type` command returns detailed DB48X type values, which can distinguish
between all DB48X object types, e.g. distinguish between polar and rectangular
objects, or the three internal representations for decimal numbers. Returned
values are all negative, which distinguishes them from RPL standard values, and
makes it possible to write code that accepts both the compatible and detailed
values.

This is the opposite of [CompatibleTypes](#compatibletypes).

## CompatibleTypes

The `Type` command returns values as close to possible to the values documented
on page 3-262 of the HP50G advanced reference manual. This is the opposite of
[NativeTypes](#nativetypes).

## CompatibleGROBs

When this flag is set, graphic operations will generate HP48 compatible GROB
objects. Note that HP-compatible objects take slightly more memory. This is the
opposite of `PackedBitmaps`.

## PackedBitmaps

When this flag is set, graphic operations will generate DB48x graphic objects,
which are slightly denser and more efficient than HP graphic objects, notably
when the width is not a multiple of 8. For example, if you render the number 32
in HP format, it takes 328 bytes, vs. only 281 bytes in DB48x format.  This is
the opposite of `CompatibleGROBs`.

## NumberedVariables

This flag enables numbered variables similar to what existed on earlier RPN calculators. For example, when the setting is active, `2.5 0 STO` stores the value 2.5 in numbered register `0`.

## NoNumberedVariables

This flag disables numbered variables, behaving closer to the way RPL calculators work. For example, when the setting is active, `2.5 0 STO` generates an `Invalid name` error.

## IgnoreSymbolCase

Ignore the case in symbols, i.e. variables `X` and `x` are the same.
Note that this is different from the way RPL in HP calculators works.

## DistinguishSymbolCase

Distinguish the case in symbols, i.e. variables `X` and `x` are distinct.
This is the way RPL in HP calculators works.


## ListAsProgram

When this setting is set, DB48X behaves like the HP48S and later HP devices and
evaluates lists as if they were programs. For example, `{ 1 2 + } EVAL` returns
`3`. The default is [ListAsData](#listasdata).

## ListAsData

When this setting is set, DB48X behaves like the HP28 and evaluates lists as
data. For example, `{ 1 2 + } EVAL` returns `{ 1 2 + }`.


## KillOnError

An error kills the program without giving you the possibility to debug the
problem. If you want to debug, you need to start the program with `Debug` and
then use the `Continue` command.


## DebugOnError

An error during a program enters the debugger, letting you correct the problem
before resuming execution. This is the default setting.


## TruthLogicForIntegers

When this flag is set, [logical operations](#logical-operations) such as `and`
or `not` applied to integers return `True` or `False`, for compatibility with HP
implementations of RPL.

The opposite setting is `BitwiseLogicForIntegers`.

## BitwiseLogicForIntegers

When this flag is set, [logical operations](#logical-operations) such as `and`
or `not` applied to integers return a bitwise numerical result, which deviates
from the HP implementations of RPL.

The opposite setting is `TruthLogicForIntegers`.

## ListRecursionDepth

This setting selects the depth of recursion for `Map`, `Reduce` or `Filter`.
By default, it is set to `1`, indicating that recursion only applies to the
top-level of the list. This matches the way `Map`, `Reduce` and `Filter` work in
most programming languages.

A value larger than `1` can be used to recurse beyond the first level.
On the HP50G, `Map` applies recursively to all levels. This can be achieved by
setting `ListRecursionDepth` to `0`.


# Evaluation settings

The following settings are related to evaluation of programs and objects.

## SaveLastArguments

Save last arguments when evaluating commands interactively.
This is disabled by `NoLastArguments`.

Saving arguments during program execution is controlled by a separate setting,
`ProgramLastArguments`.

## NoLastArguments

Disable the saving of last arguments when interactively evaluating commands.

## ProgramLastArguments

Save last arguments during program execution. This may impact performance,
and is disabled by default (`NoProgramLastArguments`).

## NoProgramLastArguments

Disable the saving of command arguments during program execution.
If `SaveLastArguments` is set, arguments to interactive commands will still be
saved.


# Plot settings

The following settings are related to plotting

## GraphingTimeLimit

Maximum number of milliseconds that can be spent rendering an object
graphically. The default is 250ms.

## ShowTimeLimit

Maximum number of milliseconds that can be spent rendering an object for the
`Show` command. The default is 10000 (10s)

## ResultGraphingTimeLimit

Maximum amount of time that can be spent rendering the result (level 1 of the
stack) graphically. The default value is 1500 (1.5s)

## StackGraphingTimeLimit

Maximum amount of time that can be spent rendering the levels of the stack above
level 1. The default value is 250ms.

## TextRenderingSizeLimit

Limit in bytes for the size of objects to be rendered on the stack. Objects that are larger than this size are shown on the stack as something like
`Large text (399 bytes)`.

## GraphRenderingSizeLimit

Limit in bytes for the size of objects to be rendered on the stack
graphically. Objects that are larger than this size are text.


## XYPlotBins

Number of bins used to draw XY plots (e.g. `TruthPlot`) when the `Resolution` is
at its default value of `0`.


## StatsPlotBins

Number of bins used to draw statistical plots (e.g. `BarPlot`) when the
`Resolution` is at its default value of `0`.


# States

The calculator can save and restore state in files with extension `.48S`.
This feature is available through the `Setup` menu (Shift-`0`).

The following information is stored in state files:

* Global variables
* Stack contents
* Settings
