nanf flash校验_C ++中带有示例的nanf()函数
nanf flash校驗
C ++ Nanf()函數(shù) (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()函數(shù)是cmath標頭的庫函數(shù),用于獲取float類型的NaN值。 它接受一個參數(shù)(它是特定于實現(xiàn)的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.
非數(shù)字(NaN)值用于檢查該值是否為未識別/不可代表? 例如,負數(shù)的平方根不確定。
Syntax of nanf() function:
nanf()函數(shù)的語法:
C++11:
C ++ 11:
float nanf (const char* tagp);Parameter(s):
參數(shù):
tagp – represents an implementation-specific C-String.
tagp –表示特定于實現(xiàn)的C-String。
Return value:
返回值:
The return type of this method is float, it returns NaN value.
此方法的返回類型為float ,它返回NaN值。
Example:
例:
Function call:nanf(""); Output:nanC ++代碼演示nanf()函數(shù)的示例 (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 stringnanValue = nanf("");//printing the valuecout << "nanValue: " << nanValue << endl;return 0; }Output
輸出量
nanValue: nanReference: C++ nanf() function
參考: C ++ nanf()函數(shù)
翻譯自: https://www.includehelp.com/cpp-tutorial/nanf-function-with-example.aspx
nanf flash校驗
總結(jié)
以上是生活随笔為你收集整理的nanf flash校验_C ++中带有示例的nanf()函数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SSIA的完整形式是什么?
- 下一篇: drawer的用法_MMDrawerCo