// // Math.hpp // amoeba // // Created by Timothy Prepscius on 12/30/16. // Copyright © 2016 Timothy Prepscius. All rights reserved. // #pragma once namespace tjp::core::math { template inline V clamp(const V &v, const L &l, const R &r) { if (v < l) return (V)l; if (v > r) return (V)r; return v; } } // namespace