Skip to content

Numbers

Use this when doing arithmetic, comparisons, aggregation, or numeric conversions.

OperatorDescriptionExampleResult
+Add+3 47
-Subtract-10 37
*Multiply*3 412
/Divide/10 25
%Modulo%10 31

Work on u32, u64, and i64 integer types.

OperatorDescriptionExample
bandBitwise ANDband 0xF0u 0x0Fu -> 0u
borBitwise ORbor 0xF0u 0x0Fu -> 0xFFu
bxorBitwise XORbxor 0xFFu 0x0Fu -> 0xF0u
bnotBitwise NOT (complement)bnot 0u -> 0xFFFFFFFFu
shlLeft shiftshl 1u 4 -> 16u
shrRight shift (logical for u32/u64, arithmetic for i64)shr 16u 4 -> 1u

64-bit variants (band64, bor64, bxor64, bnot64, shl64, shr64) operate on u64 and i64 values, allowing full 64-bit integer manipulation for crypto, binary codecs, and WASM interop.

OperatorDescriptionExample
==Equal==a b
!=Not equal!=a b
>Greater than>a b
<Less than<a b
>=Greater or equal>=a b
<=Less or equal<=a b

All comparisons return b.

OperatorDescriptionExample
&Logical AND&a b
|Logical OR|a b
!Logical NOT!a
FunctionSignatureDescriptionExample
absn > nAbsolute valueabs -5 -> 5
flrn > nFloorflr 3.7 -> 3
celn > nCeilingcel 3.2 -> 4
roun > nRound to nearest integer (banker’s rounding)rou 3.7 -> 4
rnd> nRandom float in [0, 1). Aliases: rand, random. Read this as random, not round; for rounding use rou.rnd -> 0.42…
rndn n > nRandom integer in [a, b] inclusivernd 1 6 -> dice
rndnn n > nOne sample from N(mu, sigma) (Box-Muller)rndn 0 1 -> 0.34…
seedn > _Set the shared PRNG state (SplitMix64). All subsequent rnd/rndn on every engine use this state. Default seed is deterministic (no wall-clock). Returns _. For entropy: seed (now-ms).seed 42
FunctionSignatureDescriptionExample
sumL n > nSum a list of numberssum [1,2,3] -> 6
avgL n > nAverage of a list of numbersavg [2,4,6] -> 4
minL n > nMinimum element of a numeric list (error if empty)min [3,1,4,1,5] -> 1
maxL n > nMaximum element of a numeric list (error if empty)max [3,1,4,1,5] -> 5
minn n > nMinimum of two numbersmin 3 7 -> 3
maxn n > nMaximum of two numbersmax 3 7 -> 7
medianL n > nMedian of a numeric listmedian [1,2,3,4,5] -> 3
stdevL n > nSample standard deviation (divides by N-1)stdev [2,4,4,4,5,5,7,9]
varianceL n > nSample variance (divides by N-1)variance [...]
argmaxL n > nIndex of max element (first occurrence wins on ties; errors on empty)argmax [3,1,9,2] -> 2
argminL n > nIndex of min element (first occurrence wins on ties; errors on empty)argmin [3,1,9,2] -> 1
argsortL n > L nSorted-index permutation ascending (stable; empty returns [])argsort [3,1,2] -> [1,2,0]
FunctionSignatureDescriptionExample
linspacen n n > L nn evenly-spaced floats from a to b inclusive (numpy endpoint=True). n=0 returns []; n=1 returns [a]. Last element pinned to b to avoid float-accumulated drift.linspace 0 10 5 -> [0, 2.5, 5, 7.5, 10]
onesn > L nn copies of 1.0. n=0 returns []. Saves the design-matrix-column map (i:n>n;1) (range 0 n) cascade.ones 5 -> [1, 1, 1, 1, 1]
repn T > L Tn copies of any value (element type follows the value). n=0 returns []. Saves map (i:n>T;v) (range 0 n) for accumulator seeding and constant tables.rep 3 7 -> [7, 7, 7], rep 3 "x" -> ["x", "x", "x"]

All three reject negative n with ILO-R009 and cap at 1,000,000 elements.

FunctionSignatureDescriptionExample
str_ > tConvert to stringstr 42 -> "42"
numt|n > R n tPolymorphic: parse text or identity-wrap a number as Ok. Saves the num (str x) roundtrip when x may already be numeric (e.g. from jpar! on a JSON number)num "42" -> Ok 42, num 42 -> Ok 42
Long formShort form
averageavg
floorflr
ceilcel
roundrou
randomrnd
randrnd
numbernum
stringstr