/ base / math / w_cabs.c
w_cabs.c
 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  
 8  #include <math.h>
 9  
10  struct complex {
11  	double x;
12  	double y;
13  };
14  
15  double
16  cabs(struct complex z)
17  {
18  	return hypot(z.x, z.y);
19  }