annotate Python/hypot.c @ 8553:4357b4eb5c19
legacy-trunk
Mac version of freeze. Uses standard freeze modules where it can,
augmenting them here and there. For now, it works more-or-less similar
to unix/windows freeze, generating a config.c file, but storing
modules in PYC resources. A template project is also copied.
The hooks are in place to freeze by merging shared libraries so you
can freeze without a C compiler/linker, but this does not work yet.
| author |
Jack Jansen <jack.jansen@cwi.nl> |
| date |
Fri, 26 Jun 1998 14:56:00 +0000 |
| parents |
37d009b1bf45 |
| children |
f79434ee41fa |
| rev |
line source |
|
4176
|
1 /* hypot() replacement */
|
|
|
2
|
|
|
3 #include "config.h"
|
|
|
4 #include "myproto.h"
|
|
|
5 #include "mymath.h"
|
|
|
6
|
|
|
7 double hypot(x, y)
|
|
|
8 double x;
|
|
|
9 double y;
|
|
|
10 {
|
|
|
11 double yx;
|
|
|
12
|
|
|
13 x = fabs(x);
|
|
|
14 y = fabs(y);
|
|
|
15 if (x < y) {
|
|
|
16 double temp = x;
|
|
|
17 x = y;
|
|
|
18 y = temp;
|
|
|
19 }
|
|
|
20 if (x == 0.)
|
|
|
21 return 0.;
|
|
|
22 else {
|
|
|
23 yx = y/x;
|
|
|
24 return x*sqrt(1.+yx*yx);
|
|
|
25 }
|
|
|
26 }
|