Mercurial > cpython-lru_cache-weakref
diff Modules/cmathmodule.c @ 16708:57799f013aad legacy-trunk
Rename some constants for easier readability.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Tue, 20 Feb 2001 20:36:38 +0000 |
| parents | 9696c95d09b7 |
| children | cc338a5c16e5 |
line wrap: on
line diff
--- a/Modules/cmathmodule.c Tue Feb 20 20:15:19 2001 +0000 +++ b/Modules/cmathmodule.c Tue Feb 20 20:36:38 2001 +0000 @@ -24,10 +24,10 @@ /* First, the C functions that do the real work */ /* constants */ -static Py_complex c_1 = {1., 0.}; +static Py_complex c_one = {1., 0.}; static Py_complex c_half = {0.5, 0.}; static Py_complex c_i = {0., 1.}; -static Py_complex c_i2 = {0., 0.5}; +static Py_complex c_halfi = {0., 0.5}; /* forward declarations */ staticforward Py_complex c_log(Py_complex); @@ -39,7 +39,7 @@ c_acos(Py_complex x) { return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i, - c_sqrt(c_diff(c_1,c_prod(x,x)))))))); + c_sqrt(c_diff(c_one,c_prod(x,x)))))))); } static char c_acos_doc[] = @@ -53,8 +53,8 @@ { Py_complex z; z = c_sqrt(c_half); - z = c_log(c_prod(z, c_sum(c_sqrt(c_sum(x,c_1)), - c_sqrt(c_diff(x,c_1))))); + z = c_log(c_prod(z, c_sum(c_sqrt(c_sum(x,c_one)), + c_sqrt(c_diff(x,c_one))))); return c_sum(z, z); } @@ -85,7 +85,7 @@ { /* Break up long expression for WATCOM */ Py_complex z; - z = c_sum(c_1,c_prod(x, x)); + z = c_sum(c_one, c_prod(x, x)); return c_log(c_sum(c_sqrt(z), x)); } @@ -98,7 +98,7 @@ static Py_complex c_atan(Py_complex x) { - return c_prod(c_i2,c_log(c_quot(c_sum(c_i,x),c_diff(c_i,x)))); + return c_prod(c_halfi,c_log(c_quot(c_sum(c_i,x),c_diff(c_i,x)))); } static char c_atan_doc[] = @@ -110,7 +110,7 @@ static Py_complex c_atanh(Py_complex x) { - return c_prod(c_half,c_log(c_quot(c_sum(c_1,x),c_diff(c_1,x)))); + return c_prod(c_half,c_log(c_quot(c_sum(c_one,x),c_diff(c_one,x)))); } static char c_atanh_doc[] =
