diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2005-09-01 17:53:02 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2005-09-01 17:53:02 +0000 |
commit | cebe43dd76ef888beb48b69750503e89dae9f685 (patch) | |
tree | 12bbd66e84e186fe649d5ff2167a2ad221b7a319 /newlib | |
parent | 45c8bb8f8cd221a0f4ad3c920a315eacea4fca94 (diff) | |
download | newlib-cebe43dd76ef888beb48b69750503e89dae9f685.zip newlib-cebe43dd76ef888beb48b69750503e89dae9f685.tar.gz newlib-cebe43dd76ef888beb48b69750503e89dae9f685.tar.bz2 |
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')
-rw-r--r-- | newlib/ChangeLog | 6 | ||||
-rw-r--r-- | newlib/libm/mathfp/s_pow.c | 5 | ||||
-rw-r--r-- | newlib/libm/mathfp/sf_pow.c | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index a980584..ba3e3e7 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +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. + 2005-08-31 Paul Brook <paul@codesourcery.com> * configure.host: Set have_crt0 to no for Arm targts when not diff --git a/newlib/libm/mathfp/s_pow.c b/newlib/libm/mathfp/s_pow.c index 3514510..90d9d0b 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 932e75d..489a71d 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) { |