fn float_to_int(value: f32) -> i16 {
            if value.is_sign_positive() {
                (value * f32::from(i16::MAX)) as i16
            } else {
                (value.abs() * f32::from(i16::MIN)) as i16
            }
        }
/// Convert an f32 value between -1.0 and 1.0 to full range i16.
Convert an f32 value between -1.0 and 1.0 to full range i16.
Convert an f32 value between - 1 . 0 and 1 . 0 to full range i16 .
fn float_to_int(value: f32) -> i16 {
            if value.is_sign_positive() {
                (value * f32::from(i16::MAX)) as i16
            } else {
                (value.abs() * f32::from(i16::MIN)) as i16
            }
        }
fn float_to_int ( value : f32 ) -> i16 { if value . is_sign_positive ( ) { ( value * f32 :: from ( i16 :: MAX ) ) as i16 } else { ( value . abs ( ) * f32 :: from ( i16 :: MIN ) ) as i16 } }
Convert an f32 value between -1.0 and 1.0 to full range i16.
Convert an f32 value between - 1 . 0 and 1 . 0 to full range i16 .
value
f32
value
f32