[quote user="Bruce McKenney47378"]Avoid floating point by using scaled arithmetic or 32-bit integers (or fixed point).[/quote]Given that the Cortex-M4F in a MSP432 contains hardware single precision support, then if the calculations can be performed using single precision then less of a reason to change the code to using scaled arithmetic. Suggest that it depends on the code size, execution time and ease of implementation about if single precision floating point .vs. scaled arithmetic is appropriate. [quote user="Michael Cheng"]The floating point number varies in precision and needs to stay that way. Would writing a specialized function be warranted? [/quote]The floating point arguments to sprintf and related functions are double precision. If your floating point numbers only require single precision then a specialized function can reduce the code size / execution time by not having to support double precision.
↧