Commit Graph

12 Commits

Author SHA1 Message Date
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
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
Paul E. Murphy 1ced34c00a Refactor tst-strtod-round.c for type-generic-ness
Reduce much of the redundancy in this file, and attempt
to coral the type specific stuff to ease adding an new type.
2016-05-25 13:33:36 -05:00
Paul E. Murphy 118fbf0e1c Refactor tst-strtod-round.c
This file is partially generated.  To make updates a little
simpler, I have moved the generated code into a partially
contained header to simplify regeneration.

gen-tst-strtod-round.c now takes two, mandatory arguments.
These arguments specify the input test data and the output
destination, respectively.
2016-05-24 14:39:57 -05:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers 1f24b9ad0f Rework tst-strtod-round handling of inexact results. 2013-06-13 15:41:58 +00:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Joseph Myers ed8c2ecd21 Fix strtod test for values above maximum for IBM long double. 2012-09-06 15:33:06 +00:00
Andreas Schwab e1343020fb Correctly handle Motorola extended float format in tst-strtod-round 2012-09-05 12:40:45 +02:00
Joseph Myers af92131a8e Fix strtod rounding (bug 3479). 2012-08-27 16:02:07 +00:00