2 * (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 * Author: Ceriel J.H. Jacobs
12 #include "localmath.h"
15 pow(double x
, double y
)
17 /* Simple version for now. The Cody and Waite book has
18 a very complicated, much more precise version, but
19 this version has machine-dependent arrays A1 and A2,
20 and I don't know yet how to solve this ???
25 if ((x
== 0 && y
== 0) ||
26 (x
< 0 && modf(y
, &dummy
) != 0)) {
34 if (modf(y
/2.0, &dummy
) != 0) {
46 /* Beware of overflow in the multiplication */
47 if (x
> 1.0 && y
> DBL_MAX
/x
) {
49 return result_neg
? -HUGE_VAL
: HUGE_VAL
;
53 return result_neg
? -x
: x
;