I have been playing for about a year now with MaxMSP and I decided I wanted to try to star writing externals. I have been doing installations with patches that communicated over network. Some of the patches sometimes generate nan. So want to write an external that can replace nan from any kind of input: int, float, list, matrices... with the last input value or replace it with a value specified by an argument at the object creation.
To see what is a nan in MaxMSP I wrote this external taking a list as input and posting the value and type of the members of the atom to the max window. I was surprise to see that the atom corresponding in the list where I introduced the nan by dividing a float by 0. was a float type whit the value nan.
Now if this is the form of a atom:
typedef struct atom
union word a_w;
how can you put in w_float the value nan???
I am running a MBP whit osX 10.4.9 MaxMSP 4.6 and the SDK UB 4.6.