Changeset 4393:1bf81c6cbca6


Ignore:
Timestamp:
05/09/07 22:09:37 (6 years ago)
Author:
William Stein <wstein@…>
Branch:
default
Children:
4394:f9c0bd1ddcc8, 4395:f08253cc52b2
Message:

Fix a bug in ceil/floor that Robert Miller found.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/calculus/calculus.py

    r4313 r4393  
    35223522            return x.ceil() 
    35233523        except AttributeError: 
    3524             if isinstance(x, float): 
    3525                 return math.ceil(x) 
     3524            if isinstance(x, (float, int, long, complex)): 
     3525                return int(math.ceil(x)) 
    35263526        return SymbolicComposition(self, SR(x)) 
    35273527 
     
    35613561            return x.floor() 
    35623562        except AttributeError: 
    3563             if isinstance(x, float): 
    3564                 return math.floor(x) 
     3563            if isinstance(x, (float, int, long, complex)): 
     3564                return int(math.floor(x)) 
    35653565        return SymbolicComposition(self, SR(x)) 
    35663566 
Note: See TracChangeset for help on using the changeset viewer.