|
|
"Mikael Carneholm" <mik### [at] idautbhbse>
wrote in message news:3C5### [at] idautbhbse...
> Thorsten Froehlich wrote:
>
> >
> > Floating-point numbers are not precise. You should never assume they
are.
> >
>
> That's not a problem.
But the differences are so minute, it might be. If you're comparing floats,
you should compare them within a small range, for instance,
if (fabs(a-b) < 0.001)
rather than
if (a == b)
Or something along those lines.
(Sorry, I've been using c++ lately, so the POV SDL equiv escapes my mind,
but it's not too different).
...Chambers
Post a reply to this message
|
|