NSM Operators

From VLECK
Jump to: navigation, search

arithmetic operators

^ Power
11^3 →  1331.000000
also: Power()
* Multiply
11*3 → 33
also: Multiply()
/ Divide
11/3 → 3.666667
also: Divide()
 % Remainder
11%3 → 2.000000
+ Addition
11+3 → 14
also: Plus()
- Substraction
11-3 → 8
also: Minus()

Unary operators

 a = (1, 2, 3, 4, 5);
 x = (1, 1, 0, 0, 0, 2, 3);
- Negative
-a → -1 -2 -3 -4 -5
also: Negative()
< Minumum
<a → 1
also: RowMin()
> Maximum
>a → 5
also: RowMax()
 ! NOT
!x → 0  0  1  1  1  0  0
also: Not()

Logical operators

 a = (0, 1, 2, 3, 4);
 b = (4, 3, 2, 1, 0); 
== Equal
a == b → 0  0  1  0  0
also: Eq()
> Greater
a >  b → 0  0  0  1  1
also: Gt()
>= Greater or Equal
a >=  b → 0  0  1  1  1
also: GE()
< Less
a <  b → 1  1  0  0  0
also: Lt()
<= Less or Equal
a <=  b → 1  1  1  0  0
also: LE()
<> Unequal
a <>  b → 1  1  0  1  1
also: NE()
& AND
a &  b → 0  1  1  1  0
also: And()
| OR
a |  b → 1  1  1  1  1
also: Or()
 ! NOT
!a → 1  0  0  0  0
also: Not()

Series operators

# simple expansion
1 # 5 → 1  2  3  4  5
5 # 1 → 5  4  3  2  1
# # stepped expansion (from # step # to)
0 # 5 # 25 → 0  5  10  15  20  25
0#0.1#1 → 0.000000  0.100000  0.200000  0.300000  0.400000  0.500000  
               0.600000  0.700000  0.800000  0.900000  1.000000

see also: Series()


Matrix operators

' Matrix Transpose also: Transpose()
+* Matrix Multiplication also: MatrixMultiply()

example:

a=redim(0#5; 2, 3)
0	1	2
3	4	5


b=a'
0	3
1	4
2	5


a+*b
5	14
14	50

see also