Bug in math.frexp?

Thomas Wouters thomas at centurion.xs4all.nl
Mon Jul 3 07:18:27 EDT 2000


In comp.lang.python, you wrote:
>
>Tim Peters writes:
> > The docs are wrong.  I just checked in a repaired version of mathmodule.c.
> > Fred, would you please get the truth into the Library Reference Manual's
> > math module docs too?

>  --sigh--
>  So are the Solaris and Linux man pages wrong, or just confusing?
>Ok, I'll have something like your docstring checked in shortly.

Not sure which version of the Linux manpges you read, but the frexp manpage
that came with RedHat 6.1 more or less exactly mirrors Tim's description:

       The frexp() function returns the normalized fraction.   If
       the  argument  x is not zero, the normalized fraction is x
       times a power of two, and  is  always  in  the  range  1/2
       (inclusive) to 1 (exclusive).  If x is zero, then the nor­
       malized fraction is zero and zero is stored in exp.

The 'info' page about frexp states the same, in different wording. The
Solaris 2.5 manpage I have access to is indeed a bit confusing, but does
state the same: 'x' is in the range of [0.5, 1), or 0. That means the
exponent has to be able to be negative, when the original number was
negative.





More information about the Python-list mailing list