std::numeri...s_quiet_NaN(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ NAME πŸŽ€

okay so this page is std::numeric_limits::has_quiet_NaN - std::numeric_limits::has_quiet_NaN, yes literally twice, that’s the original NAME line and we’re keeping the whole vibe. It’s from the C++ Standard Libary manual, section 3, and it’s here to tell you whether a type can represent a quiet NaN. πŸ’…


✨ Synopsis ✨

static const bool has_quiet_NaN;      (until C++11)
static constexpr bool has_quiet_NaN;  (since C++11)

The value of std::numeric_limits<T>::has_quiet_NaN is true for all types T capable of representing the special value "Quiet Not-A-Number". This constant is meaningful for all floating-point types and is guaranteed to be true if std::numeric_limits<T>::is_iec559 == true. no cap, that’s the whole rule πŸ¦‹


πŸ’– Standard specializations πŸ’–

here’s the full value check for std::numeric_limits<T>::has_quiet_NaN β€” every single row, bestie, no skips:

  • /* non-specialized */ β€” false
  • bool β€” false
  • char β€” false
  • signed char β€” false
  • unsigned char β€” false
  • wchar_t β€” false
  • char8_t (since C++20) β€” false
  • char16_t (since C++11) β€” false
  • char32_t (since C++11) β€” false
  • short β€” false
  • unsigned short β€” false
  • int β€” false
  • unsigned int β€” false
  • long β€” false
  • unsigned long β€” false
  • long long (since C++11) β€” false
  • unsigned long long (since C++11) β€” false
  • float β€” usually true
  • double β€” usually true
  • long double β€” usually true

πŸ¦‹ See also πŸ¦‹

  • quiet_NaN β€” returns a quiet NaN value of the given floating-point type; [static] (public static member function)
  • has_infinity β€” identifies floating-point types that can represent the special value "positive infinity"; [static] (public static member constant)
  • has_signaling_NaN β€” identifies floating-point types that can represent the special value "signaling not-a-number" (NaN); [static] (public static member constant)

xoxo, bestie πŸ’– this page came from cppreference.com, version/date 2024.06.10. go check those NaNs, ily! 🧚✨

πŸ“¦ where this page comes from