diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-09 15:52:27 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-09 15:52:27 (GMT) |
commit | f95a1b3c53bdd678b64aa608d4375660033460c3 (patch) | |
tree | a8bee40b1b14e28ff5978ea519f3035a3c399912 /Python/pymath.c | |
parent | bd250300191133d276a71b395b6428081bf825b8 (diff) | |
download | cpython-f95a1b3c53bdd678b64aa608d4375660033460c3.zip cpython-f95a1b3c53bdd678b64aa608d4375660033460c3.tar.gz cpython-f95a1b3c53bdd678b64aa608d4375660033460c3.tar.bz2 |
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
Diffstat (limited to 'Python/pymath.c')
-rw-r--r-- | Python/pymath.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/Python/pymath.c b/Python/pymath.c index 83105f2..827a773 100644 --- a/Python/pymath.c +++ b/Python/pymath.c @@ -7,9 +7,9 @@ thus rounding from extended precision to double precision. */ double _Py_force_double(double x) { - volatile double y; - y = x; - return y; + volatile double y; + y = x; + return y; } #endif @@ -34,21 +34,21 @@ void _Py_set_387controlword(unsigned short cw) { #ifndef HAVE_HYPOT double hypot(double x, double y) { - double yx; + 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); - } + 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); + } } #endif /* HAVE_HYPOT */ @@ -56,12 +56,12 @@ double hypot(double x, double y) double copysign(double x, double y) { - /* use atan2 to distinguish -0. from 0. */ - if (y > 0. || (y == 0. && atan2(y, -1.) > 0.)) { - return fabs(x); - } else { - return -fabs(x); - } + /* use atan2 to distinguish -0. from 0. */ + if (y > 0. || (y == 0. && atan2(y, -1.) > 0.)) { + return fabs(x); + } else { + return -fabs(x); + } } #endif /* HAVE_COPYSIGN */ @@ -73,7 +73,7 @@ round(double x) absx = fabs(x); y = floor(absx); if (absx - y >= 0.5) - y += 1.0; + y += 1.0; return copysign(y, x); } #endif /* HAVE_ROUND */ |