Changes between Version 1 and Version 2 of Ticket #9937


Ignore:
Timestamp:
09/17/10 21:05:10 (12 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9937

    • Property Keywords set_real_precision added
  • Ticket #9937 – Description

    v1 v2  
    11The following do not work as they should (try these examples with a freshly started copy of Sage, such that everything is default).
    22
     3This is definately a bug with the initialization of the precision:
    34{{{
    45# Default: 2 significant words (while we really should get only 1)
     
    1213}}}
    1314
     15{{{set_real_precision()}}} seems to affect essentially only the precision for evaluating strings in PARI and not much else:
    1416{{{
    15 # set_real_precision() doesn't do anything for library functions:
    1617sage: pari.set_real_precision(1000);
    1718sage: pari.euler().debug()
     
    1920}}}
    2021
     22This last behaviour is actually documented in {{{sage/libs/pari/gen.pyx}}}:
     23> Unless otherwise indicated in the docstring, most Pari functions
     24> that return inexact objects use the precision of their arguments to
     25> decide the precision of the computation. However, if some of these
     26> arguments happen to be exact numbers (integers, rationals, etc.),
     27> an optional parameter indicates the precision (in bits) to which
     28> these arguments should be converted before the computation. If this
     29> precision parameter is missing, the '''default precision of 53 bits''' is
     30> used.
     31
     32In other words, the default precision is an unchangable 53 bits. I would expect {{{set_real_precision()}}} to change this.  This is also trivial to implement since the global variable {{{prec}}} is already there (and initialized once and for all to 53).
     33
    2134Dependencies: #9898, #9893