locked
Floating-point invalid operation. RRS feed

  • Question

  • Why is this section of Code causing a Floating point invalid operation?

    double	m_dBufferValue = 0;
    ...................................................
    ...................................................
    
    m_dBufferValue	 =  100 *  (double(lExcess) / double(lBufferDuration));

    Adeel
    Friday, March 12, 2010 12:13 PM

Answers

  • What is the value of lBufferDuration at the moment of exception.
    1. Whiter than the white is UV bright! 2. Eat your vegetables or you are going to turn in to fat dumb asses! 3. Fruits won't cut it 4 wheel drive with levers to lock differentials was a hack
    • Proposed as answer by D3F84U Friday, March 12, 2010 12:49 PM
    • Marked as answer by Wesley Yao Monday, March 15, 2010 5:28 AM
    Friday, March 12, 2010 12:21 PM

All replies

  • What is the value of lBufferDuration at the moment of exception.
    1. Whiter than the white is UV bright! 2. Eat your vegetables or you are going to turn in to fat dumb asses! 3. Fruits won't cut it 4 wheel drive with levers to lock differentials was a hack
    • Proposed as answer by D3F84U Friday, March 12, 2010 12:49 PM
    • Marked as answer by Wesley Yao Monday, March 15, 2010 5:28 AM
    Friday, March 12, 2010 12:21 PM
  • Zero. Thanks in helping me point out, it helped me in correnting it
    m_dBufferValue = ((lExcess == 0)||(lBufferDuration == 0)) ? 0:  100 *  (double(lExcess) / double(lBufferDuration));

    Adeel
    Friday, March 12, 2010 12:48 PM