projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fflush, stat: no 'static inline'
[gnulib.git]
/
lib
/
sqrtl.c
diff --git
a/lib/sqrtl.c
b/lib/sqrtl.c
index
2a4a8ab
..
0018237
100644
(file)
--- a/
lib/sqrtl.c
+++ b/
lib/sqrtl.c
@@
-1,7
+1,7
@@
/* Emulation for sqrtl.
Contributed by Paolo Bonzini
/* Emulation for sqrtl.
Contributed by Paolo Bonzini
- Copyright 2002
, 2003, 2007
Free Software Foundation, Inc.
+ Copyright 2002
-2003, 2007, 2009-2012
Free Software Foundation, Inc.
This file is part of gnulib.
This file is part of gnulib.
@@
-23,12
+23,21
@@
/* Specification. */
#include <math.h>
/* Specification. */
#include <math.h>
-#include <float.h>
-#include "isnanl.h"
+#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+
+long double
+sqrtl (long double x)
+{
+ return sqrt (x);
+}
+
+#else
+
+# include <float.h>
/* A simple Newton-Raphson method. */
long double
/* A simple Newton-Raphson method. */
long double
-sqrtl(long double x)
+sqrtl
(long double x)
{
long double delta, y;
int exponent;
{
long double delta, y;
int exponent;
@@
-39,7
+48,7
@@
sqrtl(long double x)
/* Check for negative numbers */
if (x < 0.0L)
/* 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)
/* Check for zero and infinites */
if (x + x == x)
@@
-58,3
+67,5
@@
sqrtl(long double x)
return y;
}
return y;
}
+
+#endif