Commit graph

174 commits

Author SHA1 Message Date
Christophe de Dinechin
2240b6edfa Release 0.7.3 "Perfume" - Mostly bug fixes
This release is mostly about bug fixes, improving the build on
simulator, and accelerating the test suite while keeping it stable.

** New features **

* simulator: Add F8 key to save state in the simulator
* errors: Add a beep when an error is shown
* linux: Add `-s` option for screen scaling (when Qt gets scaling wrong)
* equations: Get library equation value for plotter, solver and integrator
* characters: Add constant, equation and lib markers to RPL menu
* characters: Add music-related characters and character menu
* commands: Add missing stack commands (nip, pick3, ndupn, unrot, unpick)

** Bug fixes **

* variables: Clone purged objects on stack after `Purge`
* units: unit * symbolic is preserved as is (e.g. `'A'_m`)
* compare: Enforce the `NumericalResults` flag for comparisons
* constants: Fix parsing of constants, equations and library items
* sto: Repair `file exists` error storing to a source file
* simulator: Do not try to create directory if it exists
* Report file errors, e.g. permissions or I/O errors
* equations: Mark `c` and `R` as constants in equations
* simulator: Double clicks are now considered as virtual keyboard touches
* ui: Emit only one beep, not two, for a syntax error on the command line
* ui: Avoid rare null-dereference crash when menu label is not set
* complex: Report a syntax error if the second half is empty
* utf8: Do not accept constant/equation/library codepoint in names
* units: Multiplying by `1_m` is OK even with algebraic
* tests: Avoid case where CLEAR does not clear errors
* audio: Improve audio reliability on the simulator
* linux: Rewrite the audio-generation code to avoid crashes
* linux: Avoid infinite recursion in the tests
* linux: Fix warnings about unused variables
* linux: Avoid warnings about null pointer in strcmp
* linux: Avoid build error due to bad `ularge` overload in settings
* linux: Fix type issue for the Insert function (reported as a warning)
* linux: Remove warning about mixing enums and integers
* linux: Avoid error on printf format
* linux: Avoid warnings about type qualifiers
* linux: Remove warnings about incompatible function casts
* linux: Address warnings about missing initializers
* linux: Fix warning about prinf formats
* linux: Address warning about signed vs unsigned
* linux: Remove warning about fall-through switch statement
* linux: Remove warnings about unused arguments
* tests: Repair several tests that were unstable due to scrolling images
* tests: Increase memory size to avoid occasional out of memory failures
* object: Make `as_uint32` and `as_uint64` consistent for negative input

** Improvements **

* ui: Emulate HP48/HP50G behavior for errors (do not require key to continue)
* simulator: Add I/O wrapper around file state save/restore
* dmcp: Remove double return in the code
* simulator: Accept numeric keys in DMCP menus
* doc: Add Kjell Christenson to list of authors
* tests: Run command-line tests silently
* tests: Clear settings the fast way for quick tests
* dmcp: Do not treat the buzzer as a recorder error (avoid message noise)
* simulator: Ensure error messages show up in a recorder dump
* tests: Increase memory size to avoid failing tests
* tests: Increase delay waiting for function plots to appear
* tests: Refactor test suite interaction with RPL thread to accelerate it
* tests: Add a delay before launching the test thread to load initial state
* tests: Add missing reference picture for `char-menu`

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-25 00:48:37 +01:00
Christophe de Dinechin
cee7fa003f stack-cmds: Add pick3 command
Add the `pick3` command, not connected in the menu yet.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-25 00:30:57 +01:00
Christophe de Dinechin
94782a374c doc: Add Kjell Christenson to list of authors
Add Kjell Christenson to AUTHORS and help file.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-22 14:34:43 +01:00
Christophe de Dinechin
df472471ef Release 0.7.2 "Light" - Libraries, Characters menu
This release introduces four relatively significant features:

1. An Equation Library
2. A more general Library
3. Character menus
4. A character modification catalog

There are also a number of bug fixes and improvements.

=== Features ===

* The *Equation Library* is similar in principle to what is found in the HP50G.
  It is intended to store equations covering a variety of topics.
  The Equation Library is accessible using the _EQS_ key (🟦 _'()'_).
  It is presently only very sparsely populated, but a future release should
  add the equations listed in Chapter 5 of the *HP50G Advanced User's Reference
  Manual*. Elements of the Equation Library appear as named *Equation Objects*.
  The Equation Library is configured by file `config/equations.csv`.

