1 /*
2 Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
3 
4 Developed at SunPro, a Sun Microsystems, Inc. business.
5 Permission to use, copy, modify, and distribute this
6 software is freely granted, provided that this notice
7 is preserved.
8  */
9 /*
10  * nan () returns a nan.
11  * Added by Cygnus Support.
12  */
13 
14 /*
15 FUNCTION
16 	<<nan>>, <<nanf>>---representation of ``Not a Number''
17 
18 INDEX
19 	nan
20 INDEX
21 	nanf
22 
23 SYNOPSIS
24 	#include <math.h>
25 	double nan(const char *<[unused]>);
26 	float nanf(const char *<[unused]>);
27 
28 
29 DESCRIPTION
30 	<<nan>> and <<nanf>> return an IEEE NaN (Not a Number) in
31 	double- and single-precision arithmetic respectively.  The
32 	argument is currently disregarded.
33 
34 QUICKREF
35 	nan - pure
36 
37 */
38 
39 #include "fdlibm.h"
40 
41 #ifdef _NEED_FLOAT64
42 
43 __float64
nan64(const char * unused)44 nan64(const char *unused)
45 {
46 	__float64 x;
47 
48         (void) unused;
49 #if __GNUC_PREREQ (3, 3)
50 	x = __builtin_nan("");
51 #else
52 	INSERT_WORDS(x,0x7ff80000,0);
53 #endif
54 	return x;
55 }
56 
57 _MATH_ALIAS_d_s(nan)
58 
59 #endif /* _NEED_FLOAT64 */
60