• Main Page
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

missing/hypot.c

Go to the documentation of this file.
00001 /* public domain rewrite of hypot */
00002 
00003 #include <math.h>
00004 
00005 double hypot(double x, double y)
00006 {
00007     if (x < 0) x = -x;
00008     if (y < 0) y = -y;
00009     if (x < y) {
00010         double tmp = x;
00011         x = y; y = tmp;
00012     }
00013     if (y == 0.0) return x;
00014     y /= x;
00015     return x * sqrt(1.0+y*y);
00016 }
00017 

Generated on Wed Sep 8 2010 21:54:59 for Ruby by  doxygen 1.7.1