From f95a4a932476be2ba99e2fd081e8d2bc6ea12813 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 15 Dec 2017 09:38:53 -0500 Subject: Import newlib and create makefile --- newlib/libm/common/s_nan.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 newlib/libm/common/s_nan.c (limited to 'newlib/libm/common/s_nan.c') diff --git a/newlib/libm/common/s_nan.c b/newlib/libm/common/s_nan.c new file mode 100644 index 0000000..f062426 --- /dev/null +++ b/newlib/libm/common/s_nan.c @@ -0,0 +1,47 @@ +/* + * nan () returns a nan. + * Added by Cygnus Support. + */ + +/* +FUNCTION + <>, <>---representation of infinity + +INDEX + nan +INDEX + nanf + +ANSI_SYNOPSIS + #include + double nan(void); + float nanf(void); + +TRAD_SYNOPSIS + #include + double nan(); + float nanf(); + + +DESCRIPTION + <> and <> return an IEEE NaN (Not a Number) in + double and single precision arithmetic respectivly. + +QUICKREF + nan - pure + +*/ + +#include "fdlibm.h" + +#ifndef _DOUBLE_IS_32BITS + + double nan() +{ + double x; + + INSERT_WORDS(x,0x7ff80000,0); + return x; +} + +#endif /* _DOUBLE_IS_32BITS */ -- cgit v1.2.3