Index: Python/bltinmodule.c =================================================================== RCS file: /projects/cvsroot/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.117 retrieving revision 2.118 diff -c -r2.117 -r2.118 *** bltinmodule.c 1998/04/24 18:21:48 2.117 --- bltinmodule.c 1998/05/09 14:42:25 2.118 *************** *** 1488,1501 **** if (!PyArg_ParseTuple(args, "d|i:round", &x, &ndigits)) return NULL; f = 1.0; ! for (i = ndigits; --i >= 0; ) f = f*10.0; ! for (i = ndigits; ++i <= 0; ) ! f = f*0.1; if (x >= 0.0) ! return PyFloat_FromDouble(floor(x*f + 0.5) / f); else ! return PyFloat_FromDouble(ceil(x*f - 0.5) / f); } static PyObject * --- 1488,1509 ---- if (!PyArg_ParseTuple(args, "d|i:round", &x, &ndigits)) return NULL; f = 1.0; ! i = abs(ndigits); ! while (--i >= 0) f = f*10.0; ! if (ndigits < 0) ! x /= f; ! else ! x *= f; if (x >= 0.0) ! x = floor(x + 0.5); ! else ! x = ceil(x - 0.5); ! if (ndigits < 0) ! x *= f; else ! x /= f; ! return PyFloat_FromDouble(x); } static PyObject *