C ++-23 numeric_limits :: max () AnwendungsfallC++

Programme in C++. Entwicklerforum
Anonymous
 C ++-23 numeric_limits :: max () Anwendungsfall

Post by Anonymous »

Befolgen Sie die Diskussion in C ++ Long Double (128-Bit) Genauigkeit, was ist der Anwendungsfall von numeric_limits :: max () ? Wie kann ich dieser Konstante vertrauen, beispielsweise bei der Überprüfung des Bereichs/Überlauffehlers?

Code: Select all

    feclearexcept(FE_INEXACT);
long double ld = 1.0L;
for (size_t i = 2; ld < numeric_limits::max(); i++)
{
long double ld1 = ld * i;
if (fetestexcept(FE_INEXACT))
{
cout

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post