diff --git a/test/02-mode.txt b/test/02-mode.txt index 27156a5..fdfd446 100644 --- a/test/02-mode.txt +++ b/test/02-mode.txt @@ -35,3 +35,4 @@ drop -> stack should be 1.00e+00 drop +default diff --git a/test/06-real.txt b/test/06-real.txt index 5f106be..e2e3278 100644 --- a/test/06-real.txt +++ b/test/06-real.txt @@ -68,5 +68,238 @@ drop # prec error (2) 0x8000000000000000 prec -> error should be 4 +erase default + +# add (1) +1.2 2.3 + +-> stack should be 3.5 +drop + +# add (2) +1.2 2.3+ +-> stack should be 3.5 +drop + +# add (3) +2.3 + +-> error should be 2 +-> stack size should be 1 +drop + +# add (4) ++ +-> error should be 2 +drop + +# sub (1) +1.2 2.3 - +-> stack should be -1.1 +drop + +# sub (2) +1.2 2.3- +-> stack should be -1.1 +drop + +# sub (3) +2.3 - +-> error should be 2 +-> stack size should be 1 +drop + +# sub (4) +- +-> error should be 2 +drop + +# mul (1) +1.2 2.3 * +-> stack should be 2.76 +drop + +# mul (2) +1.2 2.3* +-> stack should be 2.76 +drop + +# mul (3) +2.3 * +-> error should be 2 +-> stack size should be 1 +drop + +# mul (4) +* +-> error should be 2 +drop + +# div (1) +1.2 2.3 / +-> stack should be 0.5217391304347826087 +drop + +# div (2) +1.2 2.3/ +-> stack should be 0.5217391304347826087 +drop + +# div (3) +2.3 / +-> error should be 2 +-> stack size should be 1 +drop + +# div (4) +/ +-> error should be 2 +drop + +# chs (1) +3.14 chs +-> stack should be -3.14 +drop + +# chs (2) +chs +-> error should be 2 + +# neg (1) +3.14 neg +-> stack should be -3.14 +drop + +# neg (2) +neg +-> error should be 2 + +# inv (1) +2 inv +-> stack should be 0.5 +drop + +# inv (2) +inv +-> error should be 2 + +# % (1) +2 30 % +-> stack should be 0.6 +erase + +# % (2) +2 30% +-> stack should be 0.6 +erase + +# % (3) +2 % +-> error should be 2 +-> stack size should be 1 +drop + +# % (4) +% +-> error should be 2 +drop + +# %CH (1) +2 0.6 %CH +-> stack should be 30 +erase + +# %CH (2) +2 0.6%CH +-> stack should be 30 +erase + +# %CH (3) +2 %CH +-> error should be 2 +-> stack size should be 1 +drop + +# %CH (4) +%CH +-> error should be 2 +drop + +# ^ (1) +2 10 ^ +-> stack should be 1024 +erase + +# ^ (2) +2 10^ +-> stack should be 1024 +erase + +# ^ (3) +2 ^ +-> error should be 2 +-> stack size should be 1 +erase + +# ^ (4) +^ +-> error should be 2 +erase + +# sqrt (1) +9 sqrt +-> stack should be 3 +drop + +# sqrt (2) +sqrt +-> error should be 2 + +# sq (1) +12 sq +-> stack should be 144 +drop + +# sq (2) +sq +-> error should be 2 + +# sqr (1) +12 sqr +-> stack should be 144 +drop + +# sqr (2) +sqr +-> error should be 2 + +# mod (1) +9 4 mod +-> stack should be 1 +erase + +# mod (2) +9 mod +-> error should be 2 +-> stack size should be 1 +erase + +# mod (3) +mod +-> error should be 2 +erase + +# abs (1) +-9 abs +-> stack should be 9 +erase + +# abs (2) +9 abs +-> stack should be 9 +erase + +# abs (3) +abs +-> error should be 2 +erase default