Skip to main content

Module arithmetic

Module arithmetic 

Source
Expand description

Arithmetic function nodes.

Core integer operations for the Polydat DAG. These are the building blocks that most workloads compose: hash → mod → add for bounded IDs, mixed_radix for coordinate decomposition, interleave for combining independent dimensions.

Structs§

Add
Add a constant to a u64 value (wrapping).
CeilToMultiple
Smallest multiple of multiple that is ≥ value.
Clamp
Clamp an unsigned integer to [min, max].
Div
The div node.
DivWire
Division of a u64 by a wire-fed divisor. SRD-80 PR B.14 migration — same NonZeroU64 contract as mod_wire.
Interleave
Interleave the bits of two u64 values into one (Morton code).
Max
The max node.
Min
The min node.
MixedRadix
Decompose value into mixed-radix digits using the given radixes. The output is a vector of N digits where N = radixes.len(). A radix of 0 in the trailing position captures the remainder verbatim.
Mod
The mod node.
ModWire
Modulo of a u64 value by a wire-fed divisor.
Mul
The mul node.
MultiplesAtLeast
Count of multiples of multiple needed to cover value.
Product
The product node.
SetOrGet
“Set-or-get” memoizer: returns current if non-zero, otherwise returns fallback.
Sum
Sum N u64 inputs (wrapping). Variadic: accepts 0..N wire inputs.

Functions§

signatures
Signatures for arithmetic and variadic nodes.