Can we change this as follows
return (uint8_t) ((double)(bps/speed_bps) * 100)
It is required that the result of (bps/speed_bps) be converted to double for more accurate results.