The default value is to let the NaN "pollute" whatever calculation it is involved in. For example,
is nan. Any arithmetic operation involving NaN and floating point numbers will result in NaN (if the integer classes are involved the answer is weirder.) Logically any comparison involving nan is false except for ~= which is defined as true even if both values are nan. This can have unexpected effects in the calculations that depend on exactly how the calculation is code.
A min() involving nan will only result in nan if all of the values are nan, so a particle with nan will not be detected as the best value. On the other hand its updated position could become nan, potentially the positions of other particles could become nan if some kind of consensus were being used, and so on. Depending on the coding, it might get replaced by a better result and have no further effect, or it might just be unproductive, or it might poison the calculations and mess up other particles.
Best Answer