You may also want to use some mathematical functions:
<numeric type> abs(
<numeric type> arg)
;
The abs(<numeric type>)
function takes one
argument of any numeric data type and returns its absolute
value.
long bit_and(
<numeric type> arg1, <numeric type> arg2)
;
The bit_and(<numeric type>, <numeric type>)
function accepts two arguments of any numeric data type. It takes
integer parts of both arguments and returns the number
corresponding to the bitwise and
. (For example,
bit_and(11,7)
returns 3
.) As
decimal 11
can be expressed as bitwise
1011
, decimal 7
can be
expressed as 111
, thus the result is
11
what corresponds to decimal
3
. Return data type is long
,
but if it is sent to other numeric data type, it is expressed in
its numeric representation.
long bit_invert(
<numeric type> arg)
;
The bit_invert(<numeric type>)
function
accepts one argument of any numeric data type. It takes its
integer part and returns the number corresponding to its bitwise
inverted number
. (For example,
bit_invert(11)
returns -12
.)
The function inverts all bits in an argument. Return data type is
long
, but if it is sent to other numeric data
type, it is expressed in its numeric representation.
boolean bit_is_set(
<numeric type> arg, <numeric type> Index)
;
The bit_is_set(<numeric type>, <numeric type>)
function accepts two arguments of any numeric data type. It takes
integer parts of both arguments, determines the value of the bit
of the first argument located on the Index
and
returns true
or false
, if
the bit is 1
or 0
,
respectively. (For example, bit_is_set(11,3)
returns true
.) As decimal 11
can be expressed as bitwise 1011
, the bit whose
index is 3 (the fourth from the right) is 1
,
thus the result is true
. And
bit_is_set(11,2)
would return
false
.
long bit_lshift(
<numeric type> arg, <numeric type> Shift)
;
The bit_lshift(<numeric type>, <numeric type>)
function accepts two arguments of any numeric data type. It takes
integer parts of both arguments and returns the number
corresponding to the original number with some bits added
(Shift
number of bits on the left side are
added and set to 0
.) (For example, bit_lshift(11,2)
returns 44
.) As decimal 11
can be expressed as bitwise 1011
, thus the two
bits on the right side (10
) are added and the
result is 101100
which corresponds to decimal
44
. Return data type is long
,
but if it is sent to other numeric data type, it is expressed in
its numeric data type.
long bit_or(
<numeric type> arg1, <numeric type> arg2)
;
The bit_or(<numeric type>, <numeric type>)
function accepts two arguments of any numeric data type. It takes
integer parts of both arguments and returns the number
corresponding to the bitwise or
. (For example,
bit_or(11,7)
returns 15
.) As
decimal 11
can be expressed as bitwise
1011
, decimal 7
can be
expressed as 111
, thus the result is
1111
what corresponds to decimal
15
. Return data type is
long
, but if it is sent to other numeric data
type, it is expressed in its numeric data type.
long bit_rshift(
<numeric type> arg, <numeric type> Shift)
;
The bit_rshift(<numeric type>, <numeric type>)
function accepts two arguments of any numeric data type. It takes
integer parts of both arguments and returns the number
corresponding to the original number with some bits removed
(Shift
number of bits on the right side are
removed.) (For example,
bit_rshift(11,2)
returns
2
.) As decimal 11
can be
expressed as bitwise 1011
, thus the two bits on
the right side are removed and the result is
10
what corresponds to decimal
2
. Return data type is
long
, but if it is sent to other numeric data
type, it is expressed in its numeric data type.
long bit_set(
<numeric type> arg1, <numeric type> Index, boolean SetBitTo1)
;
The bit_set(<numeric type>, <numeric type>,
boolean)
function accepts three arguments. The first two
are of any numeric data type and the third is boolean. It takes
integer parts of the first two arguments, sets the value of the
bit of the first argument located on the Index
specified as the second argument to 1
or
0
, if the third argument is
true
or false
, respectively,
and returns the result as a long value. (For example,
bit_set(11,3,false)
returns
3
.) As decimal 11
can be
expressed as bitwise 1011
, the bit whose index
is 3 (the fourth from the right) is set to 0
,
thus the result is 11
what corresponds to
decimal
. And
3
bit_set(11,2,true)
would return
1111
what corresponds to decimal
15
. Return data type is
long
, but if it is sent to other numeric data
type, it is expressed in its numeric data type.
long bit_xor(
<numeric type> arg, <numeric type> arg)
;
The bit_xor(<numeric type>, <numeric type>)
function accepts two arguments of any numeric data type. It takes
integer parts of both arguments and returns the number
corresponding to the bitwise exclusive
or
. (For example,
bit_or(11,7)
returns 12
.) As
decimal 11
can be expressed as bitwise
1011
, decimal 7
can be
expressed as 111
, thus the result is
1100
what corresponds to decimal
15
. Return data type is
long
, but if it is sent to other numeric data
type, it is expressed in its numeric data type.
number e(
)
;
The e()
function accepts no argument and
returns the Euler number.
number exp(
<numeric type> arg)
;
The exp(<numeric type>)
function takes one
argument of any numeric data type and returns the result of the
exponential function of this argument.
number log(
<numeric type> arg)
;
The log(<numeric type>)
takes one argument
of any numeric data type and returns the result of the natural
logarithm of this argument.
number log10(
<numeric type> arg)
;
The log10(<numeric type>)
function takes one
argument of any numeric data type and returns the result of the
logarithm of this argument to the base 10.
number pi(
)
;
The pi()
function accepts no argument and
returns the pi number.
number pow(
<numeric type> base, <numeric type> exp)
;
The pow(<numeric type>, <numeric type>)
function takes two arguments of any numeric data types (that do
not need to be the same) and returns the exponential function of
the first argument as the exponent with the second as the
base.
number random(
)
;
The random()
function accepts no argument
and returns a random positive double greater than or equal to
0.0
and less than
1.0
.
number random(
long randomSeed)
;
The random(long)
function accepts one
argument of long data type and returns a random positive double
greater than or equal to 0.0
and less than
1.0
. The argument ensures that the generated
values remain the same upon each run of the graph. The generated
values can only be changed by changing the
randomSeed
value.
boolean random_boolean(
)
;
The random_boolean()
function accepts no
argument and generates at random boolean values
true
or false
. If these
values are sent to any numeric data type field, they are converted
to their numeric representation automatically
(1
or 0
,
respectively).
boolean random_boolean(
long randomSeed)
;
The random_boolean(long)
function accepts
one argument of long data type and generates at random boolean
values true
or false
. If
these values are sent to any numeric data type field, they are
converted to their numeric representation automatically
(1
or 0
, respectively). The
argument ensures that the generated values remain the same upon
each run of the graph. The generated values can only be changed by
changing the randomSeed
value.
<numeric type>
random_gaussian(
)
;
The random_gaussian()
function accepts no
argument and generates at random both positive and negative values
of return numeric data type in a Gaussian distribution.
<numeric type>
random_gaussian(
long randomSeed)
;
The random_gaussian(long)
function
accepts one argument of long data type and generates at random
both positive and negative values of return numeric data type in a
Gaussian distribution. The argument ensures that the generated
values remain the same upon each run of the graph. The generated
values can only be changed by changing the
randomSeed
value.
int random_int(
)
;
The random_int()
function accepts no
argument and generates at random both positive and negative
integer values.
int random_int(
long randomSeed)
;
The random_int(long)
function accepts one
argument of long data type and generates at random both positive
and negative integer values. The argument ensures that the
generated values remain the same upon each run of the graph. The
generated values can only be changed by changing the
randomSeed
value.
int random_int(
int Minimum, int Maximum)
;
The random_int(int, int)
function accepts
two argument of integer data types and returns a random integer
value greater than or equal to Minimum
and less
than or equal to Maximum
.
int random_int(
int Minimum, int Maximum, long randomSeed)
;
The random_int(int, int, long)
function
accepts three arguments. The first two are of integer data types
and the third is long. The function takes them and returns a
random integer value greater than or equal to
Minimum
and less than or equal to
Maximum
. The third argument ensures that the
generated values remain the same upon each run of the graph. The
generated values can only be changed by changing the
randomSeed
value.
long random_long(
)
;
The random_long()
function accepts no
argument and generates at random both positive and negative long
values.
long random_long(
long randomSeed)
;
The random_long(long)
function accepts
one argument of long data type and generates at random both
positive and negative long values. The argument ensures that the
generated values remain the same upon each run of the graph. The
generated values can only be changed by changing the
randomSeed
value.
long random_long(
long Minimum, long Maximum)
;
The random_long(long, long)
function
accepts two argument of long data types and returns a random long
value greater than or equal to Minimum
and less
than or equal to Maximum
.
long random_long(
long Minimum, long Maximum, long randomSeed)
;
The random_long(long, long, long)
function accepts three arguments of long data types and returns a
random long value greater than or equal to
Minimum
and less than or equal to
Maximum
. The argument ensures that the
generated values remain the same upon each run of the graph. The
generated values can only be changed by changing the
randomSeed
value.
long round(
<numeric type> arg)
;
The round(<numeric type>)
function takes one
argument of any numeric data type and returns the long that is
closest to this argument.
number sqrt(
<numeric type> arg)
;
The sqrt(<numeric type>)
function takes one
argument of any numeric data type and returns the square root of
this argument.