On Sun, Sep 20, 2015 at 11:28 AM, rjf <fate...@gmail.com> wrote:
> If the original program has constants that are good for ordinary floating
> precision,
> then increasing the precision without increasing the accuracy may not do
> what
> you want.
> For example, converting 3.1415926  (etc) by extending with decimal or
> binary 0's might
> not do the right thing.
> In fact, converting 0.1, which is a binary float not equal to 1/10 exactly,
> might change
> the situation enough so that
> f(a,b,c)  in single-float
> f(a,b,c)  in 100 bits
>
> differ not because the second is more accurate, but because something rather
> different is being computed.   e.g. if a= 0.1.
>
> Also, if someone is automatically translating C to python, then
> automatically
> inserting  MyChosenPrecisionReal('   ')   around every float should be easy.

The Sage preparser already inserts

   RealNumber('  ')

around every floating point literal.    My suggestion, which solves
the problem is to redefine RealNumber to be RealField(300) (say).

By the way, the builtin RealNumber function does take into account the
actual number of digits given in the input -- it doesn't just default
to 53 bits.

Richard does have a point about interpretation though -- you may want
to output and input using base 16 instead of base 10.

>
> While it is tempting to add every possible tool to Sage, thinking out of the
> box can be productive.
>
> (one answer:  there is a bootstrapping problem if you have to have a working
> Sage in order to build a working Sage.)

One answer to what?  Huh?

>
>
> On Sunday, September 20, 2015 at 9:20:35 AM UTC-7, Volker Braun wrote:
>>
>> Yes, a more complete regex can be found easily with google or by using the
>> one from src/sage/repl/preparse.py
>>
>> On Sunday, September 20, 2015 at 6:11:25 PM UTC+2, vdelecroix wrote:
>>>
>>> Would not work with 'x=.8' (can be fixed with replacing the first \+
>>>
>>> with a \*) nor 'x=2e3' (this is more annoying).
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to