summaryrefslogtreecommitdiff
path: root/src/math/lroundl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/lroundl.c')
-rw-r--r--src/math/lroundl.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/math/lroundl.c b/src/math/lroundl.c
new file mode 100644
index 00000000..1469127b
--- /dev/null
+++ b/src/math/lroundl.c
@@ -0,0 +1,16 @@
+#include "libm.h"
+#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
+long lroundl(long double x)
+{
+ return lround(x);
+}
+#else
+#define type long double
+#define roundit roundl
+#define dtype long
+#define DTYPE_MIN LONG_MIN
+#define DTYPE_MAX LONG_MAX
+#define fn lroundl
+
+#include "lround.c"
+#endif