std::numeri...::has_denorm(3)

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

πŸŽ€ NAME πŸŽ€

okay so bestie, this page is for std::numeric_limits::has_denorm β€” and the NAME line literally says std::numeric_limits::has_denorm β€” std::numeric_limits::has_denorm. yes, the same iconic name twice, no notes. πŸ’…

It lives in the C++ Standard Libary manual, and the page title is that beautifully truncated std::numeri...::has_denorm(3).

✨ Synopsis ✨

the signature is literally this:

          static const std::float_denorm_style has_denorm;      (until C++11)
          static constexpr std::float_denorm_style has_denorm;  (since C++11)
                                                                (deprecated in
       C++23)
⚠️ heads up bestie: it is deprecated in C++23. not me telling you to ignore it, just keeping the vibe check honest. 😭

The value of std::numeric_limits<T>::has_denorm identifies the floating-point types that support subnormal values. that's the whole main-character job, periodt. ✨

πŸ‘‘ Standard specializations πŸ‘‘

here's the lineup, bestie β€” T on the left, value of std::numeric_limits<T>::has_denorm on the right:

  • /* non-specialized */ β†’ std::denorm_absent
  • bool β†’ std::denorm_absent
  • char β†’ std::denorm_absent
  • signed char β†’ std::denorm_absent
  • unsigned char β†’ std::denorm_absent
  • wchar_t β†’ std::denorm_absent
  • char8_t (since C++20) β†’ std::denorm_absent
  • char16_t (since C++11) β†’ std::denorm_absent
  • char32_t (since C++11) β†’ std::denorm_absent
  • short β†’ std::denorm_absent
  • unsigned short β†’ std::denorm_absent
  • int β†’ std::denorm_absent
  • unsigned int β†’ std::denorm_absent
  • long β†’ std::denorm_absent
  • unsigned long β†’ std::denorm_absent
  • long long (since C++11) β†’ std::denorm_absent
  • unsigned long long (since C++11) β†’ std::denorm_absent
  • float β†’ usually std::denorm_present
  • double β†’ usually std::denorm_present
  • long double β†’ usually std::denorm_present

the integer-ish and character-ish girlies are all giving std::denorm_absent, while float, double, and long double are usually std::denorm_present. lowkey iconic. 🌸

🌈 See also 🌈

  • denorm_min [static] β€” returns the smallest positive subnormal value of the given floating-point type (public static member function). 🫢
  • float_denorm_style β€” indicates floating-point denormalization modes (enum). πŸ¦‹

kisses bestie! this cute little page came from http://cppreference.com, version 2024.06.10, and the footer title is std::numeri...::has_denorm(3) β€” periodt. πŸ’–πŸ’…πŸŽ€

πŸ“¦ where this page comes from