Simple Fixed-Point Conversion in C

Operating on fixed-point numbers is a common embedded systems task. Our microcontrollers may not have floating-point support, our sensors may provide data in fixed-point formats, or we may want to use fixed-point mathematics control a value's range and precision. There numerous fixed-point mathematics libraries around the internet, such as fixed_point or the Compositional Numeric Library …