2000-02-18 03:39:52 +08:00
|
|
|
/*
|
|
|
|
* nanf () returns a nan.
|
|
|
|
* Added by Cygnus Support.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "fdlibm.h"
|
|
|
|
|
2003-07-10 01:52:31 +08:00
|
|
|
float nanf(const char *unused)
|
2000-02-18 03:39:52 +08:00
|
|
|
{
|
|
|
|
float x;
|
|
|
|
|
2014-03-21 Maciej W. Rozycki <macro@codesourcery.com>
* libc/stdlib/gd_qnan.h (f_QNAN, d_QNAN0, d_QNAN1): Add MIPS
versions.
(ld_QNAN0, ld_QNAN1, ld_QNAN2, ld_QNAN3): Don't define for MIPS.
(ldus_QNAN0, ldus_QNAN1, ldus_QNAN2, ldus_QNAN3, ldus_QNAN4):
Likewise.
* libc/stdlib/ldtoa.c (nan113, nan64, nan53, nan24): Add MIPS
versions.
(enan): Handle legacy MIPS payloads.
* libm/common/s_nan.c (nan): Use __builtin_nan if supported by
the compiler.
* libm/common/sf_nan.c (nanf): Likewise.
2014-03-22 05:27:29 +08:00
|
|
|
#if __GNUC_PREREQ (3, 3)
|
|
|
|
x = __builtin_nanf("");
|
|
|
|
#else
|
2000-02-18 03:39:52 +08:00
|
|
|
SET_FLOAT_WORD(x,0x7fc00000);
|
2014-03-21 Maciej W. Rozycki <macro@codesourcery.com>
* libc/stdlib/gd_qnan.h (f_QNAN, d_QNAN0, d_QNAN1): Add MIPS
versions.
(ld_QNAN0, ld_QNAN1, ld_QNAN2, ld_QNAN3): Don't define for MIPS.
(ldus_QNAN0, ldus_QNAN1, ldus_QNAN2, ldus_QNAN3, ldus_QNAN4):
Likewise.
* libc/stdlib/ldtoa.c (nan113, nan64, nan53, nan24): Add MIPS
versions.
(enan): Handle legacy MIPS payloads.
* libm/common/s_nan.c (nan): Use __builtin_nan if supported by
the compiler.
* libm/common/sf_nan.c (nanf): Likewise.
2014-03-22 05:27:29 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef _DOUBLE_IS_32BITS
|
|
|
|
|
2003-07-10 01:52:31 +08:00
|
|
|
double nan(const char *arg)
|
2000-02-18 03:39:52 +08:00
|
|
|
{
|
2003-07-10 01:52:31 +08:00
|
|
|
return (double) nanf(arg);
|
2000-02-18 03:39:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* defined(_DOUBLE_IS_32BITS) */
|
2001-04-04 21:33:01 +08:00
|
|
|
|