How do I store NaN in a variable?

I've been trying to store NaN (not a number) in a variable but it sets it to 0 instead. Right now I have a workaround but it's slow. Is there something else I can do?

My project is at Snap! Build Your Own Blocks (sorry in advance)

Edit: Using a list of length 1 does not work

This worked for me.
This worked for me.

first of all, you need to reify the variable every time you see [scratchblocks](call (aaaaa) ​@addInput :: control) [/scratchblocks] in the because calling a number (e.g.

) does not make sense.

Also,

Why do you want to store NaN in a variable? There may be a better way to do what you're trying to do with NaN.

Why are you guys making this so complicated?
Untitled script pic (4)

It works at first glance, however it's actually set to 0. The variable watcher still displays NaN, but the block of the variable itself reports 0.

why cant you just set the variable to "NaN"

untitled script pic (4)

literally just text

Technically it's not. NaN is a special type of value, not a string.
1000405982

untitled script pic (5)
its an error not a value

Yup, so there's absolutely no reason to ever store NaN in a variable, because you cannot do anything with it.


Heck, even if you set it to a variable, you can't compare it to itself.

there should never be a reason

NaN is useless unless you wanna make a math library which contains every special value

why would that help

Maybe for stuff Bignums can't do? IDK.

i am sorry for being wrong. this is very possible
My Blocks script pic (4)

Ok, but when I said

that was for

idk, probably catching bugs (like when a math equation goes wrong)

solved

but now we can exploit this. NaN is the only value that is not = to itself