diff options
author | Ondřej Bílka <neleai@seznam.cz> | 2013-10-17 16:03:24 +0200 |
---|---|---|
committer | Ondřej Bílka <neleai@seznam.cz> | 2013-10-17 16:03:24 +0200 |
commit | c5d5d574cbfa96d0f6c1db24d1e072c472627e41 (patch) | |
tree | 83b97e29ee65636dfe1247ea8d2344ca3f0b04b4 /sysdeps/ieee754/dbl-64/mpa.c | |
parent | e5c2c2d0c0315ca24cc9cd638cdb1a2d8dcc4b0d (diff) | |
download | glibc-c5d5d574cbfa96d0f6c1db24d1e072c472627e41.tar.gz glibc-c5d5d574cbfa96d0f6c1db24d1e072c472627e41.tar.xz glibc-c5d5d574cbfa96d0f6c1db24d1e072c472627e41.zip |
Format floating routines.
Diffstat (limited to 'sysdeps/ieee754/dbl-64/mpa.c')
-rw-r--r-- | sysdeps/ieee754/dbl-64/mpa.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sysdeps/ieee754/dbl-64/mpa.c b/sysdeps/ieee754/dbl-64/mpa.c index a3feb175ed..190e8a6373 100644 --- a/sysdeps/ieee754/dbl-64/mpa.c +++ b/sysdeps/ieee754/dbl-64/mpa.c @@ -50,8 +50,8 @@ #endif #ifndef NO__CONST -const mp_no mpone = {1, {1.0, 1.0}}; -const mp_no mptwo = {1, {1.0, 2.0}}; +const mp_no mpone = { 1, { 1.0, 1.0 } }; +const mp_no mptwo = { 1, { 1.0, 2.0 } }; #endif #ifndef NO___ACR @@ -123,7 +123,7 @@ __cpy (const mp_no *x, mp_no *y, int p) static void norm (const mp_no *x, double *y, int p) { -#define R RADIXI +# define R RADIXI long i; double c; mantissa_t a, u, v, z[5]; @@ -140,7 +140,7 @@ norm (const mp_no *x, double *y, int p) } else { - for (a = 1, z[1] = X[1]; z[1] < TWO23;) + for (a = 1, z[1] = X[1]; z[1] < TWO23; ) { a *= 2; z[1] *= 2; @@ -188,7 +188,7 @@ norm (const mp_no *x, double *y, int p) c *= RADIXI; *y = c; -#undef R +# undef R } /* Convert a multiple precision number *X into a double precision @@ -201,7 +201,7 @@ denorm (const mp_no *x, double *y, int p) double c; mantissa_t u, z[5]; -#define R RADIXI +# define R RADIXI if (EX < -44 || (EX == -44 && X[1] < TWO5)) { *y = 0; @@ -298,7 +298,7 @@ denorm (const mp_no *x, double *y, int p) c = X[0] * ((z[1] + R * (z[2] + R * z[3])) - TWO10); *y = c * TWOM1032; -#undef R +# undef R } /* Convert multiple precision number *X into double precision number *Y. The @@ -394,7 +394,7 @@ add_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p) zk = 1; } else - { + { Z[k--] = zk; zk = 0; } @@ -409,7 +409,7 @@ add_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p) zk = 1; } else - { + { Z[k--] = zk; zk = 0; } @@ -471,7 +471,7 @@ sub_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p) zk = -1; } else - { + { Z[k--] = zk; zk = 0; } @@ -487,18 +487,19 @@ sub_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p) zk = -1; } else - { + { Z[k--] = zk; zk = 0; } } /* Normalize. */ - for (i = 1; Z[i] == 0; i++); + for (i = 1; Z[i] == 0; i++) + ; EZ = EZ - i + 1; - for (k = 1; i <= p2 + 1;) + for (k = 1; i <= p2 + 1; ) Z[k++] = Z[i++]; - for (; k <= p2;) + for (; k <= p2; ) Z[k++] = 0; } |