[issue2487] ldexp(x,n) misbehaves when abs(n) is large

Mark Dickinson report at bugs.python.org
Sat Apr 26 17:33:47 CEST 2008


Mark Dickinson <dickinsm at gmail.com> added the comment:

Here's a patch that should fix ldexp(x, large_int), as follows:

ldexp(x, n) = x if x is a NaN, zero or infinity
ldexp(x, n) = copysign(0., x) for x finite and nonzero, n large and -ve
ldexp(x, n) -> OverflowError for x finite and nonzero, n large and +ve

It would be good if someone else could review this before I check it in;
Fredrik, would you have time for this?

----------
keywords: +patch
Added file: http://bugs.python.org/file10115/ldexp.patch

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2487>
__________________________________


More information about the Python-bugs-list mailing list