bpo-33089: Add math.dist() for computing the Euclidean distance between two points#8561
bpo-33089: Add math.dist() for computing the Euclidean distance between two points#8561rhettinger merged 11 commits intopython:masterfrom
Conversation
Modules/mathmodule.c
Outdated
|
|
||
| } | ||
| diffs = (double *) PyObject_Malloc(n * sizeof(double)); | ||
| if (diffs == NULL) |
There was a problem hiding this comment.
Braces are required here (PEP7).
| diffs = (double *) PyObject_Malloc(n * sizeof(double)); | ||
| if (diffs == NULL) | ||
| return NULL; | ||
| for (i=0 ; i<n ; i++) { |
There was a problem hiding this comment.
Always put spaces around assignment, Boolean and comparison operators (PEP7).
There was a problem hiding this comment.
Historically, we haven't done this inside for-loops.
| result = 0.0; | ||
| goto done; | ||
| } | ||
| for (i=0 ; i<n ; i++) { |
There was a problem hiding this comment.
Always put spaces around assignment, Boolean and comparison operators (PEP7).
There was a problem hiding this comment.
Historically, we haven't done this inside for-loops.
|
Hi, thanks for a great language. Not sure if this is the right place to add this comment. Anyways, was adding other norms ever under consideration? For instance, |
https://bugs.python.org/issue33089