Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why 1/2000000=0 is true ? BUG ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00824749
Message ID:
00824779
Vues:
45
>Hi,
>
>i have understand this:
>vfp numeric variables or litterals is a double with a format.
>
>Then, computations is correct, but value show can change.
>
>Then, why comparison of values can fail ?
>
>
>? 1/1999999 = 0
>* ok : false
>? 1/2000000 = 0
>* NOK : true
>x = 1
>? x/2000000 = 0
>* ok : false
>? 1/2000000.0 = 0
>* ok : false
>? 1/20000000.0 = 0
>* NOK : true
>
>
>For any unknown information, VFP use a ROUND(,5) for litterals interger
>divisions.
>
>For correct computation, is need to add decimals zeros, but the number of
>zero change the values ( not the display format ) !
>
>For me this is a bug.
>
>Fabio

It has to do with what SET DECIMALS is set to. When set to 10, the above doesn't occur when you type the variable to double, float or currency. More than anything else, this is a doc error with the SET DECIMALS description.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform