Does anyone know what NaN means?

Sort:
StickyStick666

CraigIreland

Not A Number. It can occur when you try to divide by zero or take a root of a negative number but in this case it may have occured because the browser is trying to display an uninitialised variable.

tldr: it's a bug.

 

 

 

llama36

Yeah, not a number.

AussieMatey

It means Grandmother. happy.png

Nimzowitsch
CraigIreland wrote:

Not A Number. It can occur when you try to divide by zero or take a root of a negative number but in this case it may have occured because the browser is trying to display an uninitialised variable.

tldr: it's a bug.

 

 

 

The root of a negative number is some multiple of i, which is a number, just an imaginary one.

CraigIreland

You're correct but NaN is stored in a floating point register, which is a representation of what we call a real number in mathematics. Floating point arithmetic doesn't support imaginary or complex numbers so when a complex number would arise from an operation we store a special bit pattern to denote it, called NaN. In hindsight it would've been better denoted as NaR for Not a Real, but it has been standardised as NaN for about 40 years.

 

 

 

Nimzowitsch

On my Ti-84, when I do sqrt(-1), it says error, even though i is an option on that calculator.

I think it does that. I can't remember 100%.

llama36

I... don't think the engine is generating an imaginary number tongue.png

I assume something (or nothing) is being passed to a function that is expecting a number, but can't parse it as a number, so it throws an error, which has been coded to produce NaN.