mike smith

floating point in mamba

Discussion created by mike smith on Aug 25, 2011
Latest reply on Aug 26, 2011 by TomE

I am using mpc5674 mamba, and noticed there is no exception happens when dividing by 0:

 

int i=0;

  i=1/i

 

The result of above code is i=0x7fffffff, and no exception.

From assemble code, compiler uses divw for the division. divw does not update overflow flow.

 

If I expect to have exception for dividing by 0, what should I configure to enable this exception? or what kind of compiling option should be used to guarantee this exception?

 

Thanks,

Outcomes