NaN vs. Inf

 Respuesta aceptada

Image Analyst
Image Analyst el 31 de Dic. de 2011

2 votos

1/0 is infinity, but 0/0 is not infinity nor is it zero - it's just undefined (NaN).

1 comentario

Matt Tearle
Matt Tearle el 31 de Dic. de 2011
And if you want to know *why*, think in terms of limits. lim_{x->0} 1/x = infinity. But lim_{x->0} x^2/x = 0, lim_{x->0} x/x = 1, and lim_{x_>0} x/x^2 = infinity. So there's no way to determine what a "0/0" limit might be. Hence, it's undefined (NaN).
Similarly, Inf + Inf = Inf, but Inf - Inf = NaN.

Iniciar sesión para comentar.

Más respuestas (2)

Categorías

Más información sobre Detection, Range and Doppler Estimation en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by