FromTo operations ":" | operation( left_integer : right_integer ) | |||||||||
+ (3 : 5) | 3 + 4 + 5 = 12 | |||||||||
= * (5 : 1) | 5 * 4 * 3 * 2 * 1 = 5! = 120 | |||||||||
sum = +(2^(0:-10)) | 1+1/2+1/4+ .. 1/1024 == 1.9990234375 | |||||||||
p = +( LOG(100:1)) | 363.739375555564 == log(100) + log(99) + ... log(1) | |||||||||
q = LOG(*(100:1)) | 363.739375555563 == log( 100 * 99 * ... 1 ) | |||||||||
x = +(1.6 : 2.4) | x is 2 == NINT(1.6) == NINT(2.4) | |||||||||
M = +( 1 : $ ) |
| |||||||||
= *(n:1) / (*(k:1)) / (*(n-k:1)) | n! / ( k! * (n-k)! ), same as: | |||||||||
binomial_coeff = *(n:n-k+1) / (*(k:1)) | ||||||||||
x = *(49:1) / (*(6:1)) / (*(49-6:1)) | 6 from 49 = 13983816 | |||||||||
y = *(49:49-6+1) / (*(6:1)) | 49 choose 6 = 13983816 |
Arrays | REAL X(3), Y(3), M(3,3), X8(8) ! samples | |||||||||
Y = (1,2,3) ^ (4,5,6) | 1 32 729 temporary vector | |||||||||
d = /(Y) | = Y(1) / Y(2) / Y(3) | |||||||||
Y = Y(3:1) | reverse a vector | |||||||||
M = 1 / $ | M is (1, 1/2, 1/3, ..., 1/9)
| |||||||||
M = M( 3:1, 3:1) | reverse row and column order | |||||||||
M = 1 / ( $R + $C - 1) ! |
| |||||||||
= +( M( $1, $1) ) | sum of matrix M diagonal elements | |||||||||
k = +( M >= 1/2 ) | count matrix elements >= 0.5 | |||||||||
l = +( M( 2 , : ) > 1/2 ) | count row(2) elements > 0.5 | |||||||||
n = +( M( : , 2 ) ) | sum along column 2 | |||||||||
o = +( M( : , 2:3) ) | sum along columns 2 and 3 | |||||||||
Z = +(M( $C, $1) * Y( $1)) | ||||||||||
max = MAX( 4, -3.1, 4+4.1 ) | 8.1 | |||||||||
max_location = MAXLOC( 4, -3.1, 4+4.1 ) | 3 | |||||||||
X8 = *( 8 : 8- $+1 ) / ( *( $:1) ) | 8 28 56 70 56 28 8 1
8th row of Pascals triangle 1st coeff ( 0! == 1) would provoke error | |||||||||
+( X8 ) + 1 | 256 == 2 ^ 8 sum of 8th row |
CHARACTER S10*10 ! sample string | |
S10 = CHAR( $ + 64) | ABCDEFGHIJ
( "A" has the Ascii number 65) |
S10 = &( CHAR(64+ $1) & "," ) | A, B, C, D
("&" is the Join operator) |
S10 = CHAR(64+ RAN(26)+0* $ ) | SQYWTYQHFG
( 0* $ forces the inline loop to execute LEN(S10) = 10 times) |
|
op( filename( from : to )
see MatrixExplorer |
OPEN(FIle=filename, F=";/;/N;/") | 3 columns separated by semicolons.
3rd column is Numerical |
string = && (filename( $1, 2)) | string gets all elements in column 2
separated by 1 space |
string = & (filename( $1,2)&$CRLF) | elements in column 2 separated by carriagereturn & linefeed |
column-sum = + (filename( $1,3)) | all elements in column 3 added |