Ticket #8157: trac_8157-doctest.patch

File trac_8157-doctest.patch, 922 bytes (added by AlexGhitza, 12 years ago)

apply after the first patch

  • sage/rings/real_mpfr.pyx

    # HG changeset patch
    # User Alexandru Ghitza <aghitza@alum.mit.edu>
    # Date 1267093866 -39600
    # Node ID fe532b4eae13b532ee8905eb87d48527983f69cb
    # Parent  c4fb7fe67868e8683bb28d84016bbef88f11700f
    trac #8157: add doctests
    
    diff -r c4fb7fe67868 -r fe532b4eae13 sage/rings/real_mpfr.pyx
    a b  
    179179
    180180cdef int MY_MPFR_PREC_MAX = 2147483647
    181181def mpfr_prec_max():
     182    """
     183    TESTS::
     184
     185        sage: R = RealField(2147483647)
     186        sage: R
     187        Real Field with 2147483647 bits of precision
     188        sage: R = RealField(2147483648)
     189        Traceback (most recent call last):
     190        ...
     191        OverflowError: ... too large to convert to int
     192    """
    182193    global MY_MPFR_PREC_MAX
    183194    # We use 2^31-1 as the largest precision, since 2^31 is not representable
    184195    # as a 32-bit int