Mercurial > cpython-lru_cache-weakref
comparison Python/hypot.c @ 44825:ef859cd754a7 legacy-trunk
Fixed a wrong assumption in configure.in and Include/pyport.h. The is finite function is not called isfinite() but finite(). Sorry, my fault. :)
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Sun, 20 Jan 2008 14:28:28 +0000 |
| parents | 7bc4cc972b0b |
| children |
comparison
equal
deleted
inserted
replaced
| 44824:84f1a658b231 | 44825:ef859cd754a7 |
|---|---|
| 1 /* hypot() replacement */ | 1 /* hypot() replacement */ |
| 2 | 2 |
| 3 #include "Python.h" | 3 #include "Python.h" |
| 4 | 4 |
| 5 #ifndef HAVE_HYPOT | |
| 5 double hypot(double x, double y) | 6 double hypot(double x, double y) |
| 6 { | 7 { |
| 7 double yx; | 8 double yx; |
| 8 | 9 |
| 9 x = fabs(x); | 10 x = fabs(x); |
| 18 else { | 19 else { |
| 19 yx = y/x; | 20 yx = y/x; |
| 20 return x*sqrt(1.+yx*yx); | 21 return x*sqrt(1.+yx*yx); |
| 21 } | 22 } |
| 22 } | 23 } |
| 24 #endif /* HAVE_HYPOT */ | |
| 25 |
