std::numeri...gnaling_NaN(3)

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

okay so bestie, welcome to the std::numeri...gnaling_NaN(3) page from the C++ Standard Libary β€” we're here to talk about std::numeric_limits::has_signaling_NaN, and yes the title is giving dramatic ellipsis energy πŸ’…

🌸 NAME 🌸

std::numeric_limits::has_signaling_NaN β€” std::numeric_limits::has_signaling_NaN (she said it twice, and honestly? periodt.)

✨ Synopsis ✨

okay so here's the exact signature situation, no cap:

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

The value of std::numeric_limits<T>::has_signaling_NaN is true for all types T capable of representing the special value "Signaling 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.

πŸŽ€ Standard specializations πŸŽ€

Vibe check for every T β€” the value of std::numeric_limits<T>::has_signaling_NaN is:

  • /* 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 🌈

Other little icons in the same orbit 🫢:

  • 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_quiet_NaN β€” identifies floating-point types that can represent the special value "quiet not-a-number" (NaN); [static] (public static member constant)

and that's the page! source: http://cppreference.com Β· version/date: 2024.06.10 β€” bye bestie, go stan signaling NaNs responsibly πŸ’–βœ¨

πŸ“¦ where this page comes from