math: add __math_invalidl
authorSzabolcs Nagy <nsz@port70.net>
Mon, 29 Jun 2020 17:14:42 +0000 (17:14 +0000)
committerRich Felker <dalias@aerifal.cx>
Thu, 6 Aug 2020 03:05:57 +0000 (23:05 -0400)
for targets where long double is different from double.

src/internal/libm.h
src/math/__math_invalidl.c [new file with mode: 0644]

index 7533f6b..72ad17d 100644 (file)
@@ -267,5 +267,8 @@ hidden double __math_uflow(uint32_t);
 hidden double __math_oflow(uint32_t);
 hidden double __math_divzero(uint32_t);
 hidden double __math_invalid(double);
+#if LDBL_MANT_DIG != DBL_MANT_DIG
+hidden long double __math_invalidl(long double);
+#endif
 
 #endif
diff --git a/src/math/__math_invalidl.c b/src/math/__math_invalidl.c
new file mode 100644 (file)
index 0000000..1fca99d
--- /dev/null
@@ -0,0 +1,9 @@
+#include <float.h>
+#include "libm.h"
+
+#if LDBL_MANT_DIG != DBL_MANT_DIG
+long double __math_invalidl(long double x)
+{
+       return (x - x) / (x - x);
+}
+#endif