Skip to content

Conversation

@hauntsaninja
Copy link
Contributor

@hauntsaninja hauntsaninja commented Jul 16, 2022

}
#endif
return PyFloat_FromDouble(nextafter(x, y));
if (steps < 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can allow zero steps just fine.

PyErr_SetString(PyExc_ValueError, "steps must be >= 1");
return NULL;
}
for (i = 0; i < steps; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can support this without a loop. See this pure Python prototype for how that can work.

@hauntsaninja
Copy link
Contributor Author

Closing since Matthias' no loop suggestion is appealing, there isn't much movement on the issue and I have a merge conflict :-)

@hauntsaninja hauntsaninja deleted the gh-94906 branch December 12, 2022 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants