/* test_format.f -- translated by f2c (version 20100827).
   You must link the resulting object file with libf2c:
	on Microsoft Windows system, link with libf2c.lib;
	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
	or, if you install libf2c.a in a standard place, with -lf2c -lm
	-- in that order, at the end of the command line, as in
		cc *.o -lf2c -lm
	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,

		http://www.netlib.org/f2c/libf2c.zip
*/

#include "f2c.h"

/* Table of constant values */

static integer c__1 = 1;

/* Main program */ int MAIN__(void)
{
    /* Format strings */
    static char fmt_100[] = "(i3,5x,g14.7,5x,e14.7,5x,1pe14.6)";

    /* Builtin functions */
    integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
    /* Subroutine */ int s_stop(char *, ftnlen);

    /* Local variables */
    static integer i__;
    static real v[22];

    /* Fortran I/O blocks */
    static cilist io___3 = { 0, 6, 0, fmt_100, 0 };


/*     ***************************************************************0** */
/* *   Test_Format: test how is writen a float, according format g or e */
/*     P. Robert, Jan 2003 */
/*     ***************************************************************0** */


    v[0] = -1.234567e-8f;
    v[1] = -1.234567e-7f;
    v[2] = -1.234567e-6f;
    v[3] = -1.234567e-5f;
    v[4] = -1.234567e-4f;
    v[5] = -.001234567f;
    v[6] = -.01234567f;
    v[7] = -.1234567f;
    v[8] = -7.123456f;
    v[9] = -67.12345f;
    v[10] = -567.1234f;
    v[11] = -4567.123f;
    v[12] = -34567.12f;
    v[13] = -234567.1f;
    v[14] = -1234567.f;
    v[15] = -12345670.f;
    v[16] = -123456700.f;
    v[17] = -1.234567e9f;
    v[18] = -1.234567e10f;
    v[19] = -1.234567e11f;
    v[20] = -1.234567e12f;
    v[21] = -1.234567e13f;

    for (i__ = 1; i__ <= 22; ++i__) {
	v[i__ - 1] *= 13.f;
	v[i__ - 1] /= 13.f;
	s_wsfe(&io___3);
	do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&v[i__ - 1], (ftnlen)sizeof(real));
	do_fio(&c__1, (char *)&v[i__ - 1], (ftnlen)sizeof(real));
	do_fio(&c__1, (char *)&v[i__ - 1], (ftnlen)sizeof(real));
	e_wsfe();
    }

    s_stop("test_format.exe: normal termination", (ftnlen)35);
    return 0;
} /* MAIN__ */

/* Main program alias */ int test_format__ () { MAIN__ (); return 0; }