* The *Library* is similar to the Equation Library, but for all kinds of objects
  such as programs or code snippets. The Library is accessible using the _LIB_
  key (🟦 _VAR_). It can be used to customize your calculator, and is intended
  to play the roles of the `CST` variable (quick access to common features)
  and Library Objects / XLIB (external extensions to RPL). Elements of the
  Library appear as named *Library Objects*.
  The Library is configured by file `config/library.csv`.

* The *Characters Menu* lets you enter Unicode characters easily, by presenting
  various classes of characters, such as `RPL`, `Greek` or `Punct`.
  The Characters Menus is accessible using the _CHAR_ key (🟦 _2_).
  It can be used to enter international characters (e.g. Greek or Cyrillic), as
  well as special characters such as arrows or blocks.
  The Characters Menu is configured by file `config/characters.csv`.

* The *Characters Catalog* appears when the `Catalog` is active and the cursor
  is inside some text object. It gives you access to characters that are
  visually close to the character on the left of the cursor. For example, after
  typing `A`, the presented choices include `À`, `a` or `α`.
  The Characters Catalog is configured by file `config/characters.csv`.

* compare: Add comparisons for `true` and `false` values

* Add `TEVAL` command (timed evaluation)

=== Bug fixes ===

* Do not add unnecessary parentheses in ratios, e.g. `(A+B)/(X-Y)`
* Make sure we can save back the configuration files correctly
* Improve access path checks to accept `config:constants.csv`.
* Avoid syntax error in `1/(1+x)` due to `1/` being seen as a fraction
* unitfile: Remove slight risk of bad menu display after garbage collection
* date/time: Make sure we save the stack and last args for `Date`, `Time`, ...
* parser: Skip spacing when parsing numbers (to parse back `→Text` result)
* time: Fix rendering of DMS time in lists, matrices, vectors
* catalog: Fix a subtle bug on DM32 leading to a crash using the catalog

=== Improvements ===

* constants: Get values of special `π` and `e` by name
* constants: Add prefix in editor to identify constants, equations and xlib
* constants: Represent constants with an index for memory and performance
* constants: Parse units containing text
* constants: Allow `RCL` to recall a constant value
* units: Direct insertion of units after numbers
* menu: Update `Roll` and `RollDown` menu entries
* show: Show all decimals for decimal values
* help: Display the correct on-line help topic for constants
* catalog: Use less memory for the sorted IDs
* integrate: Use numerical computations for faster convergence
* locals: Improve error message for bad locals
* graph: Improve graphical rendering of constants (bold) and equations
* graph: Do not add unnecessary parentheses in ratios
* tests: Add tests for characters menu/catalog
* tests: Fix the `.` vs `0.` test
* ui: Do not enter DMS inside text
* tests: Display disabled tests in gray
* catalog: Keep a single spelling, e.g. no `add` duplicates
* tests: Add extra delay in the wait for update
* makefile: Add dependency of 'all' to the decimal constants
* save: Improve rendering control when saving files
* stack: Do not save stack in plot, integration or solver
* debug: Disable debugging when launching a program from function key
* simulator: Avoid piling up QT draw requests
* doc: Update performance numbers for 1M loops
* simulator: Add sound support
* simulator: Lazy screen refresh
* dmcp: Add UI refresh callback
* simulator: Move QT-dependent code out of dmcp.cpp
* Add reduced font
* runtime: Various changes to isolate QT build from the rest

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-12 08:04:11 +01:00
Christophe de Dinechin
de81f8a61f files: Make sure we can save back the configuration files
Tested that we can read and save back the `CONFIG:CONSTANTS.CSV` file
using the `STO` command, as indicated in the documentation.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-11 16:00:36 +01:00
Christophe de Dinechin
f68f66c339 help: Display the correct on-line help for constants
For constants, equations and library (xlib) as well as function keys
calling them, we need to build the underlying name for the help entry.

This commit does not add the help entries.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-11 12:59:38 +01:00
Christophe de Dinechin
9e95425850 library: Add equations library and object library
These are two catalogs that behave much like the constants catalog,
and inherit most of the code.

The equations library is intended to store standard equations.

The library is for standard objects and various useful objects or
programs.

