summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-04-18 14:59:42 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-04-18 14:59:42 (GMT)
commit1bdf7e9caba735ba404d49026dacd67636ea5c5f (patch)
tree9012599bfe03eaae427416760ab557002a4bb1e5 /Python/bltinmodule.c
parent8e5446f902c58a48796c1f0e25a263b7268afe34 (diff)
downloadcpython-1bdf7e9caba735ba404d49026dacd67636ea5c5f.zip
cpython-1bdf7e9caba735ba404d49026dacd67636ea5c5f.tar.gz
cpython-1bdf7e9caba735ba404d49026dacd67636ea5c5f.tar.bz2
Issue #1869: Fix a couple of minor round() issues.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 0f3392a5..8f6e855 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2081,10 +2081,7 @@ builtin_round(PyObject *self, PyObject *args, PyObject *kwds)
number /= f;
else
number *= f;
- if (number >= 0.0)
- number = floor(number + 0.5);
- else
- number = ceil(number - 0.5);
+ number = round(number);
if (ndigits < 0)
number *= f;
else