modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.c (about)

     1  #include <math.h>
     2  
     3  static const double zero =  0.0;
     4  static const double pone =  1.0;
     5  static const double none = -1.0;
     6  static const double pinf =  1.0 / 0.0;
     7  static const double ninf = -1.0 / 0.0;
     8  
     9  int
    10  main ()
    11  {
    12    if (pinf != pone/zero)
    13      abort ();
    14  
    15    if (ninf != none/zero)
    16      abort ();
    17  
    18  #ifdef HUGE_VAL
    19    if (HUGE_VAL != pinf)
    20      abort ();
    21  
    22    if (-HUGE_VAL != ninf)
    23      abort ();
    24  #endif
    25  
    26    exit (0);
    27  }