The built-in numeric types are integers and floats, which are equivalent to
Wrapping<i32> and f32 respectively.
Floats are "contagious". When an arithmetic function receives at least one float argument, the return value is usually a float, even when its other arguments are integers.
Arithmetic
+Addition.
-Subtraction or negation.
*Multiplication.
/Division or reciprocation.
%Remainder.
div-euclidEuclidean division.
rem-euclidEuclidean remainder.
absAbsolute value.
signSign.
Predicates
even?Returns #t if its argument is even.
odd?Returns #t if its argument is odd.
nat-int?Returns #t if its argument is a natural integer (>= 0).
pos-int?Returns #t if its argument is a positive integer (> 0).
neg-int?Returns #t if its argument is a negative integer (< 0).
nan?Returns #t if its argument is a NaN.
inf?Returns #t if its argument is infinite.
Comparisons
==Numeric equality test.
<Numeric less-than test.
<=Numeric less-than-or-equal test.
>Numeric greater-than test.
>=Numeric greater-than-or-equal test.
ordNumeric or lexicographic ordering.
minMinimum.
maxMaximum.
clampClamps a value to a numeric range.
Mathematics
roundRound-to-nearest.
floorRound down.
ceilRound up.
sqrtSquare root.
cbrtCube root.
powExponentiation.
logLogarithm.
flo-signFloating-point sign bit.
truncReturns the integer part of a float, as a float.
fractReturns the fractional part of a float.
sinSine, in radians.
cosCosine, in radians.
tanTangent, in radians.
asinArcsine, in radians.
acosArccosine, in radians.
atanArctangent, in radians.
Bit Manipulation
bitandBitwise AND.
bitorBitwise inclusive OR.
bitxorBitwise exclusive OR.
bitnotBitwise NOT.
bitshlLeft shift.
bitshrLogical right shift.
bitsarArithmetic right shift.
Randomness
randGenerates a random number.
chance?Returns #t or #f in the given ratio.
rand-pickRandomly selects one of its arguments.
rand-weightedRandomly selects one item from a group, with unequal probability.
rand-reseedRestarts the random number generator from a fixed seed.