Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Empty()??? Is this true!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00940054
Message ID:
00940061
Vues:
17
>Check this out!
>Run this:
>
>x=199.07
>x=x - 185.27
>x = x  - 13.80
>?"---"    && Result
>?x        && Print 0.00
>?EMPTY(x) && Print .F.
>
>
>Anyone know why?

Jean-Rene,

this is due to the arithmetic in double precision.
vfp keeps track of the number of (significant ??) decimals that were used when the variable was defined and used in calculations

empty() does not take the number of decimals into account where (x=0) does (2nd example)
x=199.07
x=x - 185.27
x = x  - 13.80
?empty(x) && FALSE
??x-0.000000000000000000000000000000   && -0.000000000000018000

?(x=0)  && TRUE

&&----------------------------------
x=199.07
x=x - 185.2700000000000000000000000
x = x  - 13.8000000000000000000000000000000

? x && -0.000000000000018000

?empty(x) && FALSE
?(x=0)  && FALSE !!!!
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform