summaryrefslogtreecommitdiffstats
path: root/newlib/libm/math/el_hypot.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libm/math/el_hypot.c')
-rw-r--r--newlib/libm/math/el_hypot.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/newlib/libm/math/el_hypot.c b/newlib/libm/math/el_hypot.c
new file mode 100644
index 000000000..737cde36b
--- /dev/null
+++ b/newlib/libm/math/el_hypot.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2015 by Red Hat, Incorporated. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include "fdlibm.h"
+
+long double
+__ieee754_hypotl (long double x, long double y)
+{
+#ifdef _LDBL_EQ_DBL
+ return __ieee754_hypot (x, y);
+#else
+ /* Keep it simple for now... */
+ return sqrtl ((x * x) + (y * y));
+#endif
+}