博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C ++中带有示例的nanl()函数
阅读量:2543 次
发布时间:2019-05-11

本文共 1478 字,大约阅读时间需要 4 分钟。

C ++ Nanl()函数 (C++ nanl() function)

nanl() function is a library function of cmath header, it is used to get the NaN value of type long double. It accepts an argument (which is an implementation-specific C String – to get NaN value we have to pass an empty string), it returns NaN value of type long double.

nanl()函数cmath标头的库函数,用于获取long double类型的NaN值。 它接受一个参数(这是特定于实现的C字符串-要获取NaN值,我们必须传递一个空字符串),它返回long double类型的NaN值。

Not-A-Number (NaN) values are used to check whether the value is an unidentified/non-representable or not? For example, the square root of a negative number is unidentified.

非数字(NaN)值用于检查该值是否为未识别/不可代表? 例如,负数的平方根不确定。

Syntax of nanl() function:

nanl()函数的语法:

C++11:

C ++ 11:

long double nanl (const char* tagp);

Parameter(s):

参数:

  • tagp – represents an implementation-specific C-String.

    tagp –表示特定于实现的C-String。

Return value:

返回值:

The return type of this method is long double, it returns NaN value.

此方法的返回类型为long double ,它返回NaN值。

Example:

例:

Function call:    nanl("");            Output:    nan

C ++代码演示nanl()函数的示例 (C++ code to demonstrate the example of nanl() function)

// C++ code to demonstrate the example of// nanl() function#include 
#include
using namespace std;// main() sectionint main(){ float nanValue; //generating generic NaN value //by passing an empty string nanValue = nanl(""); //printing the value cout << "nanValue: " << nanValue << endl; return 0;}

Output

输出量

nanValue: nan

Reference:

参考:

翻译自:

转载地址:http://qcvzd.baihongyu.com/

你可能感兴趣的文章
jQueru中数据交换格式XML和JSON对比
查看>>
form表单序列化后的数据转json对象
查看>>
[PYTHON]一个简单的单元測试框架
查看>>
iOS开发网络篇—XML数据的解析
查看>>
[BZOJ4303]数列
查看>>
数据库TCPIP协议开了,但还是远程连不上
查看>>
一般处理程序在VS2012中打开问题
查看>>
C语言中的++和--
查看>>
thinkphp3.2.3入口文件详解
查看>>
POJ 1141 Brackets Sequence
查看>>
Ubuntu 18.04 root 使用ssh密钥远程登陆
查看>>
linux 单机跨进程通信
查看>>
Servlet和JSP的异同。
查看>>
虚拟机centOs Linux与Windows之间的文件传输
查看>>
ethereum(以太坊)(二)--合约中属性和行为的访问权限
查看>>
IOS内存管理
查看>>
监听系统键盘的方法
查看>>
Mysql两个引擎对比
查看>>
测试书籍推荐
查看>>
php魔术方法
查看>>