Why are the return values of these doubles -1.#IND?

As Frederic says, it’s the result of a ‘Not a Number‘ being formatted by an application built with visual studio on windows. John D Cook has an excellent reference:

Windows displays a NaN as -1.#IND (“IND” for “indeterminate”) while Linux displays nan.

In short, if you get 1.#INF or inf, look for overflow or division by zero. If you get 1.#IND or nan, look for illegal operations.

Watch out for truncations if you do any sort of formatting with your string; I’ve encountered related issues when handling these sorts of errors myself.

Leave a Comment