Mercurial > cpython-lru_cache-weakref
annotate Python/hypot.c @ 17503:327efb59dbcd legacy-trunk
I am TENTATIVELY checking in Martin von Loewis's patch for the SSL
problem reported by Neil Schemenauer on python-dev on 4/12/01, wth
subject "Problem with SSL and socketmodule on Debian Potato?".
It's tentative because Moshe objected, but Martin rebutted, and Moshe
seems unavailable for comments.
(Note that with OpenSSL 0.9.6a, I get a lot of compilation warnings
for socketmodule.c -- I'm assuming I can safely ignore these until 2.1
is released.)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 13 Apr 2001 17:54:04 +0000 |
| parents | 59f8cedcf049 |
| children | 2dea40e40d9d |
| rev | line source |
|---|---|
| 4176 | 1 /* hypot() replacement */ |
| 2 | |
| 3 #include "config.h" | |
|
13761
59f8cedcf049
merge Include/my*.h into Include/pyport.h
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13658
diff
changeset
|
4 #include "pyport.h" |
| 4176 | 5 |
|
13658
f79434ee41fa
Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents:
4176
diff
changeset
|
6 double hypot(double x, double y) |
| 4176 | 7 { |
| 8 double yx; | |
| 9 | |
| 10 x = fabs(x); | |
| 11 y = fabs(y); | |
| 12 if (x < y) { | |
| 13 double temp = x; | |
| 14 x = y; | |
| 15 y = temp; | |
| 16 } | |
| 17 if (x == 0.) | |
| 18 return 0.; | |
| 19 else { | |
| 20 yx = y/x; | |
| 21 return x*sqrt(1.+yx*yx); | |
| 22 } | |
| 23 } |
