diff options
Diffstat (limited to 'contrib/gdtoa/test/xLtest.c')
-rw-r--r-- | contrib/gdtoa/test/xLtest.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/gdtoa/test/xLtest.c b/contrib/gdtoa/test/xLtest.c index c923e19..aba0cf5 100644 --- a/contrib/gdtoa/test/xLtest.c +++ b/contrib/gdtoa/test/xLtest.c @@ -26,14 +26,8 @@ THIS SOFTWARE. ****************************************************************/ -/* Please send bug reports to - David M. Gay - Bell Laboratories, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-0636 - U.S.A. - dmg@bell-labs.com - */ +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ /* Test program for g_xLfmt, strtoIxL, strtopxL, and strtorxL. * @@ -85,7 +79,7 @@ THIS SOFTWARE. int main(Void) { - char *s, *se, *se1; + char *s, *s1, *se, *se1; int dItry, i, ndig = 0, r = 1; union { long double d; ULong bits[3]; } u, v[2]; @@ -106,8 +100,14 @@ main(Void) } break; /* nan? */ case '#': - sscanf(s+1, "%lx %lx %lx", &u.bits[_0], - &u.bits[_1], &u.bits[_2]); + /* sscanf(s+1, "%lx %lx %lx", &u.bits[_0], */ + /* &u.bits[_1], &u.bits[_2]); */ + u.bits[_0] = (ULong)strtoul(s1 = s+1, &se, 16); + if (se > s1) { + u.bits[_1] = (ULong)strtoul(s1=se, &se, 16); + if (se > s1) + u.bits[_2] = (ULong)strtoul(s1=se, &se, 16); + } printf("\nInput: %s", ibuf); printf(" --> f = #%lx %lx %lx\n", u.bits[_0], u.bits[_1], u.bits[_2]); |