gcalctool r2283 - trunk/gcalctool
- From: kniederk svn gnome org
- To: svn-commits-list gnome org
- Subject: gcalctool r2283 - trunk/gcalctool
- Date: Sun, 26 Oct 2008 14:30:39 +0000 (UTC)
Author: kniederk
Date: Sun Oct 26 14:30:39 2008
New Revision: 2283
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2283&view=rev
Log:
reduce use of mpadd2 in favor of mp_add
Modified:
trunk/gcalctool/mp-internal.h
trunk/gcalctool/mp-trigonometric.c
trunk/gcalctool/mp.c
Modified: trunk/gcalctool/mp-internal.h
==============================================================================
--- trunk/gcalctool/mp-internal.h (original)
+++ trunk/gcalctool/mp-internal.h Sun Oct 26 14:30:39 2008
@@ -36,7 +36,6 @@
void mpexp1(const int *, int *);
void mpmulq(int *, int, int, int *);
void mp_reciprocal(const int *, int *);
-void mpadd2(const int *, const int *, int *, int, int);
void mp_atan1N(int n, int *z);
#endif /* MP_INTERNAL_H */
Modified: trunk/gcalctool/mp-trigonometric.c
==============================================================================
--- trunk/gcalctool/mp-trigonometric.c (original)
+++ trunk/gcalctool/mp-trigonometric.c Sun Oct 26 14:30:39 2008
@@ -122,7 +122,7 @@
i += 2;
MP.t = ts;
- mpadd2(&MP.r[i2 - 1], z, z, *z, 0);
+ mp_add(&MP.r[i2 - 1], z, z);
} while(MP.r[i2 - 1] != 0);
MP.t = ts;
Modified: trunk/gcalctool/mp.c
==============================================================================
--- trunk/gcalctool/mp.c (original)
+++ trunk/gcalctool/mp.c Sun Oct 26 14:30:39 2008
@@ -30,6 +30,7 @@
static int mp_compare_mp_to_float(const int *, float);
static int pow_ii(int, int);
+static void mpadd2(const int *, const int *, int *, int, int);
static int mpadd3(const int *, const int *, int, int);
static void mpext(int, int, int *);
static void mplns(const int *, int *);
@@ -65,7 +66,7 @@
* 16(1973), 223. (SEE ALSO BRENT, IEEE TC-22(1973), 601.)
* CHECK FOR X OR Y ZERO
*/
-void
+static void
mpadd2(const int *x, const int *y, int *z, int y_sign, int trunc)
{
int sign_prod;
@@ -88,7 +89,8 @@
sign_prod = y_sign * x[0];
if (abs(sign_prod) > 1) {
mpchk(1, 4);
- mperr("*** SIGN NOT 0, +1 OR -1 IN MPADD2 CALL.\nPOSSIBLE OVERWRITING PROBLEM ***\n");
+ mperr("*** SIGN NOT 0, +1 OR -1 IN MPADD2 CALL.\n"
+ "POSSIBLE OVERWRITING PROBLEM ***\n");
z[0] = 0;
return;
}
@@ -903,8 +905,7 @@
++i;
mpdivi(&MP.r[i2 - 1], i * xs, &MP.r[i2 - 1]);
MP.t = ts;
- mpadd2(&MP.r[i3 - 1], &MP.r[i2 - 1], &MP.r[i3 - 1],
- MP.r[i2 - 1], 0);
+ mp_add(&MP.r[i3 - 1], &MP.r[i2 - 1], &MP.r[i3 - 1]);
} while (MP.r[i2 - 1] != 0);
/* RAISE E OR 1/E TO POWER IX */
@@ -1032,7 +1033,7 @@
++i;
mpdivi(&MP.r[i3 - 1], i, &MP.r[i3 - 1]);
MP.t = ts;
- mpadd2(&MP.r[i3 - 1], y, y, y[0], 0);
+ mp_add(&MP.r[i3 - 1], y, y);
} while (MP.r[i3 - 1] != 0);
MP.t = ts;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]