X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsqrtl.c;h=4f7c9f1254f61175a57e4e08c07fcb07c8e25f50;hb=0c6fd3b84775ca4cf1045d4cc07a2dff4c73f29b;hp=2a4a8abaff62e8a9db26130bf78c146bd9f523cf;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/lib/sqrtl.c b/lib/sqrtl.c index 2a4a8abaf..4f7c9f125 100644 --- a/lib/sqrtl.c +++ b/lib/sqrtl.c @@ -1,7 +1,7 @@ /* Emulation for sqrtl. Contributed by Paolo Bonzini - Copyright 2002, 2003, 2007 Free Software Foundation, Inc. + Copyright 2002-2003, 2007, 2009-2014 Free Software Foundation, Inc. This file is part of gnulib. @@ -23,12 +23,21 @@ /* Specification. */ #include -#include -#include "isnanl.h" +#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE + +long double +sqrtl (long double x) +{ + return sqrt (x); +} + +#else + +# include /* A simple Newton-Raphson method. */ long double -sqrtl(long double x) +sqrtl (long double x) { long double delta, y; int exponent; @@ -39,7 +48,7 @@ sqrtl(long double x) /* Check for negative numbers */ if (x < 0.0L) - return (long double) sqrt(-1); + return (long double) sqrt (-1); /* Check for zero and infinites */ if (x + x == x) @@ -58,3 +67,5 @@ sqrtl(long double x) return y; } + +#endif