3 ms·
1. a==a is false for NaN, so it's not quite "Ever" 2. The compiler does not know this is undefined behavior. Dereferencing a pointer that has been previously p
by ridiculous_fish 12y ago
1. a==a is false for NaN, so it's not quite "Ever"
2. The compiler does not know this is undefined behavior. Dereferencing a pointer that has been previously passed to realloc is not necessarily undefined behavior. realloc may fail and return NULL; in that case the passed-in pointer remains valid.
- tarpherder 12y agoJust a note: "a==a is false for NaN" is only true if compiled with precise or strict floating point mode. It will return true in fast mode, which is often what is used. Do not rely on this behavior for checking NaNs, use isnan instead.