Topic : RIDE / RC51 quits on floating point divide by zero.

Forum : 8051

Original Post
Post Information Post
May 20, 2007 - 1:59am
Guest

This code forces RIDE to quit.

printf( " fits: ledI %3.1f mA %d pleth %3.1f mV %d redRaw %d tightest %d\r\n",
(float)ledI / _IU_LedI_mA,
servoVFit,
(float)plethSize / (1/10), <------------- quits because of this
plethFit,
(float)photoSigSize / _IU_Raw_volts,
photoFit,
tightestFit
);

Avoiding the divide by zero fixes the problem e.g

(float)plethSize / ((float)1/10), <------------- Now compiles fine

The expression certainly isn't legal, but why the unannounced quit.

regards Steven Pruzina

Replies
Post Information Post
+1
0
-1
May 21, 2007 - 11:50am
Raisonance Support Team

Bug fixed.
We'll send you a patch ASAP.

Stéphane