#include double fclamp(double x, double l, double h) { if (x < l) return l; if (x > h) return h; return x; } float fclampf(float x, float l, float h) { if (x < l) return l; if (x > h) return h; return x; }