8000 use PyFloat_AS_DOUBLE for getting direct value without checking · python/cpython@40db4db · GitHub
[go: up one dir, main page]

Skip to content

Commit 40db4db

Browse files
committed
use PyFloat_AS_DOUBLE for getting direct value without checking
1 parent e1ac18c commit 40db4db

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Implementation of missing floor and ceil methods to float object -- by
2-
Batuhan Taskaya.
1+
Added ``__floor__`` and ``__ceil__`` methods to float object. Patch by Batuhan Taşkaya.

Objects/floatobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ static PyObject *
933933
float___floor___impl(PyObject *self)
934934
/*[clinic end generated code: output=e0551dbaea8c01d1 input=77bb13eb12e268df]*/
935935
{
936-
double x = PyFloat_AsDouble(self);
936+
double x = PyFloat_AS_DOUBLE(self);
937937
return PyLong_FromDouble(floor(x));
938938
}
939939

@@ -947,7 +947,7 @@ static PyObject *
947947
float___ceil___impl(PyObject *self)
948948
/*[clinic end generated code: output=a2fd8858f73736f9 input=79e41ae94aa0a516]*/
949949
{
950-
double x = PyFloat_AsDouble(self);
950+
double x = PyFloat_AS_DOUBLE(self);
951951
return PyLong_FromDouble(ceil(x));
952952
}
953953

0 commit comments

Comments
 (0)
0