Stdlib module math/arithmetic.vitl

This page is a wiki-style reference for one concrete stdlib file. It explains what the file owns, where it fits in the family, and how to decide whether this is the right surface to depend on.

Visual portrait of math/arithmetic.vitl
Wiki-style portrait for math/arithmetic.vitl.

Family: math

Kind: public stdlib surface

Page style: this reference follows the same “encyclopedic card + portrait + usage contract” logic as the keyword pages, but for stdlib modules.

Summary

Overview

FieldValue
Pathmath/arithmetic.vitl
Familymath
Kindpublic stdlib surface
Line count690
Declared procedures72
Declared forms/picks2

`math/arithmetic.vitl` is a public stdlib surface inside the `math` family. It should be read as one focused slice of the broader family responsibility: Arithmetic, algebra, comparison, calculus, geometry, modular arithmetic, number theory, probability, statistics, matrix, and vector helpers.

Purpose

This file should be chosen because of responsibility, not because its name “sounds close enough”. Inside the math family, it carries one focused part of the contract and keeps that responsibility separate from neighboring concerns.

  • A scoring engine can compute aggregates in `math` while keeping I/O and transport elsewhere.
  • A statistics or matrix chapter should explain the workflow around the computation, not just a single formula.

Taxonomy

Think of this page as a generated encyclopedia entry rather than a hand-written tutorial. The goal is to show what kind of module this is, how dense it is, and what reading strategy makes sense before depending on it.

  • Large algorithm surface: this file exposes many procedures and likely acts as a domain toolkit rather than a single thin wrapper.
  • Owns domain vocabulary: the module declares data shapes in addition to executable helpers, so its types are part of the contract.
  • Has tuning constants: part of the module behavior is controlled by named constants that document default precision, limits, or policy.
  • Minimal top-level dependencies: the module reads as mostly self-contained from its opening declarations.
  • Explicit export surface: the file ends with visible export declarations instead of relying only on implicit namespace discovery.

Implementation profile

This profile is inferred directly from the source text. It does not replace reading the file, but it tells you quickly whether the module is mostly declarative, loop-heavy, branch-heavy, or organized around many small exits.

SignalCountWhat it suggests
if58Branching density and local decision-making.
while12Loop-heavy or iterative implementation style.
for0Collection-style traversal at source level.
match1Variant-driven branching or grammar-style decoding.
let87Local state and intermediate value density.
give127Number of explicit exit points and result shaping.

Top-level API inventory

SurfaceItems
Proceduresabs_i64, abs_f64, add_i64, sub_i64, mul_i64, div_i64, mod_i64, add_f64, sub_f64, mul_f64, div_f64, max_i64
FormsI128
PicksSafeResult
ConstantsPI, E, I64_MIN, I64_MAX, F64_INF, F64_NAN, RAND_A, RAND_C, RAND_M
Exports*

Imported surfaces

This file does not advertise a top-level `use` surface in its opening declarations. That often means it is either self-contained or an aggregation layer.

Position in family

This file is module 3 of 21 in the math family when ordered by path. By procedure count it ranks 4, and by line count it ranks 4. Those ranks are useful as rough signals of breadth, not as quality judgments.

Declaration map

The declaration map turns raw source into a scan-friendly catalog. It is useful when the file is large enough that a reader wants to orient by kinds of surfaces first.

LineNameKindRole
1vitte/stdlib/math/arithmeticspaceDeclares the namespace that anchors this file in the stdlib tree.
7PIconstDefines a named constant reused across the module.
8EconstDefines a named constant reused across the module.
10I64_MINconstDefines a bound or precision constant that shapes runtime behavior.
11I64_MAXconstDefines a bound or precision constant that shapes runtime behavior.
13F64_INFconstDefines a named constant reused across the module.
14F64_NANconstDefines a named constant reused across the module.
16RAND_AconstDefines a named constant reused across the module.
17RAND_CconstDefines a named constant reused across the module.
18RAND_MconstDefines a named constant reused across the module.
20SafeResultpickIntroduces a tagged variant type used to model distinct outcomes.
25I128formIntroduces a structured data shape that other procedures can exchange.
29abs_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
37abs_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
45add_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
49sub_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
53mul_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
57div_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
65mod_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
73add_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
77sub_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
81mul_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
85div_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
93max_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
101min_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
109max_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
117min_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
125pow_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
145pow_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
168factprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
182gcdprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
195lcmprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
206is_primeprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
230fibprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
255clamp_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
265lerpprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
270safe_addprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
281safe_mulprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
310and_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
314or_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
318xor_i64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
322shlprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
326shrprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
330sign_i64procImplements a security-sensitive transformation in the crypto boundary.
340is_evenprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
344is_oddprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
348popcountprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
360leading_zerosprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
379trailing_zerosprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
397rotlprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
408rotrprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
419saturating_addprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
434saturating_subprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
439div_floorprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
455div_ceilprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
471floor_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
479ceil_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
487round_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
496poly_evalprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
506is_nanprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
510is_infprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
514copysignprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
522exp_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
534log_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
541sqrt_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
556sin_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
568cos_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
579log10_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
586fabsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
590fmodprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
600ceilprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
604floorprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
608rand_nextprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
614rand_f64procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
618add_i128procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
622mul_i128procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
626__add_overflowprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
630__mul_overflowprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
634__popcntprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
638__bsfprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
642__bsrprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
649arithmetic_versionprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
653arithmetic_readyprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
657arithmetic_selftestprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.

