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

int main()
{
  printf ("isinf(0.0)       : %d\n",isinf(0.0));
  printf ("isinf(1.0/0.0)   : %d\n",isinf(1.0/0.0));
  printf ("isinf(-1.0/0.0)  : %d\n",isinf(-1.0/0.0));
  printf ("isinf(sqrt(-1.0)): %d\n",isinf(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

 

相关文章:

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