1

How do I initialize number with NaN in Borland C++?

duplicate: Using NaN in C++?

Community
  • 1
  • 1
luvieere
  • 37,065
  • 18
  • 127
  • 179

1 Answers1

7

You can look at std::numeric_limits<double>::quiet_NaN(). Include <limits>.

Carl Seleborg
  • 13,125
  • 11
  • 58
  • 70
  • In the documentation they say "The quiet NaN for type int is: 0"... how can I discriminate between NaN and real 0? – luvieere Oct 05 '09 at 13:45
  • 1
    @luvieere. Check std::numeric_limits::has_quiet_NaN; You will find it is false. while std::numeric_limits::has_quiet_NaN is true – Martin York Oct 05 '09 at 16:09