Here are the various operators supported by OpenEuphoria, arranged by the type of task they help perform. A short description is provided for each of them.
+ | the ordinary addition. |
- | the ordinary substraction. |
* | the ordinary multiplication. |
/ | the division operator. Always returns a floating poinnt number. |
- (1 operand) | changes the sign of the operand. |
floor(x) | the greatest integer not greater than x. |
ceiling(x) | the smalllet integer not less than x. |
remainder(x,y) | a nonnegative atom, equals x-y*floor(x/y) |
abs | computes the absolute value of an integer or floating point number. |
sqrt | calculate the square root of an object |
rand | generate random numbers |
sin | calculate the sine of an angle |
arcsin | calculate the angle with a given sine |
cos | calculate the cosine of an angle |
arccos | calculate the angle with a given cosine |
tan | calculate the tangent of an angle |
arctan | calculate the arc tangent of a number |
log | calculate the natural logarithm |
exp | calculate the exponential of a number |
power | calculate a number raised to a power |
PI | the circle perimeter/diameter ratio (3.14159...) |
&& | bitwise and |
|| | bitwise or |
~~ | bitwise xor |
^ | bitwise not |
<< | left shift |
>> | right unsigned shift |
>>> | right signed shift |
and_bits(x,y) | perform logical AND on corresponding bits of operands |
or_bits(x,y) | perform logical OR on corresponding bits of operands |
xor_bits(x,y) | perform logical XOR on corresponding bits of operands |
not_bits(x,y) | perform logical NOT on all bits of operands |
{x,y,..} | a nonatom whose first element is x, the second one y,... |
{} | an empty nonatom |
"" | an empty string |
"..." | a string |
$"..."$ | a long string: any line ending characters in it are ignored, so it may span several lines in source files. |
"""...""" | verbatim string. No processing at all is performed on a verbatim string, so line breaks are treated as is, and there are no escape sequences. |
\letter | an escape sequence, see part A, 2.2 for the sequences recognized. |
\(number) | a character whose ASCII code is number. |
& | concatenation (length of both operands adds up to the result's length. The second operand is considered to be of length 1 if it is an atom |
s[i] | the i-th element of s |
s[i..j] | the sublist of s formed by its elements i through j. Empty if i=j+1 otherwise invalid. |
s[i_1,...,i_n] | the nonatom formed by s[i_1], ... and s[i_n]. |
s[i][j] | the j-th element of the nonatom which is the i-th element of s |
s.name | the element of s with name name |
.name | the member in the host record with name name. Allowed only in context type statements. |
s[-i] | the i-th element of the mirror copy of s. Thus, s[-1] is the last element of s, and so on backwards. |
x
operator= y
x
=x
operator y
, where operator is any infix
listed in 1 or 2.
x1
,x2
,...xn
)[operator]=y
x1
operator=y
, x2
operator= y
,...,xn
operator= y
. There
may be no operator, hence the brackets.
x1
,...xn
)#[operator]=expr
x1
[operator]= expr[1], x2
[operator]= expr[2] and so on. Extra symbols
on the left or the right are ignored. Use the _ special variable to discard
the result at this place on the left.
x
=get_var(expr)= | is equal to |
!= | is not equal to |
<,<= | is less than, is no greater than |
>,>= | is greater than, is not less than |
x and y | is true if and only if x and y are true. |
x or y | is true whenever x or y is true |
not x | true if x is false, false if x is true.
|
x
=compare(expr1,expr2)x
=equal(expr1,expr2)x
=(compare(expr1,expr2)=0)