summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/interpreters/micropython/micropython_main.c6
-rw-r--r--nuttx/include/nuttx/math.h8
2 files changed, 8 insertions, 6 deletions
diff --git a/apps/interpreters/micropython/micropython_main.c b/apps/interpreters/micropython/micropython_main.c
index 0d68e815b..f16c954e7 100644
--- a/apps/interpreters/micropython/micropython_main.c
+++ b/apps/interpreters/micropython/micropython_main.c
@@ -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
****************************************************************************/
diff --git a/nuttx/include/nuttx/math.h b/nuttx/include/nuttx/math.h
index 89223531e..40990352a 100644
--- a/nuttx/include/nuttx/math.h
+++ b/nuttx/include/nuttx/math.h
@@ -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