pub fn clamp_u16(val: f32) -> u16
Clamp a floating-point value to the u16 range [0, 65535].
val
The value clamped to [0, 65535] and cast to u16.