Stdlib module math/comparison.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.
math/comparison.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
| Field | Value |
|---|---|
| Path | math/comparison.vitl |
| Family | math |
| Kind | public stdlib surface |
| Line count | 74 |
| Declared procedures | 47 |
| Declared forms/picks | 0 |
`math/comparison.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.
Top-level API inventory
| Surface | Items |
|---|---|
| Procedures | eq, lt, gt, is_nan, is_inf, min, max, clamp, abs, sign, between, in_range |
| Forms | none declared at top level |
| Picks | none declared at top level |
| Constants | EPS |
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.
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.
- Open the family page first to understand why this area of the stdlib exists.
- Read the source excerpt below to see the namespace, imports, and first declared surfaces.
- Check the neighbor list to avoid coupling this module with an adjacent responsibility by habit.
Source shape
space vitte/stdlib/math/comparison
const EPS: f64 = 0.000001
proc eq(a: int, b: int) -> bool { give a == b }
proc lt(a: int, b: int) -> bool { give a < b }
proc gt(a: int, b: int) -> bool { give a > b }
proc is_nan(value: f64) -> bool { give false }
proc is_inf(value: f64) -> bool { give value > 1000000000000000000.0 or value < 0.0 - 1000000000000000000.0 }
proc min(a: int, b: int) -> int { if a < b { give a } give b }
proc max(a: int, b: int) -> int { if a > b { give a } give b }
proc clamp(value: int, low: int, high: int) -> int { if value < low { give low } if value > high { give high } give value }
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.
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.