c isnormal

Returns whether x is a normal value: i.e., whether it is neither infinityNaNzero or subnormal.

/* isnormal example */
#include <stdio.h>      /* printf */
#include <math.h>       /* isnormal */

int main()
{
  printf ("isnormal(1.0)    : %d
",isnormal(1.0));
  printf ("isnormal(0.0)    : %d
",isnormal(0.0));
  printf ("isnormal(1.0/0.0): %d
",isnormal(1.0/0.0));
  return 0;
}

输出

isnormal(1.0)    : 1
isnormal(0.0)    : 0
isnormal(1.0/0.0): 0
原文地址:https://www.cnblogs.com/sea-stream/p/10897362.html