Closed williamstein closed 17 years ago
Description changed:
---
+++
@@ -1,4 +1,6 @@
-{{{ some f-p values are printed like integers, which may confuse the user
+
+```
+some f-p values are printed like integers, which may confuse the user
(especially if one copies them with the mouse):
sage: 2.0^46
70368744177664.0
@@ -16,4 +18,4 @@
My 2 cents,
Paul Z.
-}}}
+```
The inconsistency mentioned is because of the automagic behavior of decimal literals, where longer literals get more bits:
sage: (2.0^47).prec()
53
sage: (140737488355328.0).prec()
56
Maybe this magic behavior should be removed, or somehow modified to be less confusing? (Although I have no idea how to make it less confusing.)
See also #962, for problems with the current implementation of the precision extension.
Attachment: mpfr.patch.gz
I've attached a patch that makes sure that all real numbers include a "." so that they don't get confused with integers.
Here is the behavior after the patch
sage: 2.0^47
140737488355328.
sage: 2.0^46
70368744177664.0
sage: 2.0^99
633825300114115000000000000000.
sage: 2.0^100
1.26765060022823e30
sage: 140737488355328.
140737488355328.
sage: a = 2.0^47
sage: a
140737488355328.
sage: a.prec()
53
sage: b = 140737488355328.
sage: b.prec()
53
Component: basic arithmetic
Issue created by migration from https://trac.sagemath.org/ticket/960