#################################################### # Arithmetic functions 1+1 2 1+1+1+1+1+1+1+1 8 1+(1+(1+(1))) 4 1-1 0 1-1-1 -1 1-(1-1) 1 0*1 0 1*2 2 2*1 2 4/2 2 1/2-0.5 0 1 % 2 1 0 % 3 0 3 % 2 1 #################################################### # Proper handling of functions and constants sin(pi) 0 pi*sin(0) 0 cos(pi) -1 sum(1,2) 3 # The following expression does not evaluate correctly in JEP 2.20 and 2.21 1+sum(1) 2 #################################################### # 'Correct' precedence of unary - and ^ -1^2 -1 (-1)^2 1 #################################################### # Trig functions sin(0) 0 sin(pi/2) 1 sin(pi) 0 sin(3*pi/2) -1 sin(pi/6) 0.5 sin(pi/3) 3^(0.5)/2 cos(0) 1 cos(pi/2) 0 cos(pi) -1 cos(3*pi/2) 0 cos(pi/6) 3^(0.5)/2 cos(pi/3) 0.5 tan(0) 0 tan(pi) 0 #################################################### # Complex functions i^2 -1 i^2 i*i i-i 0 i+i 2*i (i+2)/2 i/2+1 (1+3*i)*2 (2+6*i) (1+1*i)*(2+2*i) (0+4*i) #################################################### # Large expressions (TODO: add more) 1+1*2-(1+1*2)+1+1*2-(1+1*2)+1+1*2-(1+1*2)+1+1*2-(1+1*2)+1+1*2-(1+1*2) 0 #################################################### # Expressions with implicit multiplication 1 2 3 6 3sin(0) 0 sin(0)3 0 sin(3 sin(0)) 0 #################################################### # Boolean operators 1==1 1 1==0 0 1!=1 0 1!=0 1 1<0 0 1<2 1 1>0 1 1>2 0 1>=1 1 1>=1.1 0 1<=1 1 1<=0.9 0 1 && 1 1 1 && 0 0 0 && 1 0 0 && 0 0 1 || 0 1 1 || 1 1 0 || 1 1 0 || 0 0 #################################################### # String functions # (need to use == operator in one line and compare # to value because JEPTester does not handle String # results) "ab" == "ab" 1 "a" == "b" 0 "ab" + "c" == "abc" 1 "a" + "b" + "c" + "d" == "abcd" 1 "abcd" + "efg" == "abcdefg" 1 "abcd" + "efg" == "abcd" 0 "abcd" + "efg" == "efg" 0 "A" == "a" 0 "a" + "b" == "ab" 1