/*************************************************************************************************************************************/
/* */
/* T E S T D E L A N O R M A L I S A T I O N _ D E N O R M A L I S A T I O N : */
/* */
/* */
/* Author of '$xtc/NormDenorm.02$c' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20090928151545). */
/* */
/*************************************************************************************************************************************/
#include <stdio.h>
#define k___Xmin 0
#define k___Xmax 511
#define dimX ((Xmax-Xmin)+1)
#define rdimX ((rXmax-rXmin)+1)
#define TRMU 1
/* Le probleme est resolu en faisant : TRMU=0... */
#define RAPPORT 16
#define EPSILON 1e-10
int main()
{
int Xmin=k___Xmin;
int Xmax=k___Xmax;
int rXmin=k___Xmin/RAPPORT;
int rXmax=k___Xmax/RAPPORT;
int X;
for (X=Xmin ; X<=Xmax ; X++)
{
double abscisse_normalisee=((double)X)/((double)(dimX-TRMU));
int abscisse_redenormalisee;
abscisse_redenormalisee=((int)((((double)(rdimX-TRMU))*(abscisse_normalisee))+EPSILON));
if ((X/RAPPORT) != abscisse_redenormalisee)
{
printf("X=%d --> %f --> %d (au lieu de %d)\n",X,abscisse_normalisee,abscisse_redenormalisee,X/RAPPORT);
}
else
{
}
}
}
Copyright © Jean-François COLONNA, 2021-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2021-2024.