public static float Clamp(this float v, float min, float max) => v < min ? min : v > max ? max : v; public static double Clamp(this double v, double min, double max) => v < min ? min : v > max ? max : v;