>Is there a way to limit the amount of decimal places a floating point 
>equation will calculate out to?  I have an equation that I get -1.#IND 
>as the value of the equation sometimes.  Does anyone know what this 
>means? There are no errors in the formula that is being equated. 
>Please help me out.

This is segment of code I uses (in C++) in one particular instance to avoid
the infinity problems:

  double dTransSpeed = (nNumSequence*2)/fTime;

  // If zero, avoid division
  if (fTime) { 
    dTransSpeed = (nNumSequence*2)/fTime;
    // If result is still within sensible range, proceed.
    // otherwise just skip this calculation as nonsense 
    if (dTransSpeed < 100000) {
      gnNumTimes++;           
      gdAvgTransSpeed += dTransSpeed;
    }
  }

Of course you need to adopt your own code and take sensible steps when your
calculations hits the infinity. What those sensible step are, can only you
as the programmer be qualified to judge about

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to