std::numeri...round_error(3)

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

πŸ’– NAME πŸ’–

std::numeric_limits::round_error β€” std::numeric_limits::round_error. Yes, bestie, it's literally the same name twice, and this is the page for it in the C++ Standard Libary manual. It's giving extremely specific numeric-limits main-character energy, and we are covering every single crumb. 🫢✨


✨ Synopsis ✨

okay so the signatures are right here, exactly as written:

static T round_error() throw();             (until C++11)
static constexpr T round_error() noexcept;  (since C++11)

It returns the largest possible rounding error in ULPs (units in the last place) as defined by ISO 10967, which can vary from 0.5 (rounding to the nearest digit) to 1.0 (rounding to zero or to infinity). It is only meaningful if std::numeric_limits<T>::is_integer == false. πŸ’…


πŸŽ€ Return value πŸŽ€

The return value type is T. And std::numeric_limits<T>::round_error() hits like this:

  • /* non-specialized */ β†’ T()
  • bool β†’ false
  • char β†’ 0
  • signed char β†’ 0
  • unsigned char β†’ 0
  • wchar_t β†’ 0
  • char8_t (since C++20) β†’ 0
  • char16_t (since C++11) β†’ 0
  • char32_t (since C++11) β†’ 0
  • short β†’ 0
  • unsigned short β†’ 0
  • int β†’ 0
  • unsigned int β†’ 0
  • long β†’ 0
  • unsigned long β†’ 0
  • long long (since C++11) β†’ 0
  • unsigned long long (since C++11) β†’ 0
  • float β†’ 0.5F
  • double β†’ 0.5
  • long double β†’ 0.5L

πŸ¦‹ See also πŸ¦‹

  • round_style identifies the rounding style used by the type β€” [static] (public static member constant) ⭐

That's the whole page, bestie! Cute little source/version sign-off: http://cppreference.com, date stamp 2024.06.10. Periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from