diff --git a/newlib/libc/tinystdio/conv_flt.c b/newlib/libc/tinystdio/conv_flt.c index 5f6fe338cb..7b3f76dc47 100644 --- a/newlib/libc/tinystdio/conv_flt.c +++ b/newlib/libc/tinystdio/conv_flt.c @@ -380,7 +380,10 @@ conv_flt (FLT_STREAM *stream, int *lenp, width_t width, void *addr, uint16_t fla #endif exp += expacc; } - +#ifdef _NEED_IO_C99_FORMATS + else if (flags & FL_FHEX) + exp *= 4; +#endif no_exp: if (width) scanf_ungetc (i, stream, lenp); diff --git a/test/test-strtod.c b/test/test-strtod.c index 1c0306624d..4483452bbf 100644 --- a/test/test-strtod.c +++ b/test/test-strtod.c @@ -56,6 +56,7 @@ static const struct { { "1e2@", 100.0, 100.0f, 100.0l }, #ifdef FULL_TESTS { "0x1p-1@", 0.5, 0.5f, 0.5l }, + { "0x10.000@", 16.0, 16.0f, 16.0l}, { "0x1p-10000000000000000000000000@", 0.0, 0.0f, 0.0l }, { "0x1p0@", 1.0, 1.0f, 1.0l }, { "0x10p0@", 16.0, 16.0f, 16.0l },