AnsweredAssumed Answered

Floating point multiply or integer divide?

Question asked by JWellbelove on Sep 13, 2012
Latest reply on Sep 14, 2012 by AndyK2

A Blackfin overview document says that a floating point multiply is preferable (faster) to an integer divide.

 

float recip_NUM_SAMPS = 1.0 / NUM_SAMPS;

int x = sum * recip_NUM_SAMPS;

 

as opposed to

 

int x = sum / recip_NUM_SAMPS;

 

Is this correct?

Outcomes