# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1178773777 25200
# Node ID 1bf81c6cbca699e1df4b606ec1192acb7fe479ef
# Parent  f3edebddf45ade3d66430bff9d45fbb2936ad720
Fix a bug in ceil/floor that Robert Miller found.

diff -r f3edebddf45a -r 1bf81c6cbca6 sage/calculus/calculus.py
--- a/sage/calculus/calculus.py	Wed May 09 16:04:48 2007 -0700
+++ b/sage/calculus/calculus.py	Wed May 09 22:09:37 2007 -0700
@@ -3521,8 +3521,8 @@ class Function_ceil(PrimitiveFunction):
         try:
             return x.ceil()
         except AttributeError:
-            if isinstance(x, float):
-                return math.ceil(x)
+            if isinstance(x, (float, int, long, complex)):
+                return int(math.ceil(x))
         return SymbolicComposition(self, SR(x))
 
 ceil = Function_ceil()
@@ -3560,8 +3560,8 @@ class Function_floor(PrimitiveFunction):
         try:
             return x.floor()
         except AttributeError:
-            if isinstance(x, float):
-                return math.floor(x)
+            if isinstance(x, (float, int, long, complex)):
+                return int(math.floor(x))
         return SymbolicComposition(self, SR(x))
 
 floor = Function_floor()
