Basics

arithmetic evaluation



ised> 5*2+3^2+6/2 calculator
22
ised> 1/2 1./2 1/d2 i{1/2.} distinction between floats and integers
0 0.5 0.5 0
ised> {-2 -1 2 2.5 3}%2 operating on arrays, modulo works for floats
0 1 0 0.5 1
ised> 3*[10]+1 adding 1 to every element of array
1 4 7 10 13 16 19 22 25 28
ised> {1 2 3}+{-1 -2 -3} distinction: summation of every pair
0 -1 -2 1 0 -1 2 1 0
ised> {1 2 3}:+{-1 -2 -3} distinction: summation by element
0 0 0
ised> sin3.14 cospi 4*atn1 exp{-1} {3 5}! various functions
0.00159265 -1 3.14159 0.367879 6 120
ised> sqt{2 4 9} square root of several numbers
1.41421 2 3
ised> @+[1 10] @*[1 10] sum and product of array elements
55 3628800
ised> {-1 0 1}@:{4 3 2} dot product of two vectors
-2

array manipulation



ised> E[10] select even integers
0 2 4 6 8
ised> S{4 2 6.2 1 -5 6} sort
-5 1 2 4 6 6.2
ised> {1 2 3}&{2 3 4 5} set intersection
2 3
ised> {1 2 3}|&{2 3 4 5} set-wise xor
1 4 5
ised> [5 1]_{3 2 0 -1 0.5} element selection: wrap-around and interpolation
2 3 5 1 4.5
ised> [10]<<3 [10]>>3 head & tail
0 1 2 7 8 9

factorial evaluation



ised> @*[1 10] 10! 10.! for low values only floats produce floats
3628800 3628800 3.6288e+06
ised> @*[1 16] 16! 16.! larger values: switches to floats if compiled with 32-bit integer type
2.09228e+13 2.09228e+13 2.09228e+13 INT_TYPE=INT
20922789888000 20922789888000 2.09228e+13 INT_TYPE=LONG
ised> @*[1 -3] -3! -3.! for negative values, only float version is correct
0 1 inf
ised> -0.5! sqtpi gamma function!
1.77245 1.77245

sequence constructors



ised> [10] integer sequence
0 1 2 3 4 5 6 7 8 9
ised> [2 5] [5 2] ~[2 5] arbitrary range, array reversal
2 3 4 5 5 4 3 2 5 4 3 2
ised> [-1 0.5 2] arbitrary increment
-1 -0.5 0 0.5 1 1.5 2
ised> (5 10) repetition
5 5 5 5 5 5 5 5 5 5
ised> (5 2 10) incrementation of desired length
5 7 9 11 13 15 17 19 21 23
ised> {1 2 [3 5] {3*2 {7}}} array flattening
1 2 3 4 5 6 7