####################################################
# Plus
1+1
2

1+1+1+1+1+1+1+1
8

1+(1+(1+(1)))
4

####################################################
# Minus
1-1
0

1-1-1
-1

1-(1-1)
1

####################################################
# Multiplication
0*1
0

1*2
2

2*1
2

####################################################
# Division
4/2
2

1/2-0.5
0

####################################################
# Modulus
1 % 2
1

0 % 3
0

3 % 2
1

####################################################
# Power
1^2
1

2^2
4

1^0
1

2^0
1

1^-1
1

2^-1
0.5

####################################################
# 'Correct' precedence of unary - and ^
-1^2
-1

(-1)^2
1


####################################################
# Pi
sin(pi)
0

pi*sin(0)
0

cos(pi)
-1

cos(pi/2)
0



####################################################
# Sine
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

####################################################
# Cosine
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

####################################################
# Tangent
tan(0)
0

tan(pi)
0


####################################################
# Inverse Sine

asin(0)
0

asin(1)
pi/2

asin(-1)
-pi/2

####################################################
# Inverse Cosine
acos(0)
pi/2

acos(1)
0

acos(-1)
pi

####################################################
# Inverse Tangent
atan(0)
0

atan(1)
pi/4

atan(-1)
-pi/4

atan2(0, 0)
0

atan2(1, 0)
pi/2

atan2(0, 1)
0

atan2(-1, 0)
-pi/2

atan2(0, -1)
pi


####################################################
# Logarithmic functions

ln(1)
0

ln(e)
1

ln(e^32)
32

log(1)
0

log(10)
1

log(100)
2


####################################################
# 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)




####################################################
# Boolean operators

!1
0

!0
1

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

####################################################
# exp function

exp(0)
1

exp(1)
e

exp(2)
e^2


####################################################
# abs function

abs(-1)
1

abs(1)
1

abs(0)
0

abs(i)
1

abs(2*i)
2

abs(i+1)
sqrt(2)

####################################################
# rand function
rand() < 1
1

rand() > 0
1

####################################################
# modulus function

mod(11,10)
1

mod(1,2)
1

mod(1,5)
1

####################################################
# sqrt function
sqrt(1)
1

sqrt(0)
0

sqrt(-1)
i

sqrt(25)
5

####################################################
# Sum
sum(1,2)
3

# The following expression does not evaluate correctly in JEP 2.20 and 2.21
1+sum(1)
2

sum(1)
1

sum(1, 2)
3

# The following expression causes an error in JEP 2.3.0 and is a known bug
sum(1, 2, 3, 4)
10

sum(1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
10

sum(i)
i

sum(i, i)
2*i

sum(1, i)
1+i

sum(i, 1)
1+i

sum("a", "b") == "ab"
1



####################################################
# if function

if(1, 0, 1)
0

if(.001, 0, 1)
0

if(0, 0, 1)
1

if(-0.001, 0, 1)
1

####################################################
# str function

str(1) == "1.0"
1

str("1") == "1"
1

####################################################
# floor function

floor(1)
1

floor(1.1)
1

floor(1.9)
1

####################################################
# ceil function

ceil(1)
1

ceil(1.0000001)
2

ceil(1.9)
2

####################################################
# round function

round(1)
1

round(1.1)
1

round(1.9)
2

round(1.9,2)
1.9

round(1.9, 1)
1.9

round(1.9, 0)
2

round(-1.2)
-1

round(-1.9)
-2

####################################################
# 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
