开发者

Where is the definition of function nanf() on linux

开发者 https://www.devze.com 2023-01-29 16:43 出处:网络
I am trying to look for definition and declaration of the functionnanf() - return \'Not a Number function, which is related to the floating point functionality on Linux gcc compiler environment - (gli

I am trying to look for definition and declaration of the function nanf() - return 'Not a Number function, which is related to the floating point functionality on Linux gcc compiler environment - (glibc).

I need to use similar/same definition for nanf() on windows 开发者_JAVA技巧to build my code using Visual Studio.

I checked following header files in the Linux src/include folders but did not see anything related to nanf declaration.

/usr/include/math.h /usr/include/bits/nan.h

Any pointers will be helpful.

thank you,

-AD


The declaration is just (C99 §7.12.11.3):

float nanf(const char *tagp);

or macros that expand to something equivalent. A conformant implementation is highly platform-specific, however, because the standard does not define how to interpret tagp, except to say that the behavior is equivalent to a certain call to strtof, and "The nan functions return a quiet NaN, if available, with content indicated through tagp."

Instead of trying to shoehorn C99 features into the one compiler and library that stubbornly refuses to even try to implement them, why not just use a real C compiler? There are plenty out there.

0

精彩评论

暂无评论...
验证码 换一张
取 消