For custom blocks. Make sure that it doesn't think it's equal to 0.
I think you're in the wrong category to be issuing demands like this.
But still, how can you detect if something's equal to NaN?
I didn't take this as asking for a Snap! feature, just for help in testing for NaN (presumably because his attempt failed with respect to zeros?).
Maybe this would help? :
It's for a custom block I'm making with a text input.
On the basis of
I've come up with this
That didn't work.
Can you post an example of what didn't work?
Not even a screenshot?
Try this variation instead then
I need a text input for the custom block.
Can you explain a bit more please?
Can you show your code for your custom block?
script variables ((x) :: grey) :: grey
set [x v] to (... :: grey)
report <not <(x) = (x)>> :: control cap
That doesn't seem to work for me - have you actually got it to detect the difference between NaN and a valid result?
That shouldn't happen...
NaN shouldn't be equal to
I'm not quite understanding what your code is supposed to do.
The OP just wants to be able to detect when something returns NaN
[scratchblocks]<((0) / (0)) = ((0) / (0))>[/scratchblocks] 0/0 is NaN.
= block short-circuits to true if the same variable is put on both sides.
Sorry - I thought you had a simple solution to the OPs problem but I see your having a CS discussion