What is the difference between IND and NAN

NAN means Not A Number, and IND means an indefinite number. But what is the difference between the two. As we can imagine, both in C ++.

+5
source share
2 answers

But what is the difference between the two.

They are both the same. Some platforms prefer not to display the number as some option NaN, while others prefer to display it as some option IND.

As we can imagine, both in C ++.

std::numeric_limits<double>::quiet_NaN()(or floator long doubleif you want).

+5
source

, double, 1.#INF Windows inf Linux

, , . sqrt(-1.0) log(-1.0) NaN, "", " " ".

Windows NaN -1.#IND ( "IND" "" ), Linux nan. , nan, 0/0, 0 * ∞ ∞/∞.

Refernce Link1

Refernce Link2

+2

All Articles