freebsd-nq/test
David Schultz 9ea4d2a874 Import gdtoa sources dated 2008-12-05. Notable changes include a fix
for a regression in strtod() and support for multibyte decimal points.
2009-01-28 03:52:02 +00:00
..
obad Import gdtoa sources dated 2008-12-05. Notable changes include a fix 2009-01-28 03:52:02 +00:00
d.out Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
dd.out Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
ddsi.out Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
ddtest.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
dI.out Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
dIsi.out Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
dItest.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
dt.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
dtest.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
dtst.out Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
f.out Import the latest gdtoa sources from the vendor, dated 2008-08-31. 2008-09-03 06:07:18 +00:00
ftest.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
getround.c Import gdtoa sources dated 2008-12-05. Notable changes include a fix 2009-01-28 03:52:02 +00:00
makefile Import gdtoa sources dated 2008-12-05. Notable changes include a fix 2009-01-28 03:52:02 +00:00
Q.ou0 Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
Q.ou1 Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
Qtest.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
README Import gdtoa sources dated 2008-12-05. Notable changes include a fix 2009-01-28 03:52:02 +00:00
rtestnos Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
strtodISI.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
strtodt.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
strtoIddSI.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
strtoIdSI.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
strtopddSI.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
strtorddSI.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
testnos Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
testnos1 Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
testnos3 Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
x.ou0 Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
x.ou1 Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
xL.ou0 Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
xL.ou1 Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
xLtest.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
xQtest.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00
xsum0.out Import gdtoa sources dated 2008-12-05. Notable changes include a fix 2009-01-28 03:52:02 +00:00
xtest.c Flatten vendor/gdtoa/* harder. 2008-09-03 05:32:36 +00:00

This directory contains source for several test programs:

dt is for conversion to/from double; it permits input of pairs of
32-bit hex integers as #hhhhhhhh hhhhhhhh (i.e., the initial '#'
indicates hex input).  No initial # ==> decimal input.
After the input number is an optional : mode ndigits
(colon, and decimal integers for parameters "mode" and "ndigits"
to gdtoa).

Qtest, ddtest, dtest, ftest, xLtest and xtest are for conversion to/from

	f	IEEE single precision
	d	IEEE double precision
	xL	IEEE extended precision, as on Motorola 680x0 chips
	x	IEEE extended precision, as on Intel 80x87 chips or
			software emulation of Motorola 680x0 chips
	Q	quad precision, as on Sun Sparc chips
	dd	double double, pairs of IEEE double numbers
		whose sum is the desired value

They're all similar, except for the precision.  They test both
directed roundings and interval input (the strtoI* routines).
Lines that begin with "r" specify or interrogate the desired rounding
direction:

	0 = toward 0
	1 = nearest (default)
	2 = toward +Infinity
	3 = toward -Infinity

These are the FPI_Round_* values in gdota.h.  The "r" value is sticky:
it stays in effect til changed.  To change the value, give a line that
starts with r followed by 0, 1, 2, or 3.  To check the value, give "r"
by itself.

Lines that begin with n followed by a number specify the ndig
argument for subsequent calls to the relevant g_*fmt routine.

Lines that start with # followed by the appropriate number of
hexadecimal strings (see the comments) give the big-endian
internal representation of the desired number.

When routines Qtest, xLtest, and xtest are used on machines whose
long double is of type "quad" (for Qtest) or "extended" (for x*test),
they try to print with %Lg as another way to show binary values.

Program ddtest also accepts (white-space separated) pairs of decimal
input numbers; it converts both with strtod and feeds the result
to g_ddfmt.

Program dItest exercises strtodI and strtoId.

Programs dItestsi and ddtestsi are for testing the sudden-underflow
logic (on double and double-double conversions).

Program strtodt tests strtod on some hard cases (in file testnos3)
posted by Fred Tydeman to comp.arch.arithmetic on 26 Feb. 1996.
To get correct results on Intel (x86) systems, the rounding precision
must be set to 53 bits.  This can be done, e.g., by invoking
fpinit_ASL(), whose source appears in
http://www.netlib.org/ampl/solvers/fpinit.c .

The obad directory shows results expected on (at least some) Intel x86
Linux systems and may not be relevant to other systems.

You can optionally compile getround.c with -DHonor_FLT_ROUNDS
to manually test strtof, strtod, etc., using fegetround().
You can also or alternatively compile getround.c with
-DUSE_MY_LOCALE (when ../gdtoa.a is compiled with -DUSE_LOCALE)
to test multi-byte decimal points.

These are simple test programs, not meant for exhaustive testing,
but for manually testing "interesting" cases.  Paxson's testbase
is good for more exhaustive testing, in part with random inputs.
See ftp://ftp.ee.lbl.gov/testbase-report.ps.Z .