compatibility after r59671 made them return integral types.
def testCeil(self):
self.assertRaises(TypeError, math.ceil)
+ # These types will be int in py3k.
+ self.assertEquals(float, type(math.ceil(1)))
+ self.assertEquals(float, type(math.ceil(1L)))
+ self.assertEquals(float, type(math.ceil(1.0)))
self.ftest('ceil(0.5)', math.ceil(0.5), 1)
self.ftest('ceil(1.0)', math.ceil(1.0), 1)
self.ftest('ceil(1.5)', math.ceil(1.5), 2)
def testFloor(self):
self.assertRaises(TypeError, math.floor)
+ # These types will be int in py3k.
+ self.assertEquals(float, type(math.floor(1)))
+ self.assertEquals(float, type(math.floor(1L)))
+ self.assertEquals(float, type(math.floor(1.0)))
self.ftest('floor(0.5)', math.floor(0.5), 0)
self.ftest('floor(1.0)', math.floor(1.0), 1)
self.ftest('floor(1.5)', math.floor(1.5), 1)
"Returns self, the complex conjugate of any int."},
{"__trunc__", (PyCFunction)int_int, METH_NOARGS,
"Truncating an Integral returns itself."},
- {"__floor__", (PyCFunction)int_int, METH_NOARGS,
+ {"__floor__", (PyCFunction)int_float, METH_NOARGS,
"Flooring an Integral returns itself."},
- {"__ceil__", (PyCFunction)int_int, METH_NOARGS,
+ {"__ceil__", (PyCFunction)int_float, METH_NOARGS,
"Ceiling of an Integral returns itself."},
{"__round__", (PyCFunction)int_round, METH_VARARGS,
"Rounding an Integral returns itself.\n"
"Returns self, the complex conjugate of any long."},
{"__trunc__", (PyCFunction)long_long, METH_NOARGS,
"Truncating an Integral returns itself."},
- {"__floor__", (PyCFunction)long_long, METH_NOARGS,
+ {"__floor__", (PyCFunction)long_float, METH_NOARGS,
"Flooring an Integral returns itself."},
- {"__ceil__", (PyCFunction)long_long, METH_NOARGS,
+ {"__ceil__", (PyCFunction)long_float, METH_NOARGS,
"Ceiling of an Integral returns itself."},
{"__round__", (PyCFunction)long_round, METH_VARARGS,
"Rounding an Integral returns itself.\n"