This commit was generated by cvs2svn to compensate for changes in r112415,

which included commits to RCS files with non-trunk default branches.
This commit is contained in:
David Schultz 2003-03-19 20:23:29 +00:00
commit e8b59c3f5d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112416
5 changed files with 29 additions and 51 deletions

View File

@ -313,6 +313,10 @@ bit fpi->nbits in the bits array on. Denormals have it off, with
exponent = fpi->emin. Strtodg provides distinct return values for normals
and denormals; see gdtoa.h.
Compiling g__fmt.c, strtod.c, and strtodg.c with -DUSE_LOCALE causes
the decimal-point character to be taken from the current locale; otherwise
it is '.'.
Please send comments to
David M. Gay

View File

@ -37,6 +37,10 @@ THIS SOFTWARE.
#include "gdtoaimp.h"
#ifdef USE_LOCALE
#include "locale.h"
#endif
char *
#ifdef KR_headers
g__fmt(b, s, se, decpt, sign) char *b; char *s; char *se; int decpt; ULong sign;
@ -46,13 +50,17 @@ g__fmt(char *b, char *s, char *se, int decpt, ULong sign)
{
int i, j, k;
char *s0 = s;
#ifdef USE_LOCALE
char decimalpoint = *localeconv()->decimal_point;
#else
#define decimalpoint '.'
#endif
if (sign)
*b++ = '-';
if (decpt <= -4 || decpt > se - s + 5) {
*b++ = *s++;
if (*s) {
*b++ = '.';
*b++ = decimalpoint;
while((*b = *s++) !=0)
b++;
}
@ -76,7 +84,7 @@ g__fmt(char *b, char *s, char *se, int decpt, ULong sign)
*b = 0;
}
else if (decpt <= 0) {
*b++ = '.';
*b++ = decimalpoint;
for(; decpt < 0; decpt++)
*b++ = '0';
while((*b = *s++) !=0)
@ -86,7 +94,7 @@ g__fmt(char *b, char *s, char *se, int decpt, ULong sign)
while((*b = *s++) !=0) {
b++;
if (--decpt == 0 && *s)
*b++ = '.';
*b++ = decimalpoint;
}
for(; decpt > 0; decpt--)
*b++ = '0';

View File

@ -85,9 +85,6 @@ strtod
#ifdef Honor_FLT_ROUNDS
int rounding;
#endif
#ifdef USE_LOCALE
CONST char *s2;
#endif
sign = nz0 = nz = 0;
dval(rv) = 0.;
@ -150,25 +147,11 @@ strtod
z = 10*z + c - '0';
nd0 = nd;
#ifdef USE_LOCALE
s1 = localeconv()->decimal_point;
if (c == *s1) {
c = '.';
if (*++s1) {
s2 = s;
for(;;) {
if (*++s2 != *s1) {
c = 0;
break;
}
if (!*++s1) {
s = s2;
break;
}
}
}
}
if (c == *localeconv()->decimal_point)
#else
if (c == '.')
#endif
if (c == '.') {
{
c = *++s;
if (!nd) {
for(; c == '0'; c = *++s)

View File

@ -59,9 +59,6 @@ increment(Bigint *b)
{
ULong *x, *xe;
Bigint *b1;
#ifdef USE_LOCALE
CONST char *s2;
#endif
#ifdef Pack_16
ULong carry = 1, y;
#endif
@ -399,25 +396,11 @@ strtodg
z = 10*z + c - '0';
nd0 = nd;
#ifdef USE_LOCALE
s1 = localeconv()->decimal_point;
if (c == *s1) {
c = '.';
if (*++s1) {
s2 = s;
for(;;) {
if (*++s2 != *s1) {
c = 0;
break;
}
if (!*++s1) {
s = s2;
break;
}
}
}
}
if (c == *localeconv()->decimal_point)
#else
if (c == '.')
#endif
if (c == '.') {
{
c = *++s;
if (!nd) {
for(; c == '0'; c = *++s)

View File

@ -1,9 +1,9 @@
README 10a65619 13093
README 7150e50 13249
arithchk.c e37b8a75 4070
dmisc.c e8d262b6 4712
dtoa.c f3c132b3 16905
g_Qfmt.c e5847e9 2870
g__fmt.c f2d66617 2355
g__fmt.c e29d67f1 2534
g_ddfmt.c fcf94527 3790
g_dfmt.c f30e55a9 2533
g_ffmt.c 7c4ea96 2459
@ -12,7 +12,7 @@ g_xfmt.c c20a5e4 2795
gdtoa.c 364a0d2 17017
gdtoa.h 1eb440de 4810
gdtoaimp.h 6a955ba 19106
gethex.c f56c1968 5041
gethex.c ff3c434d 4981
gmisc.c e1a268ea 2114
hd_init.c cf9a94e 1827
hexnan.c f53be1da 2988
@ -26,9 +26,9 @@ strtoIf.c eb75ac99 1905
strtoIg.c ec59c2fa 3484
strtoIx.c 8f8c9d 1990
strtoIxL.c 1313ff7f 1961
strtod.c 1390a957 20277
strtod.c 1ad667 20076
strtodI.c e58338e0 4062
strtodg.c 1cba0060 19769
strtodg.c 1caf3fa4 19553
strtof.c 1e7a787a 2202
strtopQ.c e232c542 2685
strtopd.c e865dc64 1701