Skip to main content

clamp_u16

Function clamp_u16 

Source
pub fn clamp_u16(val: f32) -> u16
Expand description

Clamp a floating-point value to the u16 range [0, 65535].

§Arguments

  • val - The value to clamp

§Returns

The value clamped to [0, 65535] and cast to u16.