11.1SchristosThis directory contains source for several test programs:
21.1Schristos
31.1Schristosdt is for conversion to/from double; it permits input of pairs of
41.1Schristos32-bit hex integers as #hhhhhhhh hhhhhhhh (i.e., the initial '#'
51.1Schristosindicates hex input).  No initial # ==> decimal input.
61.1SchristosAfter the input number is an optional : mode ndigits
71.1Schristos(colon, and decimal integers for parameters "mode" and "ndigits"
81.1Schristosto gdtoa).
91.1Schristos
101.1SchristosQtest, ddtest, dtest, ftest, xLtest and xtest are for conversion to/from
111.1Schristos
121.1Schristos	f	IEEE single precision
131.1Schristos	d	IEEE double precision
141.1Schristos	xL	IEEE extended precision, as on Motorola 680x0 chips
151.1Schristos	x	IEEE extended precision, as on Intel 80x87 chips or
161.1Schristos			software emulation of Motorola 680x0 chips
171.1Schristos	Q	quad precision, as on Sun Sparc chips
181.1Schristos	dd	double double, pairs of IEEE double numbers
191.1Schristos		whose sum is the desired value
201.1Schristos
211.1SchristosThey're all similar, except for the precision.  They test both
221.1Schristosdirected roundings and interval input (the strtoI* routines).
231.1SchristosLines that begin with "r" specify or interrogate the desired rounding
241.1Schristosdirection:
251.1Schristos
261.1Schristos	0 = toward 0
271.1Schristos	1 = nearest (default)
281.1Schristos	2 = toward +Infinity
291.1Schristos	3 = toward -Infinity
301.1Schristos
311.1SchristosThese are the FPI_Round_* values in gdota.h.  The "r" value is sticky:
321.1Schristosit stays in effect til changed.  To change the value, give a line that
331.1Schristosstarts with r followed by 0, 1, 2, or 3.  To check the value, give "r"
341.1Schristosby itself.
351.1Schristos
361.1SchristosLines that begin with n followed by a number specify the ndig
371.1Schristosargument for subsequent calls to the relevant g_*fmt routine.
381.1Schristos
391.1SchristosLines that start with # followed by the appropriate number of
401.1Schristoshexadecimal strings (see the comments) give the big-endian
411.1Schristosinternal representation of the desired number.
421.1Schristos
431.1SchristosWhen routines Qtest, xLtest, and xtest are used on machines whose
441.1Schristoslong double is of type "quad" (for Qtest) or "extended" (for x*test),
451.1Schristosthey try to print with %Lg as another way to show binary values.
461.1Schristos
471.1SchristosProgram ddtest also accepts (white-space separated) pairs of decimal
481.1Schristosinput numbers; it converts both with strtod and feeds the result
491.1Schristosto g_ddfmt.
501.1Schristos
511.1SchristosProgram dItest exercises strtodI and strtoId.
521.1Schristos
531.1SchristosPrograms dItestsi and ddtestsi are for testing the sudden-underflow
541.1Schristoslogic (on double and double-double conversions).
551.1Schristos
561.1SchristosProgram strtodt tests strtod on some hard cases (in file testnos3)
571.1Schristosposted by Fred Tydeman to comp.arch.arithmetic on 26 Feb. 1996.
581.1SchristosTo get correct results on Intel (x86) systems, the rounding precision
591.1Schristosmust be set to 53 bits.  This can be done, e.g., by invoking
601.1Schristosfpinit_ASL(), whose source appears in
611.1Schristoshttp://www.netlib.org/ampl/solvers/fpinit.c .
621.1Schristos
631.1SchristosThe obad directory shows results expected on (at least some) Intel x86
641.1SchristosLinux systems and may not be relevant to other systems.
651.1Schristos
661.1SchristosYou can optionally compile getround.c with -DHonor_FLT_ROUNDS
671.1Schristosto manually test strtof, strtod, etc., using fegetround().
681.1SchristosYou can also or alternatively compile getround.c with
691.1Schristos-DUSE_MY_LOCALE (when ../gdtoa.a is compiled with -DUSE_LOCALE)
701.1Schristosto test multi-byte decimal points.
711.1Schristos
721.2SandvarIf in the parent directory, you have successfully invoked "make Printf"
731.1Schristosto add a "printf" (called Printf and accessed via ../stdio1.h), then
741.1Schristoshere you can use "make pf_test" and (if you have both a 64-bit long
751.1Schristosdouble and a 113-bit "quad" double type) "make pf_testLq" for a brief
761.1Schristostest of %g and %a variants in Printf.
771.1Schristos
781.1SchristosThese are simple test programs, not meant for exhaustive testing,
791.1Schristosbut for manually testing "interesting" cases.  Paxson's testbase
801.1Schristosis good for more exhaustive testing, in part with random inputs.
811.1SchristosSee ftp://ftp.ee.lbl.gov/testbase-report.ps.Z .
82