Both can be organized by topics.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-11 11:20:42 +01:00
Christophe de Dinechin
f81745fa97 characters: Add character catalog
Add character catalog when inside text.
Define character menus with various languages and shapes.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-11 01:49:10 +01:00
Christophe de Dinechin
18352159b0 doc: Update performance numbers for 1M loops
Ran 1M loops with hardware-accelerated, updated the numbers.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-08 12:13:36 +01:00
Christophe de Dinechin
c62430ce20 Release 0.7.1 "Whip" - Quick bug fixes
Inserting variables, constants or units in a program was broken.
Also a few less critical fixes.

== Bug fixes ==

* decimal: Apply `MinimumSignificantDigits` to `Sig` modes
* tests: Fix missing `]` at end of vector
* ui: Insert commands for unit conversions, constants and variables
* tests: Adjust help screen snapshot for authors
* menus: Do not clip text for hierarchical menus
* constants: Do not use units that don't parse correctly
* dmcp: Day of week convention adjustment
* help: Fix YouTube video preview

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-04 02:16:42 +01:00
Christophe de Dinechin
467f271bbf decimal: Apply MinimumSignificantDigits to Sig modes
It is desirable to display `sin(10)` as `0.17...` instead of using
scientific notation. Ensure that:

1. `MinimumSignificantDigits` applies to `Sig` modes (incl. `Std`)
2. `StandardExponent` is respected for negative exponents

Fixes: #851

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-04 02:16:42 +01:00
Christophe de Dinechin
ce963418fc help: Fix YouTube video preview
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 16:00:53 +01:00
Christophe de Dinechin
2dccc72885 Release 0.7.0 "Temple" - Graphics Equation Rendering
This release introduces a few major improvements, including graphical
rendering of equations and matrices, the `Show` command to display
large objects full-screen, customizable constants, and date-related
operations.

== New features ==

* Graphical rendering of equations, fractions, matrices, vectors and
  lists. In graphical rendering mode, variables are showin in italics.
* Constants in the `ConstantsMenu`, split into categories, and loading
  from an optional `config/constants.csv` file, in a way
  similar to what existed for units.
* Inverse trigonometric functions (`asin`, `acos` and `atan`) now
  produce unit objects with the current angle mode as a unit. This can
  be configured by the `SetAngleUnits` / `NoAngleUnits` flags.
* `Cycle` (EEX key) now cycles between angle units.
* `R→D` and `D→R` commands to convert between degree and radian in a
  purely numerical way (no unit). This is for compatibility with HP.
* Add `→Deg`, `→Rad`, `→Grad`, `→πr` commands, which convert a number
  to the target unit using current angle mode, and convert an angle to
  the target angle unit.
* Conversion from DMS to HMS and from HMS to DMS
* Rendering of dates: `19681205_date` renders as `Fri 5/Dec/1968`,
  with a format configuration using the same flags as for the header.
  Note that the date format is `YYYYMMDD`, _not_ the same as on HP
  calculators. This allows `YYYYMMDD.hhmmss` for dates with time.
* `Date` and `Time` command to return the current date and time.
  Additionally, `DateTime` returns both date and time, and
  `ChronoTime` returns the time with 1/100s precision.
* `→Date` and `→Time` commands to set the system date and time
* `Date+`, `DDays` and date arithmetic using `+` or `-`, using day
  units for the results. As an extension relative to HP calculators,
  these will accept fractional days, or other time units. For example,
  adding `1000000_s` to `19681205_date` generates a date with time
  result, `Tue 16/Dec/1968, 13:46:40`
* `JulianDayNumber` and `DateFromJulianDayNumber` commands to convert
  between dates and Julian day numbers. These commands also accept
  fractional input.
* `Show` command showing a full-screen graphical rendering of the
  result on the stack. The resut is size-adjusted. For example, you
  can display all digits in `200!`. If the result does not fit on the
  screen, you can scroll using the _◀︎_ and _▶︎_, as well as _8_, _6_,
  _4_ and _2_. The maximum pixel size for `Show` is set by `MaxW`
  (default is the width of the LCD), the maximum height is set by
  `MaxH` (default is 2048 pixels).
* `AutoScaleStack` and `NoAutoScaleStack` settings to automatically
  adjust the font size for the stack elements.
* Support for system flags -20 to -26 (infinite results, overflow and
  underflow).

== Bug fixes ==

* simulator: Adjust DMCP month off-by-one error
* Repair insertion of `while` loops and similar commands on the
  command line
* Use stack format when drawing an object with `DrawText` (`DISP`)
* Arithmetic on unit objects no longer auto-simplifies, e.g.
  `1_s 1_s -` returns `0_s` and not `0`.
* Perform computations for `→Q` using integer values, which avoids an
  issue where increasing the number of iterations with an unachievable
  precision could prodduce `1/1` as the fractional result.
* Repair auto-simplification for `i*i=-1`
* Display a negative mixed fraction as `-1 1/3` and not `1 -1/3`.
* Do not insert `()` after a multiplication in algebraic mode
* Accept units and tagged objects in `PolarToReal` and `RealToPolar`
* Accept angle units as input for `→DMS`
* Off-by-one clipping error in header, erasing the shift annunciator
* Fix help for `FC?` (incorrectly stating that it tested for flat set)
* Lookup units and constants in a case sensitive way
* Fix labels for `ExpFit` and `LinFit` in `RegressionMenu`.

== Improvements ==

* tests: Adjust tests to match bugs fixed in v0.6.5
* dms: Accept entering minutes without third dot, e.g. `1.2.3 ENTER`
* menus: Split the Time, Date and Alarm menus
* Split rendered objects at space boundaries. This notably ensures
  that large numbers are split at digit grouping boundaries, and makes
  it possible to display larger programs on the stack. The rendering
  of programs and matrices/vectors/lists has also been fine-tuned.
* The "white circle" glyph has a thicker border, makes it more
  readable in menus.
* doc: Update the list of unimplemented features
* menus: Draw a white circle for disabled flags, and allow the menu
  function to toggle the flag. This made it possible to reduce the
  number of menu entries for flag-heavy menus.
* Mixed fractions are now the default, as opposed to improper fractions
* doc: Improve the quickstart guide, adding videos and screenshots
* doc: Improve the documentation for sin, cos and tan
* tests: Make it possible to interrupt a running test
* help: Skip HTML tags, e.g. <video>
* simulator: Add screenshot capability, and reduce window height
* menus: `ToolsMenu` selects time, date or angle menu based on units

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 15:36:39 +01:00
Christophe de Dinechin
a74414fcc7 Update AUTHORS list
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 14:02:15 +01:00
Conrado Seibel
8808f78089 Fix description of TestFlagClear 2024-03-02 14:02:15 +01:00
Christophe de Dinechin
3db955b2ab doc: Add videos and pictures to quickstart guide
Add some quick videos and screen snapshots to the quickstart guide.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 14:02:14 +01:00
Christophe de Dinechin
31e76f6588 doc: More steps in the Quickstart Guide.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 14:02:14 +01:00
Christophe de Dinechin
51e56ad2c7 doc: Improve documentation for sin, cos and tan.
Add documentation inspired by the HP50G reference manual.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 14:02:14 +01:00
Christophe de Dinechin
dd5db54d97 arithmetic: Symbolic and numeric infinity
Add support for the `InfinityValue` (-22) flag, described in the
HP50G as the "Infinite result exception" flag.

When the flag is set, infinite results are returned either as symbolic
constant infinity `∞` or as its value, currently defined as
`9.99999E999999`.

Whether the infinity value is returned symbolically or numerially
depends on the `NumericalConstants` (-2) and `NumericalResults` (-3)
flags.

Fixes: #835

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 14:02:14 +01:00
Christophe de Dinechin
220d93b1c3 stack: Add the Show command
The `Show` command displays an object graphically using the entire
screen, with the possibility to scroll horizontally and vertically.

Fixes: #392

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 01:11:00 +01:00
Christophe de Dinechin
e495b32c90 stack: Add setting for stack autoscaling
Since this may require additional CPU power and drain the battery faster,
add a setting to disable stack auto-scaling.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 01:11:00 +01:00
Christophe de Dinechin
9b451d7887 time: Add ChronoTime command
The `ChronoTime` command returns time with centisecond precision.

Fixes: #827

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 01:11:00 +01:00
Christophe de Dinechin
afdcf1663e date/time: Add JulianDayNumber command
The `JulianDayNumber` returns the Julian day number for the input date.
This may be fractional if the input date contains a time, see `DateTime`.

See https://en.wikipedia.org/wiki/Julian_day for details

Fixes: #826

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 01:11:00 +01:00
Christophe de Dinechin
13958d1ac1 time: Add commands to set the system date and time
Add the `→Date` command to set the system date,
and the `→Time` command to set the system time.

Fixes: #823

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 01:11:00 +01:00
Christophe de Dinechin
325fae2b7c commands: Add Date, Time and DateTime commands
The `Date` command returns the current date
The `Time` command returns the current time
The `DateTime` command returns the current date with time

