
On 28 March 2010 11:59, Chad Nelson <chad.thecomfychair@gmail.com> wrote:
Certainly, in both computer science and mathematics. But by the mathematical definition, infinity isn't a number, it's a representation of an impossible number. So logically, representing it with the not-a-number value is correct.
+Infinity represents the concept of something larger than any specific value you can state, and -Infinity something smaller. So while you could choose to just use NaN in place of the infinities, there are situations in which infinity is reasonable where NaN is not. Imagine a container of intervals, for example -- there, +/- infinity would be very useful for the two outermost endpoints. And something like atan(Infinity) can reasonably give \pi/2, whereas atan(NaN) can only give NaN.