/** * The bare arithmetic of `stdlib.md` section 8.1. * * None of these has a warmup: they read this bar's values only, so each * produces a value on bar 0 whenever its arguments do. Every one is absent when * any argument is absent, and every result goes through `result`, so a value * with no finite real answer is absence rather than an infinity. */ import type { Value } from '../values/index.js'; /** `abs(x)`: magnitude without sign. */ export declare function abs(x: Value): Value; /** `sign(x)`: -1, 0 or 1. */ export declare function sign(x: Value): Value; /** `min(a, b)`: the smaller of two. */ export declare function min(a: Value, b: Value): Value; /** `max(a, b)`: the larger of two. */ export declare function max(a: Value, b: Value): Value; /** `clamp(x, lo, hi)`: `x` held inside a range. */ export declare function clamp(x: Value, lo: Value, hi: Value): Value; /** * `mod(a, b)`: `a - b * floor(a / b)`, the floored remainder, whose sign * follows `b`. * * Written out rather than described because "the modulo" names two different * functions in common use. This is the floored one and the `%` operator is the * truncated one: `mod(-7, 3)` is 2 where `-7 % 3` is -1. The two agree for * every positive `b`, which is every use that wraps an index or a bar count. * `mod(a, 0)` is absent, on the rule that a result with no finite real value is * absent. */ export declare function mod(a: Value, b: Value): Value; /** True when the value is absent. */ export declare function isNone(x: Value): boolean; /** `x` when present, `fallback` when absent. */ export declare function orElse(x: Value, fallback: Value): Value; /** `toBool(x)`: absence to false, a bool to itself. Numbers are a type error. */ export declare function boolOf(x: boolean | null): boolean; //# sourceMappingURL=arithmetic.d.ts.map