1a: Basic Arithmetic
+add
+addAdd.
Produces the sum of .a and .b.
Accepts
.a is an $atom.
.b is an $atom.
Produces
An $atom.
Source
++ add
~/ %add
|= [a=@ b=@]
^- @
?: =(0 a) b
$(a (dec a), b +(b))Examples
+dec
+decDecrement.
Decrements .a by 1.
Accepts
.a is an $atom.
Produces
An $atom.
Source
Examples
+div
+divDivide.
Computes .a divided by .b without remainder.
Accepts
.a is an $atom.
.b is an $atom.
Produces
An $atom.
Source
Examples
+dvr
+dvrDivide with remainder.
Computes .a divided by .b, producing the quotient and the remainder.
Accepts
.a is an $atom.
.b is an $atom.
Produces
A cell of $atoms.
Source
Examples
+gte
+gteGreater-than/equal.
Tests whether .a is greater than or equal to .b.
Accepts
.a is an $atom.
.b is an $atom.
Produces
A $flag.
Source
Examples
+gth
+gthGreater-than.
Tests whether .a is greater than .b.
Accepts
.a is an $atom.
.b is an $atom.
Produces
A $flag.
Source
Examples
+lte
+lteLess-than/equal.
Tests whether .a is less than or equal to .b.
Accepts
.a is an $atom.
.b is an $atom.
Produces
A $flag.
Source
Examples
+lth
+lthLess-than.
Tests whether .a is less than .b.
Accepts
.a is an $atom.
.b is an $atom.
Produces
A $flag.
Source
Examples
+max
+maxMaximum.
Computes the greater of .a and .b.
Accepts
.a is an $atom.
.b is an $atom.
Produces
An $atom.
Source
Examples
+min
+minMinimum.
Computes the lesser of .a and .b.
Accepts
.a is an $atom.
.b is an $atom.
Produces
An $atom.
Source
Examples
+mod
+modModulus.
Computes the remainder of dividing .a by .b.
Accepts
.a is an $atom.
.b is an $atom.
Produces
An $atom.
Source
Examples
+mul
+mulMultiply.
Multiplies .a by .b.
Accepts
.a is an $atom.
.b is an $atom.
Produces
An $atom.
Source
Examples
+sub
+subSubtract.
Subtracts .b from .a.
Accepts
.a is an $atom.
.b is an $atom.
Produces
An $atom.
Source
Examples
Last updated