Ticket #7819: trac_7819.patch

File trac_7819.patch, 1.0 KB (added by rlm, 12 years ago)
  • sage/rings/real_mpfi.pyx

    # HG changeset patch
    # User Robert L. Miller <rlm@rlmiller.org>
    # Date 1262444598 28800
    # Node ID 11e3cf271faf3cc068afb560f0659918ec599924
    # Parent  2093aa5e6e82a04e3d5e8f1ee5961464c56b0279
    Add check to RIF elements to check for NaN or oo
    
    diff -r 2093aa5e6e82 -r 11e3cf271faf sage/rings/real_mpfi.pyx
    a b  
    34373437            sage: a = RIF(0.1, 1.9)
    34383438            sage: a.is_int()
    34393439            (True, 1)
    3440         """
    3441         a = (self.lower()).ceil()
    3442         b = (self.upper()).floor()
     3440            sage: RIF(+infinity,+infinity).is_int()
     3441            (False, None)
     3442        """
     3443        a = self.lower()
     3444        if a.is_NaN() or a.is_infinity():
     3445            return False, None
     3446        a = a.ceil()
     3447        b = self.upper()
     3448        if b.is_NaN() or b.is_infinity():
     3449            return False, None
     3450        b = b.floor()
    34433451        if a == b:
    34443452            return True, a
    34453453        else: