Skip to content

Commit 493d3f7

Browse files
committed
Document RealIntervalField default printing configuration
1 parent 209ae4c commit 493d3f7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/sage/rings/real_mpfi.pyx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,26 @@ satisfying, but we have chosen the latter.
120120
sage: a == 2
121121
False
122122
123+
Some default printing options can be set by modifying module globals::
124+
125+
sage: from sage.rings import real_mpfi
126+
sage: x = RIF(sqrt(2), sqrt(2)+1e-10); x
127+
1.4142135624?
128+
sage: real_mpfi.printing_error_digits = 2
129+
sage: x
130+
1.414213562424?51
131+
sage: real_mpfi.printing_style = 'brackets'
132+
sage: x
133+
[1.4142135623730949 .. 1.4142135624730952]
134+
sage: real_mpfi.printing_style = 'question'; real_mpfi.printing_error_digits = 0 # revert to default
135+
136+
The default value of using scientific notation can be configured at field construction instead::
137+
138+
sage: RealIntervalField(53, sci_not=False)(0.5)
139+
0.50000000000000000?
140+
sage: RealIntervalField(53, sci_not=True)(0.5)
141+
5.0000000000000000?e-1
142+
123143
COMPARISONS:
124144
125145
Comparison operations (``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``)

0 commit comments

Comments
 (0)