Ask Your Question

Revision history [back]

The rounding are not the same as shown below (or the precision are different, I do not know):

sage: a = RR(1/10)   
sage: a.sign_mantissa_exponent()
(1, 7205759403792794, -56)
sage: (a * RR(10)).sign_mantissa_exponent()
(1, 4503599627370496, -52)

sage: b = RDF(1/10)
sage: b.sign_mantissa_exponent()   # same floating point as above
(1, 7205759403792793, -56)
sage: (b * RDF(10)).sign_mantissa_exponent()  # different from above !!
(1, 9007199254740991, -53)

In particular, RR has the equality 1/10 * 10 = 1 but not RDF because

sage: RR(1).sign_mantissa_exponent()                       
(1, 4503599627370496, -52)
sage: RDF(1).sign_mantissa_exponent()
(1, 4503599627370496, -52)
click to hide/show revision 2
added comma for clarity: "not the same, as shown below" vs "not the same as shown below"

The rounding are Rounding in RR and RDF is not the same same, as shown below (or the precision are is different, I do not know):

sage: a = RR(1/10)   
sage: a.sign_mantissa_exponent()
(1, 7205759403792794, -56)
sage: (a * RR(10)).sign_mantissa_exponent()
(1, 4503599627370496, -52)

sage: b = RDF(1/10)
sage: b.sign_mantissa_exponent()   # same floating point as above
(1, 7205759403792793, -56)
sage: (b * RDF(10)).sign_mantissa_exponent()  # different from above !!
(1, 9007199254740991, -53)

In particular, RR has the equality 1/10 * 10 = 1 but not RDF because

sage: RR(1).sign_mantissa_exponent()                       
(1, 4503599627370496, -52)
sage: RDF(1).sign_mantissa_exponent()
(1, 4503599627370496, -52)