C++教程
C++控制语句
C++函数
C++数组
C++指针
C++对象
C++继承
C++多态
C++抽象
C++常用
C++ STL教程
C++迭代器
C++程序

C++ Math isnormal()

C++ Math isnormal()

该函数确定给定数字是否正常。如果数字是正常的,则返回1,否则返回0。

语法

假设数字为'x'。语法为:
bool  isnormal(float x);
bool  isnormal(double x);
bool  isnormal(long double x);
bool  isnormal(integral x);

参数

x : 它是浮点值。

返回值

参数(x) 返回值
无限 0
正常值 1
非正常值 0
不是数字 0

示例1

让我们看一下简单的示例。
#include <iostream>
#include<math.h>
using namespace std;
int main()
{
   std::cout << "isnormal(5) is : " <<isnormal(5)<< std::endl;
   std::cout << "isnormal(5.0/0.0) is : " <<isnormal(5.0/0.0)<< std::endl;
   std::cout << "isnormal(0.0/0.0) is : " <<isnormal(0.0/0.0)<< std::endl;
   return 0;
}
输出:
isnormal(5) is : 1
isnormal(5.0/0.0) is : 0
isnormal(0.0/0.0) is : 0

昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4