Range
Generated from the engine's own definition: compute-engine's symbol, which we neither extend nor document by hand.
A sequence of numbers from a start to an end value with an optional step.
RangeWolfram LanguageRange✓Range(number, number?, step: number?) -> indexed_collection<number>as compute-engine declares itTyped signatures
| Type | Package | Applies |
|---|---|---|
(number, number?, step: number?) -> list<number> | compute-engine | always |
Examples
Scope #
A rational step materializes exact thirds, not floating-point approximations
live ↗Known value · Range(a, b, s): each element is a + k*s, exact over ℚ
Same for a rational step that lands on integers partway through
live ↗Known value · Range(a, b, s): each element is a + k*s, exact over ℚ
Properties #
At reaches the same exact element, not the double it would round to
live ↗Known value · Range(a, b, s): each element is a + k*s, exact over ℚ
The element count is exact too, not a floor of a rounded quotient
live ↗Known value · Range(a, b, s): the grid runs from a to the last multiple of s at or before b
About
| Examples | 13 |
|---|---|
| Checked against | Wolfram Language 13 agreemathlib4 6 agree6 error |
| Crosswalk | FungrimWolfram Language |
Implementation
mathlib4packages/oracle/src/mappings.tsinclusive, counting down when the start is past the end; integer endpoints only (a rational endpoint fails to elaborate rather than rounding), read as rationals like the lane's lists
mathlib4packages/oracle/src/mappings.tsstops before an end the step misses; empty when the step is 0 or points away from the end; integer endpoints and step only (a rational or decimal one fails to elaborate rather than rounding)
mathlib4packages/oracle/src/mappings.tsRange(n) is Range(1, n), so it counts down from 1 when n is below 1; an integer n only