Dear Colleagues,

I have managed to code this...

But I have a question before pushing the tickket.

What I can do nowadays:

sage: set_precision(100)
sage: x=1.
sage: x.parent()
Real Field with 100 bits of precision
sage: ComplexNumber(1.,2.).parent()
Complex Field with 99 bits of precision
sage: set_precision()
sage: x=1.
sage: x.parent()
Real Field with 53 bits of precision

sage: set_precision(100)
sage: x=RealNumber(1.)
sage: print x
1.000000000000000000000000000 #okay

but:

sage: set_precision(100)
sage: x=RealNumber(1)
sage: print x
1.00000000000000
sage: x.parent()
Real Field with 53 bits of precision

So, what do you think of that?
Is it necessary to modify (the parser) so that:
sage: set_precision(100)
sage: x=RealNumber(1)
returns something in "Real Field with 100 bits of precision"?
I recall that the idea was to change the default behavior of the parsed floats.
Doing this is possible but not with a very smart implementation.

t.



Le 13/09/2015 08:55, Thierry Dumont a écrit :
Le 13/09/2015 01:36, Vincent Delecroix a écrit :
It would indeed be cool to have an option to change interactively the
precision...

preparser.set_precision?

or simply

set_precision?

Vincent

I can look at this and propose an implementation...
Thanks!
t.
On 12/09/15 19:49, David Roe wrote:
One approach would be to change "RealNumber('%s')" % num on line 739
of sage.repl.preparse to "RealNumber('%s',min_prec=1000)" % num.
David

On Sat, Sep 12, 2015 at 12:24 PM, Thierry Dumont
<tdum...@math.univ-lyon1.fr> wrote:
I have a program with a lot of floating point constants/variables
(this is a
translation of a C++ program).
Nowadays -by default- all these values live in RealField(53).

But, as my problem is a bit ill conditioned, I would like to compute in
higher precision, say in RealField(1000).

Is there a possibility to change the default behavior of say,

x=1.0
x.parent()
Real Field with 53 bits of precision

so that:

x=1.0
x.parent()

gives
Real Field with 1000 bits of precision
?

Yours
t.

--
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.




--
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.

<<attachment: tdumont.vcf>>

Reply via email to