`expt' repair, again
Previous repair wasn't general enough; negative powers can also go wrong.
This commit is contained in:
parent
678451f8c4
commit
3c5135fc7a
|
@ -552,6 +552,8 @@
|
|||
(test -0.0 expt -0.1 10000000000001.0)
|
||||
(test 0.0 expt -0.0 10000000000000.0)
|
||||
(test -0.0 expt -0.0 10000000000001.0)
|
||||
(test 0.0 expt -10.0 -10000000000000.0)
|
||||
(test -0.0 expt -10.0 -10000000000001.0)
|
||||
|
||||
(err/rt-test (max 0 'a))
|
||||
(err/rt-test (min 0 'a))
|
||||
|
|
|
@ -2732,8 +2732,9 @@ static double sch_pow(double x, double y)
|
|||
double r;
|
||||
r = protected_pow(x, y);
|
||||
if ((r == 0.0) && !minus_zero_p(r)) {
|
||||
/* check large odd power of a small negative number,
|
||||
/* check zero result of a odd power of a negative number,
|
||||
which some libraries get wrong for some reason */
|
||||
if (y < 0) y = -y;
|
||||
if ((x < 0) && (fmod(y, 2.0) == 1.0)) {
|
||||
r = scheme_floating_point_nzero;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user