# HG changeset patch
# User Paul Zimmermann <zimmerma@loria.fr>
# Date 1267176693 -3600
# Node ID 71d58a1b93df10913b1c70ccde833674847e1d1a
# Parent  999ff92c039d44c20d356e18016b6de7d91b020d
added examples to show how to use rounding modes with RealField (#8376)

diff -r 999ff92c039d -r 71d58a1b93df sage/rings/real_mpfr.pyx
--- a/sage/rings/real_mpfr.pyx	Sun Jan 17 16:35:13 2010 +0100
+++ b/sage/rings/real_mpfr.pyx	Fri Feb 26 10:31:33 2010 +0100
@@ -216,15 +216,15 @@
     
     -  ``rnd`` - (string) the rounding mode
 
-      - RNDN - (default) round to nearest (ties go to the even number):
+      - 'RNDN' - (default) round to nearest (ties go to the even number):
         Knuth says this is the best choice to prevent "floating point
         drift".
 
-      - RNDD - round towards minus infinity
-
-      - RNDZ - round towards zero
-
-      - RNDU - round towards plus infinity
+      - 'RNDD' - round towards minus infinity
+
+      - 'RNDZ' - round towards zero
+
+      - 'RNDU' - round towards plus infinity
     
     EXAMPLES::
     
@@ -234,6 +234,15 @@
         Real Field with 53 bits of precision
         sage: RealField(100000)
         Real Field with 100000 bits of precision
+
+    Here we show the effect of rounding::
+
+        sage: R17d = RealField(17,rnd='RNDD')
+        sage: a = R17d(1)/R17d(3); a.exact_rational()
+        87381/262144
+        sage: R17u = RealField(17,rnd='RNDU')
+        sage: a = R17u(1)/R17u(3); a.exact_rational()
+        43691/131072
     
     .. note::
 
