Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a0c619b

Browse filesBrowse files
committed
Add asserts
1 parent 59a5422 commit a0c619b
Copy full SHA for a0c619b

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎Modules/mathmodule.c

Copy file name to clipboardExpand all lines: Modules/mathmodule.c
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2935,7 +2935,8 @@ math_pow_impl(PyObject *module, double x, double y)
29352935
else /* y < 0. */
29362936
r = odd_y ? copysign(0., x) : 0.;
29372937
}
2938-
else { /* Py_IS_INFINITY(y) */
2938+
else {
2939+
assert(Py_IS_INFINITY(y));
29392940
if (fabs(x) == 1.0)
29402941
r = 1.;
29412942
else if (y > 0. && fabs(x) > 1.0)
@@ -3465,6 +3466,8 @@ static const uint8_t factorial_trailing_zeros[] = {
34653466
static PyObject *
34663467
perm_comb_small(unsigned long long n, unsigned long long k, int iscomb)
34673468
{
3469+
assert(k != 0);
3470+
34683471
/* For small enough n and k the result fits in the 64-bit range and can
34693472
* be calculated without allocating intermediate PyLong objects. */
34703473
if (iscomb) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.