Fixes: #666

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 01:11:00 +01:00
Christophe de Dinechin
2782e32e42 expressions: Graphics rendering
Graphics rendering of expressions

Fixes: #47

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 01:11:00 +01:00
Christophe de Dinechin
beaaee23e4 constants: Evaluate constants from config/constants.csv
Dynamic constants menu, similar to units menu, which is populated
either from an internal table, or from `config/constants.csv`

Fixes: #497

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 00:55:00 +01:00
Christophe de Dinechin
5cf4b7f4ef doc: Update some of the not-implemented features
Some have been implemented now...

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-02-21 00:40:45 +01:00
Christophe de Dinechin
aa99ca1489 angles: Add conversion functions
Add `R→D` and `D→R` as purely numerical functions, compatible with HP-48.

Add `→Deg`, `→Rad`, `→Grad`, `→πr` commands, which

- Convert a number to the target unit using current angle mode
- Convert an angle to the target angle unit

Fixes: #811

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-02-21 00:40:45 +01:00
Christophe de Dinechin
0bd0ee84f3 trig: Use units for angle markers
When the `SetAngleUnits` setting is enabled, `asin`, `acos` and `atan`
will return values with an angle unit that corresponds to the current
angle mode.

The evaluation of such values should be independent from the current
angle mode.

Fixes: #807

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-02-21 00:40:45 +01:00
Christophe de Dinechin
54b228cb7d Release 0.6.5 "Testimony": Small bug fixes
This release does not contain much because FOSDEM took a lot of energy.

New features:

* menu: Connect `ceil` and `floor` functions
* Add real to polar conversions
* units: Add `dms` unit to angles menu

Bug fixes:

* decimal: Compute `ln(0.002)` correctly
* integer: Do not parse degree sign if in a complex
* units: Fix parsing of angle units
* font: Add radian glyph

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-02-12 00:17:09 +01:00
Christophe de Dinechin
2dbbec4ad7 Release 0.6.4 "Healing": Testing and fixes
This release focuses on heavy testing of the new variable-precision
decimal stack. Adding tests also means finding bugs.

Another significant change is support for fixed-precision
hardware-accelerated floating point, using 32-bit and 64-bit IEEE754
binary floating-point representation. Since this uses a binary format,
some decimal values do not map to decimal correctly. For example,
displaying 1.2 with a large number of decimals will show residue,
because 1.2 does not have an exact (zero-terminated) representation in
binary.

New features:

* plotting: Make refresh rate configurable
* menu: Add `/` key to `FractionsMenu`
* hwfp: Add support for hardware-accelerated floating-point
* menus: Add hardware floating-point flag to `MathModesMenu`
* ui: Allow multiple uses of `.` to insert DMS separators
* HMS: Editing of HMS values in HMS format

Bug fixes:

* stats: Fix crash on `variance` with single-column statistics
* algebraic: Clear error before evaluating the function
* functions: Correctly emit a type error for non-algebraics
* ui: Make sure we save stack if closing the editor
* logical: Fix mask for rotate left with 64-bit size
* logical: Make sure we save args for single-argument logicals
* flags: Update flags on `FlipFlag`, consume them from `BinaryToFlags`
* stack: Show multi-line objects correctly
* lists: Returns `Bad argument value` for index with bad arguments
* lists: Return an empty list for tail of empty list
* arithmetic: `→Frac` should not error on integers
* power: Do not shut down during `WAIT` if on USB power

Improvements:

* menu: Shorten the labels `→QIter` and `→QPrec` to avoid scrolling
* stack: Avoid running same code twice on simulator
* ids: Add aliases for hardware floating point
* functions: Optimize abs and neg
* ui: Replace calls to `rt.insert` with calls to `insert`
* menu: Reorganize fractions menu
* dms: Do the DMS conversion using fractions
* list: Adjust multi-line rendering
* copyright: Update copyright to 2024
* text: Return null text when indexing past end of text

Testing:

* tests: Increase the delay for help to draw
* tests: Add tests for hardware-accelerated floating-point
* tests: Add shifts and rotate tests
* tests: Check flag functions
* tests: Test DMS and HMS operations
* tests: Add test for `integrate` using decimal values
* tests: Test multi-line stack display
* tests: Add tests for `GETI`
* tests: Min and max commands
* tests: Repair last regression test
* tests: Check behaviour of 0^0
* tests: Avoid string overflow in case of very long message

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-02-05 01:12:46 +01:00
Christophe de Dinechin
c12d27ac8b hwfp: Add support for hardware-accelerated floating-point
The hardware-accelerated floating-point support in the ARM chip is
about 2000 faster than the variable-precision decimal floating point
implementation. It makes sense to use it.

