Staging
v0.5.1
https://github.com/python/cpython
Revision 1f14ccf6d1dc4e4f5142ef8d061f9080d17b16fe authored by Guido van Rossum on 08 October 1997, 15:45:53 UTC, committed by Guido van Rossum on 08 October 1997, 15:45:53 UTC
This should make everybody happy, especially since we don't say what
the argument type is (there is disagreement on that, too :-( ).
1 parent 9b2681b
Raw File
Tip revision: 1f14ccf6d1dc4e4f5142ef8d061f9080d17b16fe authored by Guido van Rossum on 08 October 1997, 15:45:53 UTC
Put back the extern declaration for strdup(), between #ifndef MS_WINDOWS.
Tip revision: 1f14ccf
hypot.c
/* hypot() replacement */

#include "config.h"
#include "myproto.h"
#include "mymath.h"

double hypot(x, y)
	double x;
	double y;
{
	double yx;

	x = fabs(x);
	y = fabs(y);
	if (x < y) {
		double temp = x;
		x = y;
		y = temp;
	}
	if (x == 0.)
		return 0.;
	else {
		yx = y/x;
		return x*sqrt(1.+yx*yx);
	}
}
back to top