AllMround
AllMround is a numeric utility function designed to round every element of a numeric collection to the nearest multiple of a specified base. It is used in data processing, numerical analysis, and grid-based computations to align values to a common spacing.
Definition: Given a numeric collection x and a nonzero real base b, AllMround(x, b) returns a collection
Behavior: The base b may be positive or negative; the set of multiples is the same either
Example: AllMround([0.3, 0.7, 1.2, -0.4], 0.5) yields [0.5, 0.5, 1.0, -0.5].
Implementation notes: In pseudocode, y = [b * Round(a / b) for a in x]. In many languages, this
Applications: Common uses include preparing data for histogram binning, aligning measurements to a grid for visualization,
See also: Round, grid snapping, rounding to multiples.
---