I'm coding in C - I've got some speed-critical calculations I'm trying to make on a microcontroller, and I want to find the ratio of the numbers without using floating point variables.
I have a byte between 0 and 255, and I want to find a percent of it.. For example - if I want to find 75% of 'value', I'm using this code.
float x = value * 0.75;
where 'value' is a number between 0 and 255.
Is there some clever bit math I can perform to do this calculation? Is there a way to scale the values up and calculate only using integer divides?