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\n",isnormal(1.0));
  printf ("isnormal(0.0)    : %d\n",isnormal(0.0));
  printf ("isnormal(1.0/0.0): %d\n",isnormal(1.0/0.0));
  return 0;
}

输出

isnormal(1.0)    : 1
isnormal(0.0)    : 0
isnormal(1.0/0.0): 0

 

posted @ 2019-05-20 23:43  anobscureretreat  阅读(240)  评论(0编辑  收藏  举报