Commit Graph

3 Commits

Author SHA1 Message Date
Joseph Myers 4725d33eed Make strtod raise "inexact" exceptions (bug 19380).
The strtod function should raise the "inexact" exception when its
result is inexact, but fails to do so except in the case of underflow
or overflow.  This patch fixes it to do so for all inexact results.

tst-strtod-round is extended to test for this exception; the generator
is fixed to properly mark inexact results as such in the case where
the inexactness is from the mpfr_subnormalize step.

Tested for x86_64, x86 and powerpc.

	[BZ #19380]
	* stdlib/strtod_l.c (round_and_return): Force "inexact" exception
	for inexact results.
	* stdlib/gen-tst-strtod-round.c (string_to_fp): Return indication
	of inexact result where mpfr_subnormalize is the only inexact
	step.
	* stdlib/tst-strtod-round-data.h: Regenerated.
	* stdlib/tst-strtod-round-skeleton.c [!FE_INEXACT] (FE_INEXACT):
	Define to 0.
	(GEN_ONE_TEST): Test inexact exceptions raised are as expected.
2016-10-28 00:40:23 +00:00
Rajalakshmi Srinivasaraghavan bf5eea32ac Refactor strtod tests
This patch changes strtod* tests to use strfrom* functions.
2016-10-25 17:05:47 -02:00
Paul E. Murphy 466929465e Add tst-wcstod-round
This extends tst-strtod-round with a few trivial changes
to also test the wide character variants of strto* using
similar macros to other shared tests.
2016-08-19 11:17:07 -05:00