/*************************************************************************************************************************************/ /* */ /* R E S T E D E D E U X N O M B R E S : */ /* */ /* */ /* Author of '$xcg/REST.01$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 1995??????????). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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 NOMBRE_1 \ ZERO #define NOMBRE_2 \ UN /* Les deux nombres entiers dont on va calculer le reste. */ #define NOMBRE_D_ITERATIONS \ UN \ /* Nombre d'iterations de la division la valeur par defaut garantissant la compatibilite */ \ /* anterieure (introduit le 20231209152143)... */ #define VALEURS_SIGNEES \ "" \ /* Definition de la presence d'un signe ("+") pour les valeurs editees ou son absence (""). */ \ /* */ \ /* Le 20081204104317 le '#TestADef' incomprehensible a ete remplace par un '#define'. Malgre */ \ /* tout, la question se pose de savoir a quoi cela sert-il de forcer ici 'VALEURS_SIGNEES' ? */ #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" /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* R E S T E D E D E U X N O M B R E S : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(Int,INIT(nombre_1,NOMBRE_1)); DEFV(Int,INIT(nombre_2,NOMBRE_2)); /* Les deux nombres entiers dont on va calculer le reste. */ DEFV(Int,INIT(nombre_d_iterations,NOMBRE_D_ITERATIONS)); /* Nombre d'iterations de la division la valeur par defaut garantissant la compatibilite */ /* anterieure (introduit le 20231209152143)... */ #include xci/valeurs.03.I" /*..............................................................................................................................*/ GET_ARGUMENTS_(nombre_d_arguments ,BLOC(GET_ARGUMENT_I("dividende=""x=""nombre_1=""n1=""a=",nombre_1); GET_ARGUMENT_I("diviseur=""y=""nombre_2=""n2=""b=",nombre_2); /* Les arguments "dividende=" et "diviseur=" ont ete introduits le 20231209154329... */ GET_ARGUMENT_I("iterations=""n=",nombre_d_iterations); GET_ARGUMENT_C("signe=",valeurs_signees); GET_ARGUMENT_L("LF=""K_LF=",ajouter_un_K_LF_en_fin_de_format_d_edition); /* Parametres introduits le 20070819141531... */ ) ); Test(IZNE(nombre_2)) Bblock DEFV(Int,INIT(dividende_courant,nombre_1)); Repe(nombre_d_iterations) Bblock CAL2(Prin1(Cara(chain_Aconcaten3(INTRODUCTION_FORMAT,valeurs_signees,"d")) ,REST(dividende_courant,nombre_2) ) ); /* Edition du reste du quotient de deux nombres... */ Test(IL_FAUT(ajouter_un_K_LF_en_fin_de_format_d_edition)) Bblock CAL2(Prin0("\n")); /* Possibilite introduite le 20070819141531 par symetrie avec tous les autres '$K' du */ /* meme type ('v $xcg/ABSO.01$K' par exemple...). */ Eblock ATes Bblock Eblock ETes EGAL(dividende_courant,DIVI(dividende_courant,nombre_2)); Eblock ERep Eblock ATes Bblock PRINT_ERREUR("le diviseur est nul"); Eblock ETes RETU_Commande; Eblock ECommande