Hi,

I was wondering about QwtScaleArithmetic::divideEps method (and all other *-Eps-methods), like in the code below:

Qt Code:
  1. static const double _eps = 1.0e-6;
  2.  
  3. double QwtScaleArithmetic::divideEps( double intervalSize, double numSteps )
  4. {
  5. if ( numSteps == 0.0 || intervalSize == 0.0 )
  6. return 0.0;
  7.  
  8. return ( intervalSize - ( _eps * intervalSize ) ) / numSteps;
  9. }
To copy to clipboard, switch view to plain text mode 

What is the reason for subtracting a scaled epsilon before dividing? I assume it has something to do with rounding, rounding errors, or the imprecision of floating point math. Maybe someone can give an example were this actually matters?
Or is this code used for a totally different reason?

Best regards.