Re: [AD] compare ALLEGRO_COLOR with memcmp

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 6 Jun 2011, at 20:58 , Trent Gamblin wrote:
> Floating point calculations are standardized. Unless you change CPU/FPU settings, they're guaranteed to produce the same results.

Yes, and the exact same code (the same binary) should produce identical results when run on different computers. Except there are cases where it doesn't, which is amusing (or not).
Again, I've only seen that happen in code that does very intense numerical calculations (this particular example was due to minor differences in the way results were rounded by the CPU, but these rounding errors will propagate in a code like that and cause a cosmetic difference in the output). We're not likely to run into that with this piece of code in Allegro, so changing it is perhaps a little bit paranoid. I don't think it would be bad to change it, but there is I reason I didn't do it myself before (and it's not that I didn't see the code).

Evert



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/