Comparison Operators
Logical Operators
Unary Logical Operator
Intrinsic Functions
and Statements
Chapter 6
==
(is equal to)
!=
(is not equal to)
<
(is less than)
>
(is greater than)
<=
(is less than or equal to)
>=
(is greater than or equal to)
||
(or)
&&
(and)
!
(not)
The result of a comparison operation is a boolean value. It is still a type float
but its value is either 0 (zero) if false or 1 (one) if true. Any variable may be
tested with the if statement. A value of zero tests false, if any other value, it
tests true. For example:
/* if my_var is other than 0, increment count_var */
if(my_var) count_var=count_var+1;
The following functions and statements are provided in the VT1422A's
Algorithm Language:
Functions:
abs(expression)
max(expression1,expression2) return largest of the two expressions
min(expression1,expression2) return smallest of the two expressions
Statements:
interrupt()
writeboth(expression,cvt_loc) write expression result to FIFO
writecvt(expression,cvt_loc)
writefifo(expression)
Note
The sum of the number of calls to writefifo(), writecvt() and writeboth()
must not exceed 512.
examples;
a == b
a != b
a < b
a > b
a <= b
a >= b
examples;
(a == b) || (a == c)
(a == b) && (a == c)
example;
!b
return absolute value of expression
sets bit 11 of STAT:OPER register
and CVT element specified.
write expression result to CVT
element specified.
write expression result to FIFO.
Creating and Running Algorithms
209