diff options
Diffstat (limited to 'lib/libc/gdtoa/smisc.c')
-rw-r--r-- | lib/libc/gdtoa/smisc.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/libc/gdtoa/smisc.c b/lib/libc/gdtoa/smisc.c index 6cb9d4414fa..d063a38db27 100644 --- a/lib/libc/gdtoa/smisc.c +++ b/lib/libc/gdtoa/smisc.c @@ -34,9 +34,9 @@ THIS SOFTWARE. Bigint * s2b #ifdef KR_headers - (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9; + (s, nd0, nd, y9, dplen) CONST char *s; int dplen, nd0, nd; ULong y9; #else - (CONST char *s, int nd0, int nd, ULong y9) + (CONST char *s, int nd0, int nd, ULong y9, int dplen) #endif { Bigint *b; @@ -66,16 +66,16 @@ s2b b = multadd(b, 10, *s++ - '0'); if (b == NULL) return (NULL); - } while(++i < nd0); - s++; + } while(++i < nd0); + s += dplen; } else - s += 10; + s += dplen + 9; for(; i < nd; i++) { b = multadd(b, 10, *s++ - '0'); if (b == NULL) return (NULL); - } + } return b; } @@ -87,33 +87,33 @@ ratio (Bigint *a, Bigint *b) #endif { - double da, db; + U da, db; int k, ka, kb; - dval(da) = b2d(a, &ka); - dval(db) = b2d(b, &kb); + dval(&da) = b2d(a, &ka); + dval(&db) = b2d(b, &kb); k = ka - kb + ULbits*(a->wds - b->wds); #ifdef IBM if (k > 0) { - word0(da) += (k >> 2)*Exp_msk1; + word0(&da) += (k >> 2)*Exp_msk1; if (k &= 3) - dval(da) *= 1 << k; + dval(&da) *= 1 << k; } else { k = -k; - word0(db) += (k >> 2)*Exp_msk1; + word0(&db) += (k >> 2)*Exp_msk1; if (k &= 3) - dval(db) *= 1 << k; + dval(&db) *= 1 << k; } #else if (k > 0) - word0(da) += k*Exp_msk1; + word0(&da) += k*Exp_msk1; else { k = -k; - word0(db) += k*Exp_msk1; + word0(&db) += k*Exp_msk1; } #endif - return dval(da) / dval(db); + return dval(&da) / dval(&db); } #ifdef INFNAN_CHECK |