The table is exhaustive for top-level declarations of the selected kinds. This file declares 84 matching surfaces.

Representative signatures

These signatures are shown in source order so the page keeps the feel of a reference manual, not just a keyword cloud.

  • const PI: f64 = 3.141592653589793 (line 7)
  • const E: f64 = 2.718281828459045 (line 8)
  • const I64_MIN: i64 = 9223372036854775808 (line 10)
  • const I64_MAX: i64 = 9223372036854775807 (line 11)
  • const F64_INF: f64 = 1000000000000000000.0 (line 13)
  • const F64_NAN: f64 = 0.0 (line 14)
  • const RAND_A: i64 = 1664525 (line 16)
  • const RAND_C: i64 = 1013904223 (line 17)
  • const RAND_M: i64 = 2147483647 (line 18)
  • pick SafeResult { (line 20)
  • form I128 { (line 25)
  • proc abs_i64(value: i64) -> i64 { (line 29)
  • proc abs_f64(value: f64) -> f64 { (line 37)
  • proc add_i64(a: i64, b: i64) -> i64 { (line 45)
  • proc sub_i64(a: i64, b: i64) -> i64 { (line 49)
  • proc mul_i64(a: i64, b: i64) -> i64 { (line 53)
  • proc div_i64(a: i64, b: i64) -> i64 { (line 57)
  • proc mod_i64(a: i64, b: i64) -> i64 { (line 65)

The list is intentionally capped here; the source file declares 83 matching signatures in total.

How to use this module

Start by reading the file as an ownership boundary. Ask three questions: what enters this module, what stable types or procedures it exports, and what adjacent module should stay outside of it.

  1. Read space and top-level imports first so the ownership boundary of math/arithmetic.vitl is explicit.
  2. Scan constants before procedures; they often encode precision, limits, or policy assumptions that explain later behavior.
  3. Read declared forms and picks before algorithms so the data vocabulary is stable in your head.
  4. Traverse procedures in source order; the early helpers usually explain the naming and numeric conventions used later.
  5. Use the source landmarks section below as a table of contents when the file is large.

User example

This example is generated from the actual stdlib module surface. Its job is not to be the smallest snippet possible; its job is to show a realistic consumer-shaped file that exercises the module and mirrors the language keywords the module itself relies on.

space demo/math_arithmetic
const SAMPLE_LABEL: string = "demo"
form UserReport {
  label: string,
  ready: bool
}
pick UserOutcome {
  case Ready(message: string)
  case Empty(reason: string)
}
proc run_example() -> UserOutcome {
  let result = abs_i64(1)
  let ready: bool = is_prime(1)
  let failed: bool = false
  let stable: bool = ready and true
  let fallback: bool = ready or false
  let idx: int = 0
  while idx < 1 {
    set idx = idx + 1
  }
  if ready {
    give UserOutcome.Empty("module not ready")
  } else {
    let state: UserOutcome = UserOutcome.Ready("ok")
    match state {
      case UserOutcome.Ready(message) {
        give UserOutcome.Ready(message)
      }
      case UserOutcome.Empty(reason) {
        give UserOutcome.Empty(reason)
      }
    }
  }
  let copies: f64 = 1 as f64
}
export run_example

Keyword coverage

This table makes the “all keywords of the module” requirement auditable. It compares the detected Vitte keywords in the source file with the generated consumer example above.

KeywordPresent in module sourceUsed in generated user example
spaceyesyes
constyesyes
formyesyes
pickyesyes
caseyesyes
procyesyes
letyesyes
setyesyes
ifyesyes
elseyesyes
whileyesyes
matchyesyes
giveyesyes
exportyesyes
trueyesyes
falseyesyes
andyesyes
oryesyes
asyesyes

The generated snippet exercises every detected Vitte keyword used by this module.

Source shape

space vitte/stdlib/math/arithmetic
const PI: f64 = 3.141592653589793
const E: f64 = 2.718281828459045
const I64_MIN: i64 = 9223372036854775808
const I64_MAX: i64 = 9223372036854775807
const F64_INF: f64 = 1000000000000000000.0
const F64_NAN: f64 = 0.0
const RAND_A: i64 = 1664525
const RAND_C: i64 = 1013904223
const RAND_M: i64 = 2147483647

The excerpt is not meant to replace the file. It exists to make the module recognizable at first glance, the same way a Wikipedia infobox helps the reader orient before reading the whole article.

Source landmarks

Large files are easier to retain when they have visible landmarks. When the source contains explicit section banners, they are surfaced here; otherwise the first major declarations are used as anchors.

  • Arithmetic — scalar arithmetic and numeric helpers

Source organization

When a file carries its own internal chaptering, those chapters usually reveal the intended reading order better than a flat symbol list. This section reconstructs that organization from the source itself.

Opening declarations

Top-level items: 1. Procedures: 0. Data surfaces: 0. Constants: 0.

First visible names: vitte/stdlib/math/arithmetic

Arithmetic — scalar arithmetic and numeric helpers

Top-level items: 84. Procedures: 72. Data surfaces: 2. Constants: 9.

First visible names: PI, E, I64_MIN, I64_MAX, F64_INF, F64_NAN, RAND_A, RAND_C, RAND_M, SafeResult

Complete API catalog

This catalog is the exhaustive file-level index for the module. It is intentionally closer to a generated encyclopedia appendix than to a tutorial summary.

Constants

LineNameSignatureRole
7PIconst PI: f64 = 3.141592653589793Defines a named constant reused across the module.
8Econst E: f64 = 2.718281828459045Defines a named constant reused across the module.
10I64_MINconst I64_MIN: i64 = 9223372036854775808Defines a bound or precision constant that shapes runtime behavior.
11I64_MAXconst I64_MAX: i64 = 9223372036854775807Defines a bound or precision constant that shapes runtime behavior.
13F64_INFconst F64_INF: f64 = 1000000000000000000.0Defines a named constant reused across the module.
14F64_NANconst F64_NAN: f64 = 0.0Defines a named constant reused across the module.
16RAND_Aconst RAND_A: i64 = 1664525Defines a named constant reused across the module.
17RAND_Cconst RAND_C: i64 = 1013904223Defines a named constant reused across the module.
18RAND_Mconst RAND_M: i64 = 2147483647Defines a named constant reused across the module.

Data surfaces

LineNameSignatureRole
20SafeResultpick SafeResult {Introduces a tagged variant type used to model distinct outcomes.
25I128form I128 {Introduces a structured data shape that other procedures can exchange.

Procedures

LineNameSignatureRole
29abs_i64proc abs_i64(value: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
37abs_f64proc abs_f64(value: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
45add_i64proc add_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
49sub_i64proc sub_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
53mul_i64proc mul_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
57div_i64proc div_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
65mod_i64proc mod_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
73add_f64proc add_f64(a: f64, b: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
77sub_f64proc sub_f64(a: f64, b: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
81mul_f64proc mul_f64(a: f64, b: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
85div_f64proc div_f64(a: f64, b: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
93max_i64proc max_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
101min_i64proc min_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
109max_f64proc max_f64(a: f64, b: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
117min_f64proc min_f64(a: f64, b: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
125pow_i64proc pow_i64(base: i64, exponent: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
145pow_f64proc pow_f64(base: f64, exponent: i64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
168factproc fact(value: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
182gcdproc gcd(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
195lcmproc lcm(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
206is_primeproc is_prime(value: i64) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
230fibproc fib(index: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
255clamp_i64proc clamp_i64(value: i64, low: i64, high: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
265lerpproc lerp(a: f64, b: f64, t: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
270safe_addproc safe_add(a: i64, b: i64) -> SafeResult {Represents one top-level surface in the file contract and should be read as part of the module boundary.
281safe_mulproc safe_mul(a: i64, b: i64) -> SafeResult {Represents one top-level surface in the file contract and should be read as part of the module boundary.
310and_i64proc and_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
314or_i64proc or_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
318xor_i64proc xor_i64(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
322shlproc shl(value: i64, bits: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
326shrproc shr(value: i64, bits: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
330sign_i64proc sign_i64(value: i64) -> i64 {Implements a security-sensitive transformation in the crypto boundary.
340is_evenproc is_even(value: i64) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
344is_oddproc is_odd(value: i64) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
348popcountproc popcount(value: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
360leading_zerosproc leading_zeros(value: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
379trailing_zerosproc trailing_zeros(value: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
397rotlproc rotl(value: i64, bits: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
408rotrproc rotr(value: i64, bits: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
419saturating_addproc saturating_add(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
434saturating_subproc saturating_sub(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
439div_floorproc div_floor(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
455div_ceilproc div_ceil(a: i64, b: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
471floor_f64proc floor_f64(value: f64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
479ceil_f64proc ceil_f64(value: f64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
487round_f64proc round_f64(value: f64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
496poly_evalproc poly_eval(coeffs: [f64], x: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
506is_nanproc is_nan(value: f64) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
510is_infproc is_inf(value: f64) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
514copysignproc copysign(magnitude: f64, sign_value: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
522exp_f64proc exp_f64(value: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
534log_f64proc log_f64(value: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
541sqrt_f64proc sqrt_f64(value: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
556sin_f64proc sin_f64(value: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
568cos_f64proc cos_f64(value: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
579log10_f64proc log10_f64(value: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
586fabsproc fabs(value: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
590fmodproc fmod(a: f64, b: f64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
600ceilproc ceil(value: f64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
604floorproc floor(value: f64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
608rand_nextproc rand_next(seed: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
614rand_f64proc rand_f64(seed: i64) -> f64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
618add_i128proc add_i128(a: I128, b: I128) -> I128 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
622mul_i128proc mul_i128(a: I128, b: I128) -> I128 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
626__add_overflowproc __add_overflow(a: i64, b: i64) -> SafeResult {Represents one top-level surface in the file contract and should be read as part of the module boundary.
630__mul_overflowproc __mul_overflow(a: i64, b: i64) -> SafeResult {Represents one top-level surface in the file contract and should be read as part of the module boundary.
634__popcntproc __popcnt(value: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
638__bsfproc __bsf(value: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
642__bsrproc __bsr(value: i64) -> i64 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
649arithmetic_versionproc arithmetic_version() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
653arithmetic_readyproc arithmetic_ready() -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
657arithmetic_selftestproc arithmetic_selftest() -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.

Exports

LineNameSignatureRole
690*export *Re-exports surfaces that the module wants to expose as part of its public boundary.

Integration boundaries

Within math, this file should remain focused. If a future helper changes the host boundary, scheduling boundary, or data-shape boundary, it probably belongs in a neighbor module instead of being added here by convenience.

  • Family responsibility: Arithmetic, algebra, comparison, calculus, geometry, modular arithmetic, number theory, probability, statistics, matrix, and vector helpers.
  • Family architecture role: Use `math` when the transformation itself is the feature. This family exists so algorithmic intent stays visible and testable.

Composition guidance

Choose this module when

  • Choose math/arithmetic.vitl when the main question is owned by this module rather than by transport, storage, orchestration, or user-interface code.
  • A scoring engine can compute aggregates in `math` while keeping I/O and transport elsewhere.
  • A statistics or matrix chapter should explain the workflow around the computation, not just a single formula.

Pause before extending it when

  • Avoid extending this file when the new helper mostly changes the boundary to host I/O, runtime coordination, or foreign integration instead of staying inside math.
  • Check nearby modules such as math/algebra.vitl, math/arrays.vitl, math/calculus.vitl before adding convenience wrappers here.

Relationship table

This table keeps the page closer to a real encyclopedia entry: a module is easier to understand when compared with its nearest alternatives in the same family.

NeighborProceduresData surfacesWhy compare it
math/algebra.vitl140Shares the same family boundary but carries a distinct slice of responsibility.
math/arrays.vitl832Shares the same family boundary but carries a distinct slice of responsibility.
math/calculus.vitl563Shares the same family boundary but carries a distinct slice of responsibility.
math/comparison.vitl470Shares the same family boundary but carries a distinct slice of responsibility.
math/complex.vitl490Shares the same family boundary but carries a distinct slice of responsibility.
math/geometry.vitl720Shares the same family boundary but carries a distinct slice of responsibility.
math/logic.vitl200Shares the same family boundary but carries a distinct slice of responsibility.
math/matrix.vitl530Shares the same family boundary but carries a distinct slice of responsibility.

Neighbor modules