projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98b976a
)
Minor improvement to code clarity (GH-9036)
author
Raymond Hettinger
<rhettinger@users.noreply.github.com>
Sun, 2 Sep 2018 20:34:21 +0000
(13:34 -0700)
committer
GitHub
<noreply@github.com>
Sun, 2 Sep 2018 20:34:21 +0000
(13:34 -0700)
Make it clear that the n==0 case is included. Otherwise, you have to know that max==0.0 whenever n==0.
Modules/mathmodule.c
patch
|
blob
|
history
diff --git
a/Modules/mathmodule.c
b/Modules/mathmodule.c
index 8015a95d2aa74624a9efc7add37af60a621d790f..06a969cebacb29561da605be4d4e9f1c77f6f861 100644
(file)
--- a/
Modules/mathmodule.c
+++ b/
Modules/mathmodule.c
@@
-2074,7
+2074,7
@@
vector_norm(Py_ssize_t n, double *vec, double max, int found_nan)
if (found_nan) {
return Py_NAN;
}
- if (max == 0.0 || n
=
= 1) {
+ if (max == 0.0 || n
<
= 1) {
return max;
}
for (i=0 ; i < n ; i++) {