Skip to main content

from_fixed

Function from_fixed 

Source
pub fn from_fixed(x: Fixed) -> f32
Expand description

Converts a Q15 fixed-point value to a float.

§Input

  • x: A Fixed value in Q15 format

§Output

A floating-point value representing the input (approximately in [-1.0, 1.0])

§Example

use fixed_math_taylor::from_fixed;

let f = from_fixed(32767);
assert!((f - 1.0).abs() < 0.001); // Close to 1.0