Added type, default, pow, sqr, test usage

This commit is contained in:
Louis Rubet 2017-04-29 15:39:44 +02:00
parent ea2d25eda3
commit 9732561f35

View file

@ -10,9 +10,6 @@
- The special feature of this language is to make no difference between - The special feature of this language is to make no difference between
keywords and functions, even user functions. keywords and functions, even user functions.
- Numbers (ie scalars) are in 128-bit quadruple precision format (long
double). Binaries are 64-bits longwords format (long long int).
- A GNU-readline-based interactive editor with autocompletion is provided. - A GNU-readline-based interactive editor with autocompletion is provided.
- Language extensions will soon be included: - Language extensions will soon be included:
@ -21,6 +18,13 @@ double). Binaries are 64-bits longwords format (long long int).
- shell-calling objects with return code, stdout and stderr treatment, - shell-calling objects with return code, stdout and stderr treatment,
- loading and saving stack, variables, programs from / to filesystem - loading and saving stack, variables, programs from / to filesystem
Multiple-precision floating-point computations with correct rounding are ensured by __MPFR library__ under GNU LGPL v3 or later
Integer calculations are ensured by __GNU MP library__ (__GMP__) under GNU LGPL v3 and GNU GPL v2
## Implemented commands ## Implemented commands
This commands list match HP28s reserved words. Commands marked as 'new' do not exist in HP28s. This commands list match HP28s reserved words. Commands marked as 'new' do not exist in HP28s.
@ -30,7 +34,6 @@ This commands list match HP28s reserved words. Commands marked as 'new' do not e
| GENERAL | nop |yes| yes| yes| | GENERAL | nop |yes| yes| yes|
| GENERAL | help/h/? | yes | yes| | | GENERAL | help/h/? | yes | yes| |
| GENERAL | quit/exit/q| yes| yes| | | GENERAL | quit/exit/q| yes| yes| |
| GENERAL | test | yes | yes| |
| GENERAL | verbose | yes | yes| | | GENERAL | verbose | yes | yes| |
| GENERAL | std | | yes| | | GENERAL | std | | yes| |
| GENERAL | fix | | yes| | | GENERAL | fix | | yes| |
@ -38,6 +41,9 @@ This commands list match HP28s reserved words. Commands marked as 'new' do not e
| GENERAL | version | yes | yes| | | GENERAL | version | yes | yes| |
| GENERAL | uname | yes | yes| | | GENERAL | uname | yes | yes| |
| GENERAL | edit | | yes| | | GENERAL | edit | | yes| |
| GENERAL | type | yes | yes| yes |
| GENERAL | default | yes | yes| yes |
| TEST | test | yes | yes| yes |
| REAL | + | | yes| | | REAL | + | | yes| |
| REAL | - | | yes| | | REAL | - | | yes| |
| REAL | neg | | yes| | | REAL | neg | | yes| |
@ -47,8 +53,10 @@ This commands list match HP28s reserved words. Commands marked as 'new' do not e
| REAL | % | | yes| | | REAL | % | | yes| |
| REAL | %CH | | yes| | | REAL | %CH | | yes| |
| REAL | ^ | | yes| | | REAL | ^ | | yes| |
| REAL | pow (_alias for_ ^) | | yes| yes |
| REAL | sqrt | yes | yes| | | REAL | sqrt | yes | yes| |
| REAL | sq | yes | yes| | | REAL | sq | yes | yes| |
| REAL | sqr (_alias for_ sq) | yes | yes| yes |
| REAL | mod |yes| yes| | | REAL | mod |yes| yes| |
| STACK | drop | | yes| | | STACK | drop | | yes| |
| STACK | swap | | yes| | | STACK | swap | | yes| |
@ -202,7 +210,7 @@ This commands list match HP28s reserved words. Commands marked as 'new' do not e
| LOGS | tanh | | yes | | | LOGS | tanh | | yes | |
| LOGS | atanh | | yes | | | | LOGS | atanh | | yes | | |
## HP28s commands which won't be implemented ## HP28s commands which are not (or won't be) implemented
**MEMORY** **MEMORY**
mem, menu, order, path, home, crdir, clusr, mem, menu, order, path, home, crdir, clusr,
@ -237,6 +245,39 @@ This commands list match HP28s reserved words. Commands marked as 'new' do not e
**CUSTOM** **CUSTOM**
menu, custom menu, custom
## Tests
Unit tests are given as txt files in the test subdirectory.
Use the command 'test' to run a test file, eg
```
# cd test_directory/
# rpn
rpn> "entry.txt"
rpn> test
## ENTRY TEST
# real decimal PASSED
# real hex PASSED
# real binary PASSED
(...)
```
or
```
# cd test_directory/
# rpn \"entry.txt\" test
## ENTRY TEST
# real decimal PASSED
# real hex PASSED
# real binary PASSED
(...)
```
The test output is done on stdout and is not stacked in rpn.
| __test sheet__ | __description__ |
| - | - |
| entry.txt | testing real, binary, symbol, string and program entries |
## Notes ## Notes
Compiled with g++ Makefile generated by automake. Compiled with g++ Makefile generated by automake.
External dependencies needed: automake, readline (libreadline-dev) External dependencies needed: automake, readline (libreadline-dev), MPFR library, GNU MP library