Continuing the discussion from Just some blocks! (Part 1) - #256 by redgeographysnap.
Previous discussions:
Continuing the discussion from Just some blocks! (Part 1) - #256 by redgeographysnap.
Previous discussions:
Sorry, I thought SNAP! coerced NaN into the string “NaN”

Just as the character string “123” isn’t the internal representation of the number one hundred twenty-three, the string “NaN” isn’t the internal representation of a floating point NaN.
Oh, right. I remember reading about that in the FAQ about decimal to binary.
It’s just that (for me), if

is true, then
![]()
should also be true (although it isn’t)
You make a good argument, except that the floating point standard specifies that NaN is never equal to anything, not even itself. :~/
Right, I remember that from JavaScript!
Although this would start to get confusing if
![]()
returned false. Maybe we need an isNaN operator?
and maybe also NaN support for variables
What do you mean by that? Any value can be the value of a variable, so why do variables need special support for NaN?
Because NaN is not equal to NaN, you can check whether something is NaN by checking if it isn’t equal to itself.
You can’t actually set a variable to (the floating point) NaN.

Oh. That’s a bug; I made a github issue for it.
new blocks
I get that, but then

Which could get confusing. In SNAP!, strings that look like numbers are treated like numbers!
New block’s (mostly just for the pen)!
btw here’s the link if you haven’t just some blocks by cybercube | Snap! Build Your Own Blocks
??? Why’d you tag me?
sorry ![]()
new blocks
No it’s fine. I’m just asking :)