Normally operations apply only to single values, so a+b expresses the addition of two numbers. Normally adding two arrays requires indexing and looping:
110 For i=0 to N
120 For j=0 to N
130 A(J,I) = A(J,I) + B(J,I)
140 Next j
150 Next i
This need to loop and index to perform operations on arrays is both tedious and error prone.
But in this version of Basic you can simply add the arrays together.
A() = A() + B()
The single line of code above performs the same function as the double loop, only much faster.
Entire arrays can be initialized in a single line.
A() = 10
Here every element of A() is set to 10.
Array operations can get as complex as you need.
A() = A() * B() / C() + 0.5
A() = A() + 0.5
A() = 0.5 + A()
b() = 256
a() = b()
Now a() will have the same dimensions as b() and will contain same values as b().
(shift right signed)
(shift right unsigned)
* / % mod
+ - & | || << >> >>>