Subversion Repositories shark

Rev

Rev 1619 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * cabs() wrapper for hypot().
3
 *
4
 * Written by J.T. Conklin, <jtc@wimsey.com>
5
 * Placed into the Public Domain, 1994.
6
 */
7
 
1621 fabio 8
#include "math.h"
2 pj 9
 
10
struct complex {
11
        double x;
12
        double y;
13
};
14
 
15
double
16
cabs(z)
17
        struct complex z;
18
{
19
        return hypot(z.x, z.y);
20
}
21
 
22
double
23
z_abs(z)
24
        struct complex *z;
25
{
26
        return hypot(z->x, z->y);
27
}