#18888: failing optional mathematica tests, due to bugs in N() and n()
-------------------------------------+-------------------------------------
       Reporter:  slabbe             |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.2
      Component:  interfaces:        |   Resolution:
  optional                           |    Merged in:
       Keywords:  mathematica        |    Reviewers:  Matthias Koeppe
        Authors:                     |  Work issues:  fix `N()` and `n()`
Report Upstream:  N/A                |       Commit:
         Branch:  public/18888       |  53e76e679a7c411aa4f193dabca0d8281fdaf052
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by yzh):

 With Mathematica 10.3.1 for Mac OS X x86 (64-bit), all tests passed.

 The old doctests showed that the results of `math_bessel_K(nu,x)` were
 different on 32-bit and 64-bit machines.
 {{{
 @@ -310,14 +306,13 @@ For more details, see the documentation for
 ``._sage_()``.
  OTHER Examples::

      sage: def math_bessel_K(nu,x):
      ...       return mathematica(nu).BesselK(x).N(20)
      ...
      sage: math_bessel_K(2,I)                      # optional -
 mathematica
 -    0.180489972066962*I - 2.592886175491197             # 32-bit
 -    -2.59288617549119697817 + 0.18048997206696202663*I  # 64-bit
 +    -2.5928861754911969782 + 0.1804899720669620266 I
 }}}
 Have they become identical now?

 Also, I was puzzled by the discrepancy between
 {{{
 sage: mathematica('Pi').N(10)
          3.141592654
 }}}
 and
 {{{
 sage: mathematica('Pi').n(10)
 3.1
 }}}
 After reading up on the code, I understand that `MathematicaElement.N()`
 sets the precision in decimal digits, whereas `MathematicaElement.n()`
 sets the precision in bits, so that the two examples above behave as
 {{{
 sage: pi.n(digits=10)
 3.141592654
 }}}
 and
 {{{
 sage: pi.n(10)
 3.1
 }}}
 respectively.
 Is such difference between `.N()` and `.n()` intended for
 `MathematicaElement`? Then maybe this should be specified in the
 documentations? Does it make sense to implement
 `mathematica('Pi').n(digits=10)` as well?

--
Ticket URL: <http://trac.sagemath.org/ticket/18888#comment:42>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to