I am getting incorrect results with division when using -ffast-math. Here is what I have to work with:
Code:
int64_t duration;
int64_t time_units;
double frame_rate;
int64_t frame_count;
//get frame count
frame_count = ((double)duration/(double)time_units) * (double)frame_rate;
This works great as long as -ffast-math isn't enabled.
Is there another way I can calculate frame_count that uses only integers? Perhaps multiplying everything by 1000 (to increase precision) and then do the calculations using integers?