[Python-checkins] CVS: python/dist/src/Modules cmathmodule.c,2.21,2.22
Tim Peters
tim_one@users.sourceforge.net
Tue, 20 Feb 2001 12:36:40 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv28709/python/dist/src/Modules
Modified Files:
cmathmodule.c
Log Message:
Rename some constants for easier readability.
Index: cmathmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cmathmodule.c,v
retrieving revision 2.21
retrieving revision 2.22
diff -C2 -r2.21 -r2.22
*** cmathmodule.c 2001/02/20 20:15:19 2.21
--- cmathmodule.c 2001/02/20 20:36:38 2.22
***************
*** 25,32 ****
/* constants */
! static Py_complex c_1 = {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};
/* forward declarations */
--- 25,32 ----
/* constants */
! 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_halfi = {0., 0.5};
/* forward declarations */
***************
*** 40,44 ****
{
return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,
! c_sqrt(c_diff(c_1,c_prod(x,x))))))));
}
--- 40,44 ----
{
return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,
! c_sqrt(c_diff(c_one,c_prod(x,x))))))));
}
***************
*** 54,59 ****
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)))));
return c_sum(z, z);
}
--- 54,59 ----
Py_complex z;
z = c_sqrt(c_half);
! 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);
}
***************
*** 86,90 ****
/* Break up long expression for WATCOM */
Py_complex z;
! z = c_sum(c_1,c_prod(x, x));
return c_log(c_sum(c_sqrt(z), x));
}
--- 86,90 ----
/* Break up long expression for WATCOM */
Py_complex z;
! z = c_sum(c_one, c_prod(x, x));
return c_log(c_sum(c_sqrt(z), x));
}
***************
*** 99,103 ****
c_atan(Py_complex x)
{
! return c_prod(c_i2,c_log(c_quot(c_sum(c_i,x),c_diff(c_i,x))));
}
--- 99,103 ----
c_atan(Py_complex x)
{
! return c_prod(c_halfi,c_log(c_quot(c_sum(c_i,x),c_diff(c_i,x))));
}
***************
*** 111,115 ****
c_atanh(Py_complex x)
{
! return c_prod(c_half,c_log(c_quot(c_sum(c_1,x),c_diff(c_1,x))));
}
--- 111,115 ----
c_atanh(Py_complex x)
{
! return c_prod(c_half,c_log(c_quot(c_sum(c_one,x),c_diff(c_one,x))));
}