Staging
v0.8.1
https://github.com/python/cpython
Revision dc39bc64d415793ebddfc5774e1a79f03936f5f5 authored by Fred Drake on 12 May 2003, 13:50:41 UTC, committed by Fred Drake on 12 May 2003, 13:50:41 UTC
1 parent d8136b5
Raw File
Tip revision: dc39bc64d415793ebddfc5774e1a79f03936f5f5 authored by Fred Drake on 12 May 2003, 13:50:41 UTC
Add a specific mention of the term "operator overloading" and add an
Tip revision: dc39bc6
hypot.c
/* hypot() replacement */

#include "pyconfig.h"
#include "pyport.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