How do I store NaN in a variable?

Yeah, that would be very interesting to see what that can lead to.

i just showed what it can do

No, BEYOND THAT!

not really. you can use it to filter NaN values out of a list. i just cant see this being useful in any ways

...Well, not to be rude, but just because 1 person thinks something's not useful, doesn't mean it's not useful.

be my guest. if you think of some way this can be useful let me know :slight_smile:

Ok.

I need to set a variable to NaN because I'm doing things that involve... the very fabric of floating point numbers? I don't know how to explain it. What I have now works but takes 2 hours to do what I want it to.

My Blocks script pic (5)

no matter what a NaN will never = another NaN. it is the only value that is not = to itself

Weird.

well if you think about what NaN is it makes sense

...If NaN doesn't equal NaN, does Infinity = Infinity?

yes

...Ok, I thought because of different infinities, that it would be false.

infinity represents a number

Uh-oh.

This behavior took me by surprise. I would have thought that putting something in a variable or not never mattered; I'm always arguing with students who think they have to put some intermediate result in a variable instead of using composition of functions. As @ego-lay_atman-bay points out, we inherit this strange behavior from JS.

its good for testing and logging

Oh, that's good. No yapping about infinities.Huh, never knew that.