/* test_modulo.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__9 = 9;
static integer c__1 = 1;
static real c_b22 = 9.f;
static real c_b23 = 4.f;
static integer c__4 = 4;
static integer c_n1 = -1;
static real c_b39 = -9.f;
static integer c_n9 = -9;
static real c_b57 = -4.f;
static integer c_n4 = -4;

/* Main program */ int MAIN__(void)
{
    /* Format strings */
    static char fmt_100[] = "(a)";
    static char fmt_200[] = "(i3)";
    static char fmt_300[] = "(f6.2)";

    /* System generated locals */
    integer i__1;
    real r__1;

    /* Builtin functions */
    integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
	    e_wsle(void), s_wsfe(cilist *), do_fio(integer *, char *, ftnlen),
	     e_wsfe(void);
    double r_mod(real *, real *);
    /* Subroutine */ int s_stop(char *, ftnlen);

    /* Local variables */
    extern integer imodulo_(integer *, integer *);
    extern doublereal rmodulo_(real *, real *);

    /* Fortran I/O blocks */
    static cilist io___1 = { 0, 6, 0, 0, 0 };
    static cilist io___2 = { 0, 6, 0, 0, 0 };
    static cilist io___3 = { 0, 6, 0, 0, 0 };
    static cilist io___4 = { 0, 6, 0, 0, 0 };
    static cilist io___5 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___6 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___7 = { 0, 6, 0, fmt_200, 0 };
    static cilist io___8 = { 0, 6, 0, fmt_300, 0 };
    static cilist io___9 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___10 = { 0, 6, 0, fmt_200, 0 };
    static cilist io___11 = { 0, 6, 0, fmt_300, 0 };
    static cilist io___12 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___13 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___14 = { 0, 6, 0, fmt_200, 0 };
    static cilist io___15 = { 0, 6, 0, fmt_300, 0 };
    static cilist io___16 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___17 = { 0, 6, 0, fmt_200, 0 };
    static cilist io___18 = { 0, 6, 0, fmt_300, 0 };
    static cilist io___19 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___20 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___21 = { 0, 6, 0, fmt_200, 0 };
    static cilist io___22 = { 0, 6, 0, fmt_300, 0 };
    static cilist io___23 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___24 = { 0, 6, 0, fmt_200, 0 };
    static cilist io___25 = { 0, 6, 0, fmt_300, 0 };
    static cilist io___26 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___27 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___28 = { 0, 6, 0, fmt_200, 0 };
    static cilist io___29 = { 0, 6, 0, fmt_300, 0 };
    static cilist io___30 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___31 = { 0, 6, 0, fmt_200, 0 };
    static cilist io___32 = { 0, 6, 0, fmt_300, 0 };
    static cilist io___33 = { 0, 6, 0, fmt_100, 0 };


    s_wsle(&io___1);
    do_lio(&c__9, &c__1, "******************************", (ftnlen)30);
    e_wsle();
    s_wsle(&io___2);
    do_lio(&c__9, &c__1, " Test MOD et MODULO", (ftnlen)19);
    e_wsle();
    s_wsle(&io___3);
    do_lio(&c__9, &c__1, "******************************", (ftnlen)30);
    e_wsle();
    s_wsle(&io___4);
    e_wsle();
/* L100: */
/* L200: */
/* L300: */
    s_wsfe(&io___5);
    do_fio(&c__1, "----------------------------------", (ftnlen)34);
    e_wsfe();
    s_wsfe(&io___6);
    do_fio(&c__1, "mod(9,4) should be 1", (ftnlen)20);
    e_wsfe();
    s_wsfe(&io___7);
    do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___8);
    r__1 = r_mod(&c_b22, &c_b23);
    do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
    e_wsfe();
    s_wsfe(&io___9);
    do_fio(&c__1, "modulo(9,4) should be 1", (ftnlen)23);
    e_wsfe();
    s_wsfe(&io___10);
    i__1 = imodulo_(&c__9, &c__4);
    do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___11);
    r__1 = rmodulo_(&c_b22, &c_b23);
    do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
    e_wsfe();
    s_wsfe(&io___12);
    do_fio(&c__1, "----------------------------------", (ftnlen)34);
    e_wsfe();
    s_wsfe(&io___13);
    do_fio(&c__1, "mod(-9,4) should be -1", (ftnlen)22);
    e_wsfe();
    s_wsfe(&io___14);
    do_fio(&c__1, (char *)&c_n1, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___15);
    r__1 = r_mod(&c_b39, &c_b23);
    do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
    e_wsfe();
    s_wsfe(&io___16);
    do_fio(&c__1, "modulo(-9,4) should be 3", (ftnlen)24);
    e_wsfe();
    s_wsfe(&io___17);
    i__1 = imodulo_(&c_n9, &c__4);
    do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___18);
    r__1 = rmodulo_(&c_b39, &c_b23);
    do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
    e_wsfe();
    s_wsfe(&io___19);
    do_fio(&c__1, "----------------------------------", (ftnlen)34);
    e_wsfe();
    s_wsfe(&io___20);
    do_fio(&c__1, "mod(9,-4) should be 1", (ftnlen)21);
    e_wsfe();
    s_wsfe(&io___21);
    do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___22);
    r__1 = r_mod(&c_b22, &c_b57);
    do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
    e_wsfe();
    s_wsfe(&io___23);
    do_fio(&c__1, "modulo(9,-4) should be -3", (ftnlen)25);
    e_wsfe();
    s_wsfe(&io___24);
    i__1 = imodulo_(&c__9, &c_n4);
    do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___25);
    r__1 = rmodulo_(&c_b22, &c_b57);
    do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
    e_wsfe();
    s_wsfe(&io___26);
    do_fio(&c__1, "----------------------------------", (ftnlen)34);
    e_wsfe();
    s_wsfe(&io___27);
    do_fio(&c__1, "mod(-9,-4) should be -1", (ftnlen)23);
    e_wsfe();
    s_wsfe(&io___28);
    do_fio(&c__1, (char *)&c_n1, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___29);
    r__1 = r_mod(&c_b39, &c_b57);
    do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
    e_wsfe();
    s_wsfe(&io___30);
    do_fio(&c__1, "modulo(-9,-4) should be -1 ", (ftnlen)27);
    e_wsfe();
    s_wsfe(&io___31);
    i__1 = imodulo_(&c_n9, &c_n4);
    do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___32);
    r__1 = rmodulo_(&c_b39, &c_b57);
    do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
    e_wsfe();
    s_wsfe(&io___33);
    do_fio(&c__1, "----------------------------------", (ftnlen)34);
    e_wsfe();
    s_stop("", (ftnlen)0);
    return 0;
} /* MAIN__ */

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