Retro68/gcc/newlib/libm/common/s_nan.c

48 lines
684 B
C
Raw Normal View History

2017-04-11 21:13:36 +00:00
/*
* nan () returns a nan.
* Added by Cygnus Support.
*/
/*
FUNCTION
<<nan>>, <<nanf>>---representation of ``Not a Number''
INDEX
nan
INDEX
nanf
2018-12-28 15:30:48 +00:00
SYNOPSIS
2017-04-11 21:13:36 +00:00
#include <math.h>
double nan(const char *<[unused]>);
float nanf(const char *<[unused]>);
2017-04-11 21:13:36 +00:00
DESCRIPTION
<<nan>> and <<nanf>> return an IEEE NaN (Not a Number) in
double- and single-precision arithmetic respectively. The
argument is currently disregarded.
QUICKREF
nan - pure
*/
#include "fdlibm.h"
#ifndef _DOUBLE_IS_32BITS
double nan(const char *unused)
{
double x;
#if __GNUC_PREREQ (3, 3)
x = __builtin_nan("");
#else
2017-04-11 21:13:36 +00:00
INSERT_WORDS(x,0x7ff80000,0);
#endif
2017-04-11 21:13:36 +00:00
return x;
}
#endif /* _DOUBLE_IS_32BITS */