[SDL] Flickering and division by zero in Windows
Daniel K. O.
danielko.listas at gmail.com
Sun Feb 25 11:15:25 PST 2007
Tommy Hinks escreveu:
> However, most times trying to actually represent infinity is a bad
> idea.
Indeed, most of the times, both infinity and zero are only useful as
results (that were propagated from some special situation), not as
constants. But infinity is also a very useful sentinel value, that works
no matter what precision or range you are using.
> so in computers. Simply test if a denominator is zero and if so you
> know that it is infinite. Use a bool or something to say that, not the
> largest number you can possibly think of, it will only lead to grief.
>
There are many more ways to obtain infinity. Would you write a somewhat
complex function as a series of tests on numerical stability, or just
wait until the end to see if something blew up (i.e. test for infinity,
zero, nan)?
---
Daniel K. O.
More information about the SDL
mailing list