nan
Return the floating point NaN of the input string.
Interface Definition
C interface:
float nanf(const char *tagp);
double nan(const char *tagp);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
tagp |
|
Input data. |
Input |
Return Value
If tagp is not NULL, floating-point NaN is returned. If tagp is NULL, undefined behavior occurs. Ensure that the input parameter is not NULL.
Dependency
C: "km.h"
Example
C interface:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | // typical usage const char *a = "0x7ff8000000000000"; const char *b = "0x781"; const char *c = "0x781asdf"; printf("/*\n"); printf(" * nan(%s)=0x%lx\n", a, Asuint64(nan(a))); printf(" * nan(%s)=0x%lx\n", b, Asuint64(nan(b))); printf(" * nan(%s)=0x%lx\n", c, Asuint64(nan(c))); printf(" **/\n"); /* * nan(0x7ff8000000000000)=0x7ff8000000000000 * nan(0x781)=0x7ff8000000000781 * nan(0x781asdf)=0x7ff8000000000000 **/ |
Parent topic: Miscellaneous Functions