Staging
v0.8.1
https://github.com/python/cpython
Revision 0d84d13c3fcbcec7c476e76dd361a047b8a9c8d2 authored by Georg Brandl on 25 November 2007, 00:31:12 UTC, committed by Georg Brandl on 25 November 2007, 00:31:12 UTC
1 parent 5fb8eb9
Raw File
Tip revision: 0d84d13c3fcbcec7c476e76dd361a047b8a9c8d2 authored by Georg Brandl on 25 November 2007, 00:31:12 UTC
Remove unused variable.
Tip revision: 0d84d13
hypot.c
/* hypot() replacement */

#include "Python.h"

double hypot(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