NaN values can take a number of different balues depending on the architecture and how they came to be. This can OOS spuriously.
This does two things:
- make the float/double 'put' functions protected, so they can't be called accidentally from sim code, potentially preventing issues.
- make the script-serializer detect NaN and serialize them specially. I add a boolean for whether the nan is the Number Object or just a primitive number, since that seems more straightforward.