ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 12 Jun 2015 17:33:51 +0200Conversion between RealFieldhttps://ask.sagemath.org/question/27093/conversion-between-realfield/ I found the following behaviour very unintuitive :
R128=RealField(128)
pi_r128=R128.pi()
print pi_r128*2
print pi_r128*2.
print RR(pi)*2
The corresponding output is :
6.2831853071795864769252867665590057684
6.28318530717959
6.28318530717959
The first line was the expected behavior.
The second line was not expected because floating number **2.** has the default precision contrary to **pi_r128** whose is precision is wider. As the 3rd line shows, the 128 bit precision is completely ignored from **pi_r128*2** calculation.
So I was wondering how conversion between RealField numbers was done.
candideFri, 12 Jun 2015 17:33:51 +0200https://ask.sagemath.org/question/27093/Something like RealDigits in Sage?https://ask.sagemath.org/question/25881/something-like-realdigits-in-sage/Is there in Sagemath something like RealDigits in Mathematica for computing (binary) digits of any real number? (and not only for integers)
Can you please also explain how to transform back a non-integer binary string as '100.1000111001001' to the corresponding (approximated) base ten decimal? (not float)
logomathSat, 21 Feb 2015 16:07:06 +0100https://ask.sagemath.org/question/25881/