nanf flash校验
C ++ Nanf()函数 (C++ nanf() function)
nanf() function is a library function of cmath header, it is used to get the NaN value of type float. 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 float.
nanf()函数是cmath标头的库函数,用于获取float类型的NaN值。 它接受一个参数(它是特定于实现的C字符串-要获取NaN值,我们必须传递一个空字符串),它返回float类型的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 nanf() function:
nanf()函数的语法:
C++11:
C ++ 11:
float nanf (const char* tagp);
讯享网
Parameter(s):
参数:
- tagp – represents an implementation-specific C-String.
tagp –表示特定于实现的C-String。
Return value:
返回值:
The return type of this method is float, it returns NaN value.
此方法的返回类型为float ,它返回NaN值。
Example:
例:
讯享网 Function call: nanf(""); Output: nan
C ++代码演示nanf()函数的示例 (C++ code to demonstrate the example of nanf() function)
// C++ code to demonstrate the example of // nanf() function #include <iostream> #include <cmath> using namespace std; // main() section int main() { float nanValue; //generating generic NaN value //by passing an empty string nanValue = nanf(""); //printing the value cout << "nanValue: " << nanValue << endl; return 0; }
Output
输出量
讯享网nanValue: nan
Reference: C++ nanf() function
参考: C ++ nanf()函数
翻译自: https://www.includehelp.com/cpp-tutorial/nanf-function-with-example.aspx
nanf flash校验

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/45635.html