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. Returns a floating poinnt number if it cannot return a fraction. |
- (1 operand) | changes the sign of the operand. |
floor(x) | the greatest integer not greater than x. |
ceiling(x) | the smallest integer not less than x. |
remainder(x,y) | equals x-y*floor(x/y) |
abs(x) | computes the absolute value of an atomic value. |
sqrt(x) | calculates the square root of an atomic value |
rand(x) | generates random numbers not greater than x. |
set_rand(x) | initializes the random number generator rand uses. |
sin(x) | calculates the sine of x. |
arcsin(x) | calculates the angle with a given sine. |
cos(x) | calculates the cosine of x. |
arccos(x) | calculates the angle with a given cosine |
tan(x) | calculates the tangent of x. |
arctan(x) | calculates the arc tangent of x. |
log(x) | calculates the natural logarithm. |
exp(x) | calculates the exponential of x. |
power(base,exponent) | calculates base raised to the power exponent. |
E | the base of the natural logarithm (2.7182818....) |
PI | the circle perimeter/diameter ratio (3.14159...) |
[+|-]inf | The infinity symbol, with an optional sign. |
scale2(x) | returns the exponent of the higher power of 2 not greater than the absolute value of x. |
scale10(x) | returns the exponent of the higher power of 10 not greater than the absolute value of x. |
int_to_bits(some_int,size) | Returns a sequence made of the size least significant bits of some_int. |
bits_to_int(some_seq) | Returns an integer made of the 0's and 1's of some_seq. |
&& | 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: lengths of both operands add 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[i1,...,in] | the nonatom formed by s[i1], ... and s[in]. |
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 structure 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)