Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::numeric_limits<T>::has_denorm_loss

      From cppreference.com
      <cpp‎ |types‎ |numeric limits
       
       
      Utilities library
       
       
      std::numeric_limits
      Static constants
      numeric_limits::has_denorm_loss
      Static member functions
      Helper types
       
      staticconstbool has_denorm_loss;
      (until C++11)
      staticconstexprbool has_denorm_loss;
      (since C++11)
      (deprecated in C++23)

      The value ofstd::numeric_limits<T>::has_denorm_loss istrue for all floating-point typesT that detect loss of precision when creating a subnormal number as denormalization loss rather than as inexact result (see below).

      Contents

      [edit]Standard specializations

      T value ofstd::numeric_limits<T>::has_denorm_loss
      /* non-specialized */false
      boolfalse
      charfalse
      signedcharfalse
      unsignedcharfalse
      wchar_tfalse
      char8_t(since C++20)false
      char16_t(since C++11)false
      char32_t(since C++11)false
      shortfalse
      unsignedshortfalse
      intfalse
      unsignedintfalse
      longfalse
      unsignedlongfalse
      longlong(since C++11)false
      unsignedlonglong(since C++11)false
      float implementation-defined
      double implementation-defined
      longdouble implementation-defined

      [edit]Notes

      Standard-compliant IEEE 754 floating-point implementations of subnormal numbers are required to detect the loss of accuracy associated with the creation of such number, if it occurs, and may do so in one of the two distinct ways:

      1. Denormalization loss: the delivered result differs from what would have been computed were exponent range unbounded.
      2. Inexact result: the delivered result differs from what would have been computed were both exponent range and precision unbounded.

      No implementation of denormalization loss mechanism exists (accuracy loss is detected after rounding, as inexact result), and this option was removed in the 2008 revision of IEEE Std 754.

      libstdc++, libc++, libCstd, and stlport4 define this constant asfalse for all floating-point types. Microsoft Visual Studio defines it astrue for all floating-point types.

      As with any floating-point computations, accuracy loss may raiseFE_INEXACT.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      identifies floating-point types that detect tinyness before rounding
      (public static member constant)[edit]
      [static]
      identifies the denormalization style used by the floating-point type
      (public static member constant)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/types/numeric_limits/has_denorm_loss&oldid=149597"

      [8]ページ先頭

      ©2009-2025 Movatter.jp