/* isfinite example */
#include <stdio.h>      /* printf */
#include <math.h>       /* isfinite, sqrt */

int main()
{
  printf ("isfinite(0.0)       : %d\n",isfinite(0.0));
  printf ("isfinite(1.0/0.0)   : %d\n",isfinite(1.0/0.0));
  printf ("isfinite(-1.0/0.0)  : %d\n",isfinite(-1.0/0.0));
  printf ("isfinite(sqrt(-1.0)): %d\n",isfinite(sqrt(-1.0)));
  return 0;
}

输出

isfinite(0.0)       : 1
isfinite(1.0/0.0)   : 0
isfinite(-1.0/0.0)  : 0
isfinite(sqrt(-1.0)): 0

 

相关文章:

  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-17
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
  • 2021-12-16
相关资源
相似解决方案