Visitar URL original
bpo-38629: implement __floor__ and __ceil__ for float by isidentical · Pull Request #16985 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update generated files
  • Loading branch information
isidentical committed Oct 30, 2019
commit e1ac18c44e005e66e0c1c8505c8dd2b9d337ceae
6 changes: 3 additions & 3 deletions Objects/clinic/floatobject.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Objects/floatobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ Return the floor as an Integral.

static PyObject *
float___floor___impl(PyObject *self)
/*[clinic end generated code: output=e0551dbaea8c01d1 input=38c8fb1dd0b579b4]*/
/*[clinic end generated code: output=e0551dbaea8c01d1 input=77bb13eb12e268df]*/
{
double x = PyFloat_AsDouble(self);
Comment thread
isidentical marked this conversation as resolved.
Outdated
return PyLong_FromDouble(floor(x));
Expand All @@ -945,7 +945,7 @@ Return the ceiling as an Integral.

static PyObject *
float___ceil___impl(PyObject *self)
/*[clinic end generated code: output=a2fd8858f73736f9 input=e3d4c94c2b8c8675]*/
/*[clinic end generated code: output=a2fd8858f73736f9 input=79e41ae94aa0a516]*/
{
double x = PyFloat_AsDouble(self);
return PyLong_FromDouble(ceil(x));
Expand Down