home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre1.z / postgre1 / demo / boxarea.c next >
Encoding:
Text File  |  1992-08-27  |  267 b   |  19 lines

  1. typedef struct {
  2.     double  xh, yh, xl, yl;     /* high and low coords */
  3. } BOX;
  4.  
  5. #define ABS(X) ((X) > 0 ? (X) : -(X))
  6.  
  7. int
  8. boxarea(box)
  9.  
  10. BOX *box;
  11.  
  12. {
  13.     int width, height;
  14.  
  15.     width  = ABS(box->xh - box->xl);
  16.     height = ABS(box->yh - box->yl);
  17.     return (width * height);
  18. }
  19.