[Clam-devel] AudioFileMemoryLoader patch

Pawel Bartkiewicz tuuresairon at gmail.com
Fri Jun 20 12:16:35 PDT 2008


> +         if (currentPosition != _lastPosition) {
>
> the problem lies in the fact that in C and C++ the equality of floating
> points variables is not guaranteed, because they "approximate" the real
> results, and the float representation of the approximations might be
> different.
> using delta is safer.

I know, but there's no arithmetic, only value copying. I'm not sure,
but I think that such operations shouldn't change the value of floats.
Otherwise it would mean that the bits get corrupted when they are
loaded/saved from memory, which would be catastrophic for computing ;)
But maybe comparison of floats is performed in some strange way by the
processor. I haven't checked that on such a low level so I'm not 100%
certain.
Anyway, using delta shouldn't affect performance significantly and I
agree that it's safer, so no problem. That's why I sent two patches.


More information about the clam-devel mailing list