See numbers recorded in `doc/6-Performance.md` for details.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-02-05 00:24:27 +01:00
Christophe de Dinechin
90c30ccab8 Release 0.6.3 "Come and See": Repair test suite
The focus of this release was to reactivate the test suite and fix the
problems that were found activating it.

[![Recording of a full run of the test suite](https://img.youtube.com/vi/aHW2GcX5S6o/maxresdefault.jpg)](https://www.youtube.com/watch?v=aHW2GcX5S6o&list=PLz1qkflzABy-Cs1R07zGB8A9K5Yjolmlf)

New features:

- HMS and DMS operations
- unit: Rendering of `dms` and `hms` units
- Allow `·` as a multiplication sign in equations
- ui: Display 'E' cursor inside parentheses
- graphics: Accept based integers as position for `DrawText`
- complex: Add setting to switch between `2+3i` and `2+i3`.

Bug fixes:

- decimal: Fix precision loss for addition with carry
- Base: limit range of bases to 2-36
- files: Do not add a trailing zero when reading a text file
- decimal: Adjust `MinimumSignificantDigits` behaviour
- units: Do not auto-simplify `1.0` during conversion
- decimal: Normalize parsed numbers
- solver: Fix sign error in epsilon exponent for solve/integrate
- parser: Accept `x!` as input
- simulator: Avoid faulty break-through in switch statement
- complex: Make tag higher-priority than complex
- editor: Adjust cursor and select correctly during replace
- decimal: Fix display of 0.2 in NoTrailingDecimal mode
- complex: Save `this` in a GC pointer when it can move
- arithmetic: Do not fail because of surrounding error
- decimal: Clamp int32 conversions from decimal
- commands: Parse `exp10` correctly in expressions
- decimal: Avoid infinite loop computing `expm1`
- ids: Do not allow parsing of structures
- dmcp: Make sure the tests don't block on `wait_for_key`
- decimal: Use correct angle unit for negative gamma values

Improvements:

- settings: Add classes that save/restore a given setting
- Add `XSHIFT` to shift to XSHIFT state directly
- Add NOSHIFT constant to simplify test writing
- ui: Add a variant of `close_editor` without trailing zero
- decimal: Cache gamma_ck values (accelerate gamma and lgamma)
- Replace magic constant `-1` with `EXIT_PGM`
- doc: Record performance data for 1000 iterations of SumTest
- decimal: Add tracing for gamma / lgamma function

New tests:

- Add tests for arithmetic truncation on short bitsizes
- Add tests for on-line help
- Add test for plotting flags
- Add test for Unicode to text conversions
- Add test for rectangular complex display options
- Add tests for plot scaling functions
- Add tests for the sorting functions
- Add test for parsing text with quotes inside
- Add test for file-based `STO` and `RCL`
- Add test for 2^256 computation (buf #460)
- Fix indentation of `[PASS]` or `[FAIL]` for UTF8 characters
- Add tests for units and conversions
- Add a keyboard test checking the single-colon insert in text
- Add test for i*i=-1 auto-simplification
- Add basic test for numerical integration
- Add test for fraction formats
- Add solver test
- Add missing tests
- Add test for immediate `STO` (#390)
- Add tests for the `Cycle` command
- Add test for catalog feature
- Add test for "smart" keyboard shortcuts introduced in 0.4.6
- Add regression test for #371
- Add tests for editor operations
- Test stack operations
- Add test for `GXor`, `GOr` and `GAnd`
- Add test for `ResetModes`
- Add plotting test for every decimal function
- Add image checking for graphical tests
- Add tests for graphic and text drawing commands
- Make it possible to individually run tests.
- Add plotting tests
- Add test parsing the various spellings for commands

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-01-22 00:18:41 +01:00
Christophe de Dinechin
e0aa88521f graphics: Accept based integers as position for DrawText
Allow `"Hello" #120d DrawText` to draw something in the middle of the
screen.

Fixes: #730

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-01-18 22:52:33 +01:00
Christophe de Dinechin
887f4173b4 doc: Record performance data for 1000 iterations of SumTest
We need to start recording the performance data of the decimal code on
a release-to-release basis. Definitely much slower than before, hence
the need to be realistic and reduce the number of iterations.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-01-18 22:48:16 +01:00
Christophe de Dinechin
f031fc4027 commands: Add ClearStack command
Add the `ClearStack` (`CLEAR`) commands to clear the whole stack.
Also update the stack menu.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-01-14 23:35:45 +01:00
Christophe de Dinechin
134e6239d1 doc: Document flash storage
Document `STO` and `RCL` and how they can be ued to access flash
storage.

Fixes: #691

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-01-14 23:35:45 +01:00
Christophe de Dinechin
ea66209272 Release 0.6.1 "Happy New Year": Quick bug fixes
A few quick bug fixes that make DB48X a bit more usable.

**New features**

* Setting to display `2+i3` instead of `2+3i` (#660)
* HMS and DMS operations (#654)
* Special `1_dms` and `1_hms` units rendering in DMS / HMS (#650)

**Bug fixes**

* Improve behavior of `+/-` key while editing (#658)
* Do not accept base 37 (#656)
* Insert `for` statement in program instead of executing it (#655)
* Hide trailing decimal separator for decimals with integer values (#653)
* Fix display of `19.8` with `0 FIX` (#652)
* Implement true decimal to integer conversion (#648)

**Improvements**

* doc: Record performance data for 0.6.0
* doc: Update status file

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-01-14 23:35:45 +01:00
Christophe de Dinechin
4a5c4f4aca doc: Record performance information for 0.6.0
Record the (bad) performance data for the variable-precision
decimal number representation.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-01-14 23:35:37 +01:00
Christophe de Dinechin
30775d0e71 Release 0.6.0 "Christmas": Introducing variable precision
This release was a bit longer in coming than earlier ones, because we are about
to reach the limits of what can fit on a DM42. This release uses 711228 bytes
out of the 716800 (99.2%).

Without the Intel Decimal Library code, we use only 282980 bytes. This means
that the Intel Decimal Library code uses 60.2% of the total code space. Being
able to move further requires a rather radical rethinking of the project, where
we replace the Intel Decimal Library with size-optimized decimal code.

As a result, release 0.6.0 introduces a new table-free and variable-precision
implementation of decimal computations. In this release, most operations are
implemented, but some features are still missing (e.g. Gamma function). This
release will be simultaneous with 0.5.2, which is functionally equivalent but
still uses the Intel Decimal library. The new implementation is much more
compact, allowing us to return to normal optimizations for the DM42 and regain
some of the lost performance. On the other hand, having to switch to a table
free implementation means that it's significantly slower than the Intel Decimal
Library. The upside of course is that you can compute with decimal numbers that
have up to 9999 digits, and a decimal exponent that can be up to 2^60
(1 152 921 504 606 846 976).

**New features**

Variable precision decimal floating point implementation for arithmetic,
trigonometrics, logs, exponential and integer factorial. Other functions may
still return "unimplemented error".

**Bug fixes**

None. If anything, this release introduces bugs in computations and performance
regressions. However, it frees *a lot* of space for further DM42 development.

**Improvements**

The `Precision` setting now sets the number of digits with a granularity of one,
between 3 and 9999. Ideal use of memory is with multiples of 12 digits, e.g. 12,
24 or 36 digits, where decimal packing does not cause lost bits.

Performance on the DM42 is somewhat improved, since it is now possible to return
to a higher level of optimization.

**Regressions**

In addition to lower performance and unimplemented functions, this version no
longer builds a compatible QSPI. This means that returning to the DM42 requires
flashing *both* the QSPI and the PGM file.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-25 20:09:59 +01:00
Christophe de Dinechin
8745eb0414 docs: Record performance comparing variable-precision with BID128
As expected, variable precision incurs a performance cost, but it is
quite reasonable.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-25 19:35:23 +01:00
Christophe de Dinechin
6f2158107e decimal: Remove all the BID128 stubs and related decimal types
Remove all the bid128 interfaces to make room for the decimal stuff.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-25 19:33:06 +01:00
Christophe de Dinechin
6c94f3d700 Release 0.5.2 "Christmas Eve": Reaching hard limits on DM42
This release was a bit longer in coming than earlier ones, because we are about
to reach the limits of what can fit on a DM42. This release uses 711228 bytes
out of the 716800 (99.2%).

Without the Intel Decimal Library code, we use only 282980 bytes. This means
that the Intel Decimal Library code uses 60.2% of the total code space. Being
able to move further requires a rather radical rethinking of the project, where
we replace the Intel Decimal Library with size-optimized decimal code.

As a result, release 0.5.2 will be the last one using the Intel Decimal Library,
and is release in parallel with 0.6.0, which switches to a table-free and
variable-precisions implementation of decimal code that uses much less code
space. The two releases should otherwise be functionally identical

**New features**

* Shift and rotate instructions (#622)
* Add `CompatibleTypes` and `DetsailedTypes` setting to control `Type` results
* Recognize HP-compatible negative values for flags, e.g. `-64 SF` (#625)
* Add settings to control multiline result and stack display (#634)

**Bug fixes**

* Truncate to `WordSize` the small results of binary operations (#624)
* Fix day-of-week shortcut in simulator
* Avoid double-evaluation of immediate commands when there is no help
* Generate an error when selecting base 1 (#628)
* Avoid `Number too big` error on based nunbers
* Correctly garbage-collect menu entries (#630)
* Select default settings that allow solver to find solutions (#627)
* Fix display of decimal numbers (broken by multi-line display)
* Fix rendering of menu entries for `Fix`, `Std`, etc
* Detect non-finite results in arithmetic, e.g. `(-8)^0.3`m (#635, #639)
* Fix range-checking for `Dig` to allow `-1` value
* Accept large values for `Fix`, `Sci` and `Eng` (for variable precision)
* Restore missing last entry in built-in units menu (#638)
* Accept `Hz` and non-primary units as input for `ConvertToUnitPrefix` (#640)
* Fix LEB128 encoding for signed value 64 and similar (#642)
* Do not parse `IfThenElse` as a command
* Do not consider `E` as a digit in decimal numbers (#643)
* Do not parse `min` as a function in units, but as minute (#644)

**Improvements**

* Add `OnesComplement` flag for binary operation (not used yet)
* Add `ComplexResults` (-103) flag (not used yet)
* Accept negative values for `B→R` (according to `WordSize`)
* Add documentation for `STO` and `RCL` accessing flash storage
* Mention `True` and `False` in documentation
* Rename `MaxBigNumBits` to `MaxNumberBits`
* Return HP-compatible values from `Type` function
* Minor optimization of flags implementation
* Catalog auto-completion now suggests all possible spellings (#626)
* Add aliases for `CubeRoot` and `Hypothenuse`
* Align based number promotion rules to HP calculators (#629)
* Expand the range of garbage collector integrity check on simulator
* Show command according to preferences in error messages (#633)
* Avoid crash in `debug_printf` if used before font initialization
* Update performance data in documentation
* Add ability to disable any reference to Intel Decimal Floating-point library
* Simplify C++ notations for safe pointers (`+x` and `operartor bool()`)
* Fix link to old `db48x` project in `README.md`

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-25 19:14:26 +01:00
Christophe de Dinechin
0b4897211c settings: Add settings controlling stack multiline display
Add `MultiLineResult` / `SingleLineResult` setting for results.
Add `MultiLineStack` / `SingleLineStack` setting for rest of stack.

Fixes: #634

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-03 20:49:16 +01:00
Christophe de Dinechin
0c11203c20 docs: Update performance information for 0.5.0 and 0.5.1
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-02 17:18:23 +01:00
Christophe de Dinechin
3eae468edd catalog: Auto-complete all possible spellings
Allow the catalog to auto-complete all possible command spellings.
As a side effect, accelerate the parsing of commands.

All spellings are now stored in a static array, `object::spellings`.
This makes it possible to scan the table in both directions, i.e.
from `id` to text for name rendering, or from name to `id` for
parsing. This makes it also simpler to run operations that loop on all
spellings, including building the catalog entries.

Fixes: #626

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-01 16:50:23 +01:00
Christophe de Dinechin
b3178ca77f commands: Return HP-compatible values from Type
The `Type` command is used in many programs. It is useful to have it
return HP-compatible values, even if the mapping is not entirely
accurate.

This is under control of the `DetailedTypes` / `CompatibleTypes`
settings. When in `CompatibleTypes` mode, an attempt is made to return
a compatible value, which lacks details. When in `DetailedTypes` mode,
the value returned is negative (to distinguish it from HP values) and
is gives precise information about the actual internal representation.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-01 16:50:23 +01:00
Christophe de Dinechin
583d1bf5e7 settings: Rename MaxBigNumBits to MaxNumberBits
The idea of "big num" should not make it to the user interface.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-01 16:50:23 +01:00
Christophe de Dinechin
94d4f16ac8 doc: Add mention of boolean values
Since DB48X has dedicated truth values, `True` and `False`, the
documentation should mention them.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-01 16:50:23 +01:00