9
0
Fork 0

Add math library defines for nan functions. From Brennan Ashton.

This commit is contained in:
Gregory Nutt 2015-01-26 19:03:38 -06:00
parent 6461f948f2
commit 5066ce6633
2 changed files with 8 additions and 6 deletions

View File

@ -143,12 +143,6 @@ void do_str(FAR const char *src)
* Public Functions
****************************************************************************/
float nanf(FAR const char *tagp)
{
(void)tagp;
return 0;
}
/****************************************************************************
* mp_import_stat
****************************************************************************/

View File

@ -385,6 +385,14 @@ double trunc (double x);
long double truncl (long double x);
#endif
#define nanf(x) ((float)(NAN))
#ifdef CONFIG_HAVE_DOUBLE
#define nan(x) ((double)(NAN))
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
#define nanl(x) ((long double)(NAN))
#endif
#if defined(__cplusplus)
}
#endif