#14890: rounding in logs
-------------------------------------------+--------------------------
Reporter: amy | Owner: AlexGhitza
Type: defect | Status: new
Priority: minor | Milestone: sage-6.3
Component: basic arithmetic | Resolution:
Keywords: logarithm mpfr rounding | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------------------+--------------------------
Changes (by jdemeyer):
* keywords: logarithms => logarithm mpfr rounding
* owner: burcin => AlexGhitza
* component: calculus => basic arithmetic
Old description:
> Logarithms seem to evaluate numbers differently, depending on type. This
> causes some precision errors when using numbers which can be coerced into
> integers. For example, if we use integers and evaluate something of the
> form log_b(b^k) the answer is what it should be:
>
> {{{
> sage: log(3^5,3)==5
> True
> }}}
>
> However, if we use reals which can be coerced into integers, the answer
> is rounded and slightly off:
>
> {{{
> sage: log(3.0^5,3.0)==5
> False
> }}}
>
> This problem doesn't always happen, for example if we replace the 5 with
> 12:
>
> {{{
> sage: log(3.0^12,3.0)==12
> True
> }}}
>
> This only seems to be happening for some exponents; in base 3, we found
> that this sort of expression evaluates to False for exponents equal to 5,
> 13 and 17, but it does not happen for numbers in between.
New description:
Logarithms are not rounded correctly:
{{{
sage: (3.0^5).log(3.0) - 5.0
-8.88178419700125e-16
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/14890#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.