On 9/5/07, Markus Fraczek <[EMAIL PROTECTED]> wrote:
> it's me again, sorry for reporting another (possible) bug within 24 hours...
>
> sage: CC = ComplexField(332)
> sage: 
> X=CC(1.357903630374279963068269401271673391959119893809138669904789002836753985101796915789954726170961844+0.08656877927962875916843133406339412225470973123970623802678766038896195993916712945561867677105668213*I)
> sage: X
> 1.35790363037427996850681211071787402033805847167968750000000000000000000000000000000000000000000000
>  + 
> 0.0865687792796287600323446032035690222983248531818389892578125000000000000000000000000000000000000000*I
>
> If we compare this numbers,
>
> IN  1.357903630374279963068...
> OUT 1.357903630374279968506...
>
> IN  0.086568779279628759168...*I
> OUT 0.086568779279628760032...*I
>
> we see that they differ already after 16 digits. It seems like a bug.
>

This is because the I above is a symbolic I that ends up getting
(at present) parsed by Maxima, which kills the precision for some
reason.   Yep, that's just what Maxima does:

sage: 
maxima('1.357903630374279963068269401271673391959119893809138669904789002836753985101796915789954726170961844+0.086>
.08656877927962876*I+1.35790363037428

I.e., any symbolic expression in SAGE will have its digits truncated
to double precision, since Maxima evidently does that:

sage: !maxima
(%i1) 1.9028349082409829034809283490823094802938402834098230840923840928340982
;
(%o1)                          1.902834908240983

Though this is very undesirable behavior, unfortunately
it might (??) be incredibly hard to change for now.  I don't
know if Maxima has any notion of arbitrary precision reals,
and if so how to enable them.  (If you know, please post.)

Back to your original problem -- fortunately there *are* several ways to
enter that complete number correctly so that precision is
not lost.  See below:

sage: sage: CC = ComplexField(332)
<56877927962875916843133406339412225470973123970623802678766038896195993916712945561867677105668213*I)

Method 1 -- use quotes:

sage: 
X=CC('1.357903630374279963068269401271673391959119893809138669904789002836753985101796915789954726170961844+0>
sage: X
1.35790363037427996306826940127167339195911989380913866990478900283675398510179691578995472617096184
+ 
0.0865687792796287591684313340633941222547097312397062380267876603889619599391671294556186767710566821*I

Method 2 -- make I be the generator of CC:
sage: I = CC.0
sage: X = 
1.357903630374279963068269401271673391959119893809138669904789002836753985101796915789954726170961844+0.0865687>
sage: X
1.35790363037427996306826940127167339195911989380913866990478900283675398510179691578995472617096184
+ 
0.0865687792796287591684313340633941222547097312397062380267876603889619599391671294556186767710566821*I

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to