/*************************************************************************************************************************************/
/* */
/* T E S T ' != ' A P P R O X I M A T I F D E D E U X N O M B R E S : */
/* */
/* */
/* Author of '$xcg/IFNE.02$K' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20020404101342). */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* I N T E R F A C E ' listG ' : */
/* */
/* */
/* :Debut_listG: */
/* :Fin_listG: */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* D I R E C T I V E S S P E C I F I Q U E S D E C O M P I L A T I O N : */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* F I C H I E R S D ' I N C L U D E S : */
/* */
/*************************************************************************************************************************************/
#include INCLUDES_MINI
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* P A R A M E T R E S : */
/* */
/*************************************************************************************************************************************/
#define TEST_RELATIF \
VRAI \
/* Le test sera relatif ('VRAI') ou absolu ('FAUX')... */
#define POURCENTAGE_DU_TEST \
FZERO
#define EPSILON_DU_TEST \
FZERO
/* Parametres du test a peu pres... */
#define NOMBRE_1 \
FU
#define NOMBRE_2 \
FZERO
/* Les deux nombres flottants qui vont etre compares. */
#include xcg/ARIT.01.I"
#include xci/valeurs.01.I"
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* M A C R O S U T I L E S : */
/* */
/*************************************************************************************************************************************/
#include xci/valeurs.02.I"
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* T E S T ' != ' A P P R O X I M A T I F D E D E U X N O M B R E S : */
/* */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
Bblock
DEFV(Logical,INIT(test_relatif,TEST_RELATIF));
/* Le test sera relatif ('VRAI') ou absolu ('FAUX')... */
DEFV(Float,INIT(pourcentage_du_test,POURCENTAGE_DU_TEST));
DEFV(Float,INIT(epsilon_du_test,EPSILON_DU_TEST));
/* Parametres du test a peu pres... */
DEFV(Float,INIT(nombre_1,NOMBRE_1));
DEFV(Float,INIT(nombre_2,NOMBRE_2));
/* Les deux nombres flottants qui vont etre compares. */
#include xci/valeurs.03.I"
/*..............................................................................................................................*/
GET_ARGUMENTS_(nombre_d_arguments
,BLOC(GET_ARGUMENT_L("relatif=",test_relatif);
GET_ARGUMENT_F("pourcentage=""p=",pourcentage_du_test);
GET_ARGUMENT_F("epsilon=""e=",epsilon_du_test);
GET_ARGUMENT_F("x=""nombre_1=""n1=""a=",nombre_1);
GET_ARGUMENT_F("y=""nombre_2=""n2=""b=",nombre_2);
)
);
CAL2(Prin1("%d"
,COND(COND(EST_VRAI(test_relatif)
,IFNE_a_peu_pres_relatif(nombre_1,nombre_2,pourcentage_du_test)
,IFNE_a_peu_pres_absolu(nombre_1,nombre_2,epsilon_du_test)
)
,EXIST
,NEXIST
)
)
);
/* Edition de 'EXIST' si la condition "!=" est verifiee, et de 'NEXIST' sinon ("="). */
RETU_Commande;
Eblock
ECommande
Copyright © Jean-François COLONNA, 2019-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2019-2024.