1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #include <math.h>
- #include <string.h>
- #include <stdlib.h>
- #include <stdio.h>
- double nan (const char *tagp)
- {
- if (tagp[0] != '\0') {
- char buf[6 + strlen (tagp)];
- sprintf (buf, "NAN(%s)", tagp);
- return strtod (buf, NULL);
- }
- return (double)NAN;
- }
- libm_hidden_def(nan)
- libm_hidden_proto(nanf)
- float nanf (const char *tagp)
- {
- if (tagp[0] != '\0') {
- char buf[6 + strlen (tagp)];
- sprintf (buf, "NAN(%s)", tagp);
- return strtof (buf, NULL);
- }
- return NAN;
- }
- libm_hidden_def(nanf)
- #if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __NO_LONG_DOUBLE_MATH
- libm_hidden_proto(nanl)
- long double nanl (const char *tagp)
- {
- if (tagp[0] != '\0') {
- char buf[6 + strlen (tagp)];
- sprintf (buf, "NAN(%s)", tagp);
- return strtold (buf, NULL);
- }
- return (long double)NAN;
- }
- libm_hidden_def(nanl)
- #endif
|