...
Conjunction, Disjunction and Negation. Boolean operators consider all null values to be false and all non null values to be true. Result is either 1 or 0.
Excerpt number
abs
( number )
Returns absolute value of a number
...
number
acos
( number )
number asin
( number )
number atan
( number )
Return the arc trigonometric function of a number. Result is in radians
number
cos
( number )
Return the cosine of a number (angle in radians)
...
n = 6 # in bit-form, this is `00000110' with the lsb at the right
flag = intbits (n, 1) # flag is now 0
flag = intbits (n, 2) # flag is now 1
flag = intbits (n, 3) # flag is now 1
...
To extract the 1st and 2nd bits together to make a single number:flag = intbits (n, 1, 2) # flag is now 2
To extract the 2nd and 3rd bits together to make a single number:flag = intbits (n, 2, 2) # flag is now 3
To extract the 3rd and 4th bits together to make a single number:flag = intbits (n, 3, 2) # flag is now 1
The number of bits available depends on the machine architecture and Metview's compilation options, but at the time of writing it should be either 32 or 64.
number
log
( number )
Returns the natural logarithm of a number
...
Returns the remainder of the division of the first value by the second. If the second number is larger than the first, it returns the integer part of the first number. Note that only the integer parts of the inputs are considered in the calculation, meaning that a second parameter of 0.5 would cause a division by zero.
...
number
neg
( number )
Returns the negative of a number. The same as (- number).
number
number
( date,string )
...
- yy gives 97
- yyyy gives 1997
- m or mm give 4
- d or dd give 1
- D or DDD give 91 (4th of April is the 91st day of the year).
- H or HH give 2
- M or MM give 3
- S or SS gives 4
number
precision
( )
number precision
( number )
...
precision( 12 ) gives 1234.56789
precision( 6 ) gives 1234.57
precision( 4 ) gives 1235
precision( 2 ) gives 1.2e+03
...
number
random
()
Returns a randomly selected non-negative double-precision floating-point value. The return values are uniformly distributed between [0.0, 1.0). There is no need to `seed' this random function, as this is done automatically the first time it is called.
...
round( v, 1 ) gives 1234.6
round( v, 3 ) gives 1234.568
round( v, -2 ) gives 1200
number
sgn
( number )Returns the sign of a number as a number : -1 for negative values, 1 for positive and 0 for null values.
number
sin
( number )Return the sine of a number (angle in radians)
number
sqrt
( number )Returns the square root of a number
string
string
( number )Returns the string equivalent of a number
number
sum
( number,number,... )Returns the sum of the input values
number
tan
( number )Return the tangent of a number (angle in radians)