diff options
Diffstat (limited to 'src/benchmarks/cfrac/psqrt.c')
| -rw-r--r-- | src/benchmarks/cfrac/psqrt.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/benchmarks/cfrac/psqrt.c b/src/benchmarks/cfrac/psqrt.c deleted file mode 100644 index 00531a6..0000000 --- a/src/benchmarks/cfrac/psqrt.c +++ /dev/null @@ -1,29 +0,0 @@ -#include "precision.h" - -/* - * Square root - */ -precision psqrt(y) - precision y; -{ - int i; - precision x = pUndef, lastx = pUndef; - - i = pcmpz(pparm(y)); - if (i == 0) { /* if y == 0 */ - pset(&lastx, pzero); - } else if (i < 0) { /* if y negative */ - pset(&x, errorp(PDOMAIN, "psqrt", "negative argument")); - } else { - pset(&x, y); - do { - pset(&lastx, x); - pset(&x, phalf(padd(x, pdiv(y, x)))); - } while (plt(x, lastx)); - } - - pdestroy(x); - - pdestroy(y); - return presult(lastx); -} |
