#pragma once
// clamp01 — the ONE unit-interval clamp, replacing several per-module static
// copies. Deliberately the ternary form: comparisons with NaN are false, so a NaN
// input passes through unchanged rather than silently collapsing to a bound — the
// behavior most of the retired copies already had.

namespace reasampler::util {

constexpr double clamp01(double v) { return v < 0.0 ? 0.0 : (v > 1.0 ? 1.0 : v); }

}  // namespace reasampler::util
