History

add hg and python

cinap_lenrek committed 15 years ago

Commit 4bb9e221 parent 987265c3706 files · +1228772 −-233Browse files

Showing the changes to sys/src/cmd/python/Python/hypot.c (1 of 3706 files). Show all

Unified · Split

sys/src/cmd/python/Python/hypot.c+23−0
@@ -0,0 +1,23 @@
1+/* hypot() replacement */
2+
3+#include "pyconfig.h"
4+#include "pyport.h"
5+
6+double hypot(double x, double y)
7+{
8+ double yx;
9+
10+ x = fabs(x);
11+ y = fabs(y);
12+ if (x < y) {
13+ double temp = x;
14+ x = y;
15+ y = temp;
16+ }
17+ if (x == 0.)
18+ return 0.;
19+ else {
20+ yx = y/x;
21+ return x*sqrt(1.+yx*yx);
22+ }
23+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t