Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2005-09-01 21:53:02 +0400
committerJeff Johnston <jjohnstn@redhat.com>2005-09-01 21:53:02 +0400
commitcebe43dd76ef888beb48b69750503e89dae9f685 (patch)
tree12bbd66e84e186fe649d5ff2167a2ad221b7a319 /newlib/libm
parent45c8bb8f8cd221a0f4ad3c920a315eacea4fca94 (diff)
2005-09-01 Jeff Johnston <jjohnstn@redhat.com>
* libm/mathfp/s_pow.c: (pow): Change code so 0 raised to any positive power results in 0. * libm/mathfp/sf_pow.c (powf): Ditto.
Diffstat (limited to 'newlib/libm')
-rw-r--r--newlib/libm/mathfp/s_pow.c5
-rw-r--r--newlib/libm/mathfp/sf_pow.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/newlib/libm/mathfp/s_pow.c b/newlib/libm/mathfp/s_pow.c
index 3514510d0..90d9d0b5f 100644
--- a/newlib/libm/mathfp/s_pow.c
+++ b/newlib/libm/mathfp/s_pow.c
@@ -75,9 +75,10 @@ double pow (double x, double y)
}
}
- if (x == 0.0 && y <= 0.0)
+ if (x == 0.0)
{
- errno = EDOM;
+ if (y <= 0.0)
+ errno = EDOM;
}
else if ((t = y * log (fabs (x))) >= BIGX)
{
diff --git a/newlib/libm/mathfp/sf_pow.c b/newlib/libm/mathfp/sf_pow.c
index 932e75dbb..489a71dd0 100644
--- a/newlib/libm/mathfp/sf_pow.c
+++ b/newlib/libm/mathfp/sf_pow.c
@@ -29,9 +29,10 @@ float powf (float x, float y)
}
}
- if (x == 0.0 && y <= 0.0)
+ if (x == 0.0)
{
- errno = EDOM;
+ if (y <= 0.0)
+ errno = EDOM;
}
else if ((t = y * log (fabsf (x))) >= BIGX)
{