Bonjour,
Lors d'une différence entre deux macro-variables, le résultat est de 0.3 ou 0.29999 selon les paramètres.
Je ne comprend pas d'où vient cette différence.
Log
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 /* Résultat donne 0.299999... */ %let max=2.3; %let nb=2; %let a=%sysevalf(&max.-&nb.); %put &a; %let max=4.70; %let nb=4.4; %let a=%sysevalf(&max.-&nb.); %put &a; /* Résultat donne 0.3 ou 1.3 */ %let max=1.3; %let nb=1; %let a=%sysevalf(&max.-&nb.); %put &a; %let max=2.3; %let nb=1; %let a=%sysevalf(&max.-&nb.); %put &a;
Merci par avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 25249 /* Résultat donne 0.299999... */ 25250 %let max=2.3; 25251 %let nb=2; 25252 %let a=%sysevalf(&max.-&nb.); SYMBOLGEN: Macro variable MAX resolves to 2.3 SYMBOLGEN: Macro variable NB resolves to 2 25253 %put &a; SYMBOLGEN: Macro variable A resolves to 0.29999999999999 0.29999999999999 25254 25255 %let max=4.70; 25256 %let nb=4.4; 25257 %let a=%sysevalf(&max.-&nb.); SYMBOLGEN: Macro variable MAX resolves to 4.70 SYMBOLGEN: Macro variable NB resolves to 4.4 25258 %put &a; SYMBOLGEN: Macro variable A resolves to 0.29999999999999 0.29999999999999 25259 25260 25261 /* Résultat donne 0.3 ou 1.3 */ 25262 %let max=1.3; 25263 %let nb=1; 25264 %let a=%sysevalf(&max.-&nb.); SYMBOLGEN: Macro variable MAX resolves to 1.3 SYMBOLGEN: Macro variable NB resolves to 1 25265 %put &a; SYMBOLGEN: Macro variable A resolves to 0.3 0.3 25266 25267 %let max=2.3; 25268 %let nb=1; 25269 %let a=%sysevalf(&max.-&nb.); SYMBOLGEN: Macro variable MAX resolves to 2.3 SYMBOLGEN: Macro variable NB resolves to 1 25270 %put &a; SYMBOLGEN: Macro variable A resolves to 1.3 1.3
Cordialement,
Aleksik
Partager