1 /* Copyright (C) 2015 by  Red Hat, Incorporated. All rights reserved.
2  *
3  * Permission to use, copy, modify, and distribute this software
4  * is freely granted, provided that this notice is preserved.
5  */
6 
7 #include "fdlibm.h"
8 
9 #if defined(_NEED_FLOAT_HUGE) && !defined(_HAVE_LONG_DOUBLE_MATH)
10 
11 long double
hypotl(long double x,long double y)12 hypotl(long double x, long double y)
13 {
14     if ((isinf(x) && isnan(y) && !issignaling(y)) ||
15         (isinf(y) && isnan(x) && !issignaling(x)))
16         return (long double)INFINITY;
17 
18     /* Keep it simple for now...  */
19     long double z = sqrtl((x * x) + (y * y));
20 #ifdef _WANT_MATH_ERRNO
21     if (!finite(z) && finite(x) && finite(y))
22         errno = ERANGE;
23 #endif
24     return z;
25 }
26 
27 #endif
28