1This directory contains source for several test programs:
2
3dt is for conversion to/from double; it permits input of pairs of
432-bit hex integers as #hhhhhhhh hhhhhhhh (i.e., the initial '#'
5indicates hex input).  No initial # ==> decimal input.
6After the input number is an optional : mode ndigits
7(colon, and decimal integers for parameters "mode" and "ndigits"
8to gdtoa).
9
10Qtest, ddtest, dtest, ftest, xLtest and xtest are for conversion to/from
11
12	f	IEEE single precision
13	d	IEEE double precision
14	xL	IEEE extended precision, as on Motorola 680x0 chips
15	x	IEEE extended precision, as on Intel 80x87 chips or
16			software emulation of Motorola 680x0 chips
17	Q	quad precision, as on Sun Sparc chips
18	dd	double double, pairs of IEEE double numbers
19		whose sum is the desired value
20
21They're all similar, except for the precision.  They test both
22directed roundings and interval input (the strtoI* routines).
23Lines that begin with "r" specify or interrogate the desired rounding
24direction:
25
26	0 = toward 0
27	1 = nearest (default)
28	2 = toward +Infinity
29	3 = toward -Infinity
30
31These are the FPI_Round_* values in gdota.h.  The "r" value is sticky:
32it stays in effect til changed.  To change the value, give a line that
33starts with r followed by 0, 1, 2, or 3.  To check the value, give "r"
34by itself.
35
36Lines that begin with n followed by a number specify the ndig
37argument for subsequent calls to the relevant g_*fmt routine.
38
39Lines that start with # followed by the appropriate number of
40hexadecimal strings (see the comments) give the big-endian
41internal representation of the desired number.
42
43When routines Qtest, xLtest, and xtest are used on machines whose
44long double is of type "quad" (for Qtest) or "extended" (for x*test),
45they try to print with %Lg as another way to show binary values.
46
47Program ddtest also accepts (white-space separated) pairs of decimal
48input numbers; it converts both with strtod and feeds the result
49to g_ddfmt.
50
51Program dItest exercises strtodI and strtoId.
52
53Programs dItestsi and ddtestsi are for testing the sudden-underflow
54logic (on double and double-double conversions).
55
56Program strtodt tests strtod on some hard cases (in file testnos3)
57posted by Fred Tydeman to comp.arch.arithmetic on 26 Feb. 1996.
58To get correct results on Intel (x86) systems, the rounding precision
59must be set to 53 bits.  This can be done, e.g., by invoking
60fpinit_ASL(), whose source appears in
61http://www.netlib.org/ampl/solvers/fpinit.c .
62
63The obad directory shows results expected on (at least some) Intel x86
64Linux systems and may not be relevant to other systems.
65
66You can optionally compile getround.c with -DHonor_FLT_ROUNDS
67to manually test strtof, strtod, etc., using fegetround().
68You can also or alternatively compile getround.c with
69-DUSE_MY_LOCALE (when ../gdtoa.a is compiled with -DUSE_LOCALE)
70to test multi-byte decimal points.
71
72If in the parent directory, you have sucessfully invoked "make Printf"
73to add a "printf" (called Printf and accessed via ../stdio1.h), then
74here you can use "make pf_test" and (if you have both a 64-bit long
75double and a 113-bit "quad" double type) "make pf_testLq" for a brief
76test of %g and %a variants in Printf.
77
78These are simple test programs, not meant for exhaustive testing,
79but for manually testing "interesting" cases.  Paxson's testbase
80is good for more exhaustive testing, in part with random inputs.
81See ftp://ftp.ee.lbl.gov/testbase-report.ps.Z .
82