4 operator details, Operator details -5 – ElmoMC SimplIQ Software Manual User Manual
Page 23
SimplIQ
Software Manual
The Interpreter Language
MAN-SIMSW (Ver. 1.4)
4-5
4.2.4
Operator Details
The following table describes the operators in detail.
Operator /
Description
Nota-
tion
No. of
Arguments
Output
Type
Examples
Arithmetic
addition
+
2 See
section
4+5=9
3.45+2.78=6.23
Arithmetic
subtraction
-
2 See
section
4-5=-1
3.45=2.78=0.67
Arithmetic
multiplication
*
2 See
section
PA=PA*2
doubles PA
5*4=20
1.5*2=3.0
Arithmetic
division
/
2 See
section
20/4=5
3/1.5=2.0
Remainder
after division of
two integers
%
2 32-bit
long
integer
20%4=0
5%2=1
Bitwise NOT
~
1 32-bit
long
integer
~3
is 0xfffffffc, which is actually -4
~3.2
is the same as !3
Bitwise OR
|
2 32-bit
long
integer
PA=0x2
| 0x5
is equivalent to PA=7
PA=0x2
| 5.1
is the same
Bitwise AND
&
2 32-bit
long
integer
PA=0x7
& 0x3
is equivalent to PA= 3
PA=0x7
& 3.1
is the same
Logical equality
==
2
0 (false) or
1 (true)
If x=3 and y=3 as x==y
yields 1
If x=3 and y=5 as x==y
yields 0
Logical inequality
!=
2 0
(false)
or
1 (true)
If x=3 and y=3 as x!=y
yields 0
If x=3 and y=5 as x!=y
yields 1
Logical greater
than
>
2 0
(false)
or
1 (true)
If x=3 and y=3 as x>y
yields 0
If x=3 and y=2 as x>y
yields 1
If x=1 and y=2 as x>y
yields 0
Logical greater
than or equal to
>=
2 0
(false)
or
1 (true)
If x=3 and y=3 as x>=y
yields 1
If x=3 and y=2 as x>=y
yields 1
If x=1 and y=2 as x>=y
yields 0
Logical less than
<
2 0
(false)
or
1 (true)
If x=3 and y=3 as x yields 0 If x=3 and y=2 as x yields 0 If x=1 and y=2 as x yields 1 Logical less than <= 2 0 (false) or 1 (true) If x=3 and y=3 as x<=y yields 1 If x=3 and y=2 as x<=y yields 0 If x=1 and y=2 as x<=y yields 1 Logical AND: && 2 0 or 1 1 && 5 yields 1 0.21 && 2 yields 1 0 && 2 yields 0
or equal to
Result is 1 if both
arguments are
nonzero, 0 if any
is zero *