rpn/test/10-complex.txt

701 lines
8.7 KiB
Text
Raw Normal View History

2017-06-15 22:30:47 +02:00
## COMPLEX
default erase
# entry (1)
(1,2) ( 1,2) (1 ,2) (1, 2) (1,2 )
-> stack should be (1,2), (1,2), (1,2), (1,2), (1,2)
erase
# entry (2)
(1.3,2.444555
-> stack should be (1.3,2.444555)
erase
# entry (3)
(1,
-> stack should be (1,0)
erase
# entry (4)
(nan,+inf)
-> stack should be (nan,inf)
erase
# entry (5)
(0x1234,0x10.10)
-> stack should be (0x1.234p+12,0x1.01p+4)
erase
2017-06-15 22:30:47 +02:00
# entry (6)
(0b11,0b101)
-> stack should be (3,5)
erase
# add (1)
(1.2,2.3) (1,2) +
-> stack should be (2.2,4.3)
erase
2017-06-15 22:30:47 +02:00
# add (2)
(1.2,2.3) (1,2)+
-> stack should be (2.2,4.3)
erase
2017-06-15 22:30:47 +02:00
# add (3)
(1.2,2.3) 3+
-> stack should be (4.2,2.3)
erase
2017-06-15 22:30:47 +02:00
# add (4)
3 (1.2,2.3)+
-> stack should be (4.2,2.3)
erase
2017-06-15 22:30:47 +02:00
# sub (1)
(1.2,2.3) (2,2) -
-> stack should be (-0.8,0.3)
erase
2017-06-15 22:30:47 +02:00
# sub (2)
(1.2,2.3) (1,2)-
-> stack should be (0.2,0.3)
erase
2017-06-15 22:30:47 +02:00
# sub (3)
(1.2,2.3) 1-
-> stack should be (0.2,2.3)
erase
2017-06-15 22:30:47 +02:00
# sub (4)
1 (1.2,2.3) -
-> stack should be (-0.2,2.3)
erase
2017-06-15 22:30:47 +02:00
# mul (1)
(1,2) (3,4) *
-> stack should be (-5,10)
erase
2017-06-15 22:30:47 +02:00
# mul (2)
(3,4) (1,2) *
-> stack should be (-5,10)
erase
2017-06-15 22:30:47 +02:00
# mul (3)
(3,4) 2 *
-> stack should be (6,8)
erase
2017-06-15 22:30:47 +02:00
# mul (3)
2 (3,4) *
-> stack should be (6,8)
erase
2017-06-15 22:30:47 +02:00
# div (1)
(1,2) (3,4) /
-> stack should be (0.44,0.08)
erase
2017-06-15 22:30:47 +02:00
# div (2)
(1,2) 2 /
-> stack should be (0.5,1)
erase
2017-06-15 22:30:47 +02:00
# div (3)
2 (3,4) /
-> stack should be (0.24,-0.32)
erase
2017-06-15 23:30:20 +02:00
# re (1)
(1.2,3.4) re
-> stack should be 1.2
erase
2017-06-15 23:30:20 +02:00
# re (2)
3 re
-> error should be 3
erase
2017-06-15 23:30:20 +02:00
# re (3)
re
-> error should be 2
erase
2017-06-16 09:32:47 +02:00
2017-06-16 10:55:37 +02:00
# im (1)
(1.2,3.4) im
-> stack should be 3.4
erase
2017-06-16 10:55:37 +02:00
# im (2)
3 re
-> error should be 3
erase
2017-06-16 10:55:37 +02:00
# im (3)
re
-> error should be 2
erase
2017-06-16 10:55:37 +02:00
2017-06-16 09:32:47 +02:00
# chs
(3.14,6.28) chs
-> stack should be (-3.14,-6.28)
erase
2017-06-16 09:32:47 +02:00
# neg
(-3.14,-6.28) neg
-> stack should be (3.14,6.28)
erase
2017-06-16 09:32:47 +02:00
# inv (1)
(2,4) inv
-> stack should be (0.1,-0.2)
erase
2017-06-16 09:32:47 +02:00
# inv (2)
(0.1,-0.2) inv
-> stack should be (2,4)
erase
2017-06-16 10:34:29 +02:00
# abs
(3,4) abs
-> stack should be 5
erase
2017-06-16 10:49:12 +02:00
# sign (1)
(1,0) sign
-> stack should be (1,0)
erase
2017-06-16 10:49:12 +02:00
# sign (2)
(0,1) sign
-> stack should be (0,1)
erase
2017-06-16 10:49:12 +02:00
# sign (3)
(3,-4) sign
-> stack should be (0.6,-0.8)
erase
2017-06-16 11:01:55 +02:00
# sq (1)
(12,10) sq
-> stack should be (44,240)
erase
2017-06-16 11:01:55 +02:00
# sqr (1)
(12,10) sq
-> stack should be (44,240)
erase
2017-06-16 11:56:33 +02:00
# arg (1)
(1,1) arg pi 4 / ==
-> stack should be 1
erase
2017-06-16 11:56:33 +02:00
# arg (2)
1000 prec
2017-06-16 11:56:33 +02:00
(-1,1) arg pi 3 * 4 / ==
-> stack should be 1
default
erase
2017-06-16 11:56:33 +02:00
# arg (3)
1000 prec
(1,-1) arg pi chs 4 / ==
2017-06-16 11:56:33 +02:00
-> stack should be 1
default
erase
2017-06-16 11:56:33 +02:00
# arg (4)
1000 prec
2017-06-16 11:56:33 +02:00
(-1,-1) arg pi -3 * 4 / ==
-> stack should be 1
default
erase
2017-06-16 11:56:33 +02:00
# arg (5)
1000 prec
2017-06-16 11:56:33 +02:00
(1,0) arg 0 ==
-> stack should be 1
default
erase
2017-06-16 11:56:33 +02:00
# arg (6)
1000 prec
2017-06-16 11:56:33 +02:00
(0,1) arg pi 2 / ==
-> stack should be 1
default
erase
2017-06-16 11:56:33 +02:00
# arg (7)
1000 prec
2017-06-16 11:56:33 +02:00
(-1,0) arg pi ==
-> stack should be 1
default
erase
2017-06-16 11:56:33 +02:00
# arg (8)
1000 prec
2017-06-16 11:56:33 +02:00
(0,-1) arg pi neg 2 / ==
-> stack should be 1
default
erase
2017-06-16 12:00:59 +02:00
# conj
(1,2) conj dup conj
-> stack should be (1,-2), (1,2)
2017-06-16 19:13:57 +02:00
erase
# r->c (1)
1 2 r->c
-> stack should be (1,2)
erase
# r->c (2)
1 r->c
-> error should be 2
erase
2017-06-16 19:13:57 +02:00
# r->c (3)
r->c
-> error should be 2
erase
2017-06-16 19:13:57 +02:00
2017-06-16 21:54:28 +02:00
# r->c (3)
'1' '2' r->c
-> error should be 3
erase
2017-06-16 19:13:57 +02:00
# c->r (1)
(1,2) c->r
-> stack should be 1, 2
2017-06-16 21:54:28 +02:00
erase
2017-06-16 19:13:57 +02:00
# c->r (2)
c->r
2017-06-16 21:54:28 +02:00
-> error should be 2
erase
# c->r (3)
'4' c->r
-> error should be 3
erase
# r->p (1)
6 fix
2017-06-16 21:54:28 +02:00
(1,2) r->p
-> stack should be (2.236068,1.107149)
2017-06-16 21:54:28 +02:00
erase
# r->p (2)
19 fix
2017-06-16 21:54:28 +02:00
1 r->p
-> error should be 3.000000
erase
2017-06-16 21:54:28 +02:00
# r->p (3)
r->p
-> error should be 2
2017-06-16 21:54:28 +02:00
erase
# r->p (4)
'1' '2' r->p
2017-06-16 19:13:57 +02:00
-> error should be 3
2017-06-16 23:26:36 +02:00
erase
# ^ (1)
6 fix
2017-06-16 23:26:36 +02:00
(1,2) 2 ^
-> stack should be (-3.000000,4.000000)
2017-06-16 23:26:36 +02:00
erase
# ^ (2)
(1,2) 4 ^
-> stack should be (-7.000000,-24.000000)
2017-06-16 23:26:36 +02:00
erase
# sqrt
(3,4) sqrt
-> stack should be (2.000000,1.000000)
2017-06-16 23:26:36 +02:00
erase
2017-06-20 21:55:32 +02:00
# sin (1)
(1,2) sin
-> stack should be (3.165779,1.959601)
2017-06-20 21:55:32 +02:00
erase
# sin (2)
(1,-2) sin
-> stack should be (3.165779,-1.959601)
2017-06-20 21:55:32 +02:00
erase
# sin (3)
(-1,-2) sin
-> stack should be (-3.165779,-1.959601)
2017-06-20 21:55:32 +02:00
erase
# sin (4)
(-1,2) sin
-> stack should be (-3.165779,1.959601)
2017-06-20 21:55:32 +02:00
erase
2017-06-21 23:00:41 +02:00
# asin (1)
(1,2) asin
-> stack should be (0.427079,1.528571)
2017-06-21 23:00:41 +02:00
erase
# asin (2)
(1,-2) asin
-> stack should be (0.427079,-1.528571)
2017-06-21 23:00:41 +02:00
erase
# asin (3)
(-1,-2) asin
-> stack should be (-0.427079,-1.528571)
2017-06-21 23:00:41 +02:00
erase
# asin (4)
(-1,2) asin
-> stack should be (-0.427079,1.528571)
2017-06-21 23:00:41 +02:00
erase
2017-06-20 21:55:32 +02:00
# cos (1)
(1,2) cos
-> stack should be (2.032723,-3.051898)
2017-06-20 21:55:32 +02:00
erase
# cos (2)
(1,-2) cos
-> stack should be (2.032723,3.051898)
2017-06-20 21:55:32 +02:00
erase
# cos (3)
(-1,-2) cos
-> stack should be (2.032723,-3.051898)
2017-06-20 21:55:32 +02:00
erase
# cos (4)
(-1,2) sin
-> stack should be (-3.165779,1.959601)
2017-06-20 21:55:32 +02:00
erase
2017-06-21 23:00:41 +02:00
# acos (1)
(1,2) acos
-> stack should be (1.143718,-1.528571)
2017-06-21 23:00:41 +02:00
erase
# acos (2)
(1,-2) acos
-> stack should be (1.143718,1.528571)
2017-06-21 23:00:41 +02:00
erase
# acos (3)
(-1,-2) acos
-> stack should be (1.997875,1.528571)
2017-06-21 23:00:41 +02:00
erase
# acos (4)
(-1,2) acos
-> stack should be (1.997875,-1.528571)
2017-06-21 23:00:41 +02:00
erase
2017-06-20 21:55:32 +02:00
# tan (1)
(1,2) tan
-> stack should be (0.033813,1.014794)
2017-06-20 21:55:32 +02:00
erase
# tan (2)
(1,-2) tan
-> stack should be (0.033813,-1.014794)
2017-06-20 21:55:32 +02:00
erase
# tan (3)
(-1,-2) tan
-> stack should be (-0.033813,-1.014794)
2017-06-20 21:55:32 +02:00
erase
# tan (4)
(-1,2) tan
-> stack should be (-0.033813,1.014794)
2017-06-20 21:55:32 +02:00
erase
2017-06-20 22:37:34 +02:00
2017-06-21 23:00:41 +02:00
# atan (1)
(1,2) atan
-> stack should be (1.338973,0.402359)
2017-06-21 23:00:41 +02:00
erase
# atan (2)
(1,-2) atan
-> stack should be (1.338973,-0.402359)
2017-06-21 23:00:41 +02:00
erase
# atan (3)
(-1,-2) atan
-> stack should be (-1.338973,-0.402359)
2017-06-21 23:00:41 +02:00
erase
# atan (4)
(-1,2) atan
-> stack should be (-1.338973,0.402359)
2017-06-21 23:00:41 +02:00
erase
2017-06-20 22:37:34 +02:00
# ln (1)
(1,2) ln
-> stack should be (0.804719,1.107149)
2017-06-20 22:37:34 +02:00
erase
# ln (2)
(1,-2) ln
-> stack should be (0.804719,-1.107149)
2017-06-20 22:37:34 +02:00
erase
# ln (3)
(-1,-2) ln
-> stack should be (0.804719,-2.034444)
2017-06-20 22:37:34 +02:00
erase
# ln (4)
(-1,2) ln
-> stack should be (0.804719,2.034444)
2017-06-20 22:37:34 +02:00
erase
2017-06-20 23:00:54 +02:00
# log (1)
(1,2) log
-> stack should be (0.804719,1.107149)
2017-06-20 23:00:54 +02:00
erase
# log (2)
(1,-2) log
-> stack should be (0.804719,-1.107149)
2017-06-20 23:00:54 +02:00
erase
# log (3)
(-1,-2) log
-> stack should be (0.804719,-2.034444)
2017-06-20 23:00:54 +02:00
erase
# log (4)
(-1,2) log
-> stack should be (0.804719,2.034444)
2017-06-20 23:00:54 +02:00
erase
2017-06-20 22:37:34 +02:00
# log10 (1)
(1,2) log10
-> stack should be (0.349485,0.480829)
2017-06-20 22:37:34 +02:00
erase
# log10 (2)
(1,-2) log10
-> stack should be (0.349485,-0.480829)
2017-06-20 22:37:34 +02:00
erase
# log10 (3)
(-1,-2) log10
-> stack should be (0.349485,-0.883548)
2017-06-20 22:37:34 +02:00
erase
# log10 (4)
(-1,2) log10
-> stack should be (0.349485,0.883548)
2017-06-20 22:37:34 +02:00
erase
# log2 (1)
(1,2) log2
-> stack should be (1.160964,1.597278)
2017-06-20 22:37:34 +02:00
erase
# log2 (2)
(1,-2) log2
-> stack should be (1.160964,-1.597278)
2017-06-20 22:37:34 +02:00
erase
# log2 (3)
(-1,-2) log2
-> stack should be (1.160964,-2.935082)
2017-06-20 22:37:34 +02:00
erase
# log2 (4)
(-1,2) log2
-> stack should be (1.160964,2.935082)
2017-06-20 22:37:34 +02:00
erase
2017-06-20 22:51:09 +02:00
# exp (1)
(1,2) exp
-> stack should be (-1.131204,2.471727)
2017-06-20 22:51:09 +02:00
erase
# exp (2)
(1,-2) exp
-> stack should be (-1.131204,-2.471727)
2017-06-20 22:51:09 +02:00
erase
# exp (3)
(-1,-2) exp
-> stack should be (-0.153092,-0.334512)
2017-06-20 22:51:09 +02:00
erase
# exp (4)
(-1,2) exp
-> stack should be (-0.153092,0.334512)
2017-06-20 22:51:09 +02:00
erase
# alog2 (1)
(1,2) alog2
-> stack should be (0.366914,1.966055)
2017-06-20 22:51:09 +02:00
erase
# alog2 (2)
(1,-2) alog2
-> stack should be (0.366914,-1.966055)
2017-06-20 22:51:09 +02:00
erase
# alog2 (3)
(-1,-2) alog2
-> stack should be (0.091728,-0.491514)
2017-06-20 22:51:09 +02:00
erase
# alog2 (4)
(-1,2) alog2
-> stack should be (0.091728,0.491514)
2017-06-20 22:51:09 +02:00
erase
# alog10 (1)
(1,2) alog10
-> stack should be (-1.070135,-9.942576)
2017-06-20 22:51:09 +02:00
erase
# alog10 (2)
(1,-2) alog10
-> stack should be (-1.070135,9.942576)
2017-06-20 22:51:09 +02:00
erase
# alog10 (3)
(-1,-2) alog10
-> stack should be (-0.010701,0.099426)
2017-06-20 22:51:09 +02:00
erase
# alog10 (4)
(-1,2) alog10
-> stack should be (-0.010701,-0.099426)
2017-06-20 22:51:09 +02:00
erase
# sinh (1)
(1,2) sinh
-> stack should be (-0.489056,1.403119)
erase
# sinh (2)
(1,-2) sinh
-> stack should be (-0.489056,-1.403119)
erase
# sinh (3)
(-1,-2) sinh
-> stack should be (0.489056,-1.403119)
erase
# sinh (4)
(-1,2) sinh
-> stack should be (0.489056,1.403119)
erase
# asinh (1)
(1,2) asinh
-> stack should be (1.469352,1.063440)
erase
# asinh (2)
(1,-2) asinh
-> stack should be (1.469352,-1.063440)
erase
# asinh (3)
(-1,-2) asinh
-> stack should be (-1.469352,-1.063440)
erase
# asinh (4)
(-1,2) asinh
-> stack should be (-1.469352,1.063440)
erase
# cosh (1)
(1,2) cosh
-> stack should be (-0.489056,1.403119)
erase
# cosh (2)
(1,-2) cosh
-> stack should be (-0.489056,-1.403119)
erase
# cosh (3)
(-1,-2) cosh
-> stack should be (0.489056,-1.403119)
erase
# cosh (4)
(-1,2) cosh
-> stack should be (0.489056,1.403119)
erase
# acosh (1)
(1,2) acosh
-> stack should be (1.528571,1.143718)
erase
# acosh (2)
(1,-2) acosh
-> stack should be (1.528571,-1.143718)
erase
# acosh (3)
(-1,-2) acosh
-> stack should be (-1.528571,1.997875)
erase
# acosh (4)
(-1,2) acosh
-> stack should be (-1.528571,-1.997875)
erase
# tanh (1)
(1,2) tanh
-> stack should be (0.564133,-0.217934)
erase
# tanh (2)
(1,-2) tanh
-> stack should be (0.564133,0.217934)
erase
# tanh (3)
(-1,-2) tanh
-> stack should be (-0.564133,0.217934)
erase
# tanh (4)
(-1,2) tanh
-> stack should be (-0.564133,-0.217934)
erase
# atanh (1)
(1,2) atanh
-> stack should be (0.173287,1.178097)
erase
# atanh (2)
(1,-2) atanh
-> stack should be (0.173287,-1.178097)
erase
# atanh (3)
(-1,-2) atanh
-> stack should be (-0.173287,-1.178097)
erase
# atanh (4)
(-1,2) atanh
-> stack should be (-0.173287,1.178097)
erase