Mercurial > cpython-lru_cache-weakref
view Python/hypot.c @ 43848:e162e881ea5f
Moved the initalization of the exception before the initialization of sys.
On Windows _PySys_Init() could raise an uninitialized exception which leads to a seg fault.
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Wed, 14 Nov 2007 00:16:07 +0000 |
| parents | 7bc4cc972b0b |
| children | ef859cd754a7 |
line wrap: on
line source
/* hypot() replacement */ #include "Python.h" double hypot(double x, double y) { double yx; x = fabs(x); y = fabs(y); if (x < y) { double temp = x; x = y; y = temp; } if (x == 0.) return 0.; else { yx = y/x; return x*sqrt(1.+yx*yx); } }
