mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Add more tests and assertions for math.hypot() and math.dist() (GH-8747)
This commit is contained in:
parent
4d12e4dc28
commit
00414597b4
2 changed files with 13 additions and 5 deletions
|
|
@ -2071,6 +2071,7 @@ vector_norm(Py_ssize_t n, double *vec, double max, int found_nan)
|
|||
assert(n > 0);
|
||||
for (i=0 ; i < n-1 ; i++) {
|
||||
x = vec[i];
|
||||
assert(Py_IS_FINITE(x) && x >= 0.0 && x <= max);
|
||||
if (x == max) {
|
||||
x = vec[n-1];
|
||||
vec[n-1] = max;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue