On Jul 9, 12:18 am, Fredrik Johansson <[email protected]>
wrote:
> On Wed, Jul 8, 2009 at 9:09 PM, smichr<[email protected]> wrote:
>
> > On Jul 8, 10:23 pm, Ondrej Certik <[email protected]> wrote:
>
> >> Ah, yes, I think it should be called fastlog2. Fredrik, what do you think?
>
> > And someone who has used this should probably comment on the need to
> > have the sign ignored: the fastlog for both 16 and -16 would be 4 as
> > it is written now. *Should* the sign be ignored or should a value
> > error be raised or should the docstring say that the fastlog of the
> > absolute value of x is being computed?
>
> It's intended to compute an upper bound for the base-2 logarithm of
> the absolute value of a number. This is used to determine how much
> precision is required for various calculations. Whether it's exact too
> high by 1 or 2 bits doesn't really matter.
>
> It's also strictly intended as an internal function, so it probably
> doesn't need much more elaborate documentation or a more precise name
> (unless its present role is unclear to someone trying to understand
> the internals of the evalf module).
Then I would propose that the name be changed to _fastlog2 and the
docstring be improved to say what you have said. If that is agreeable,
I would be happy to make the changes.
Does the fact that it is intended to be internal excuse it from normal
doctests? Is there a separate level of testing for internal functions
like this or do we just assume that if the code that is dependent on
the internal-use code passes all its tests at 100% coverage that the
dependent code doesn't need tests?
/c
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---