Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Weird
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Re: Weird
Divers
Thread ID:
00952239
Message ID:
00952245
Vues:
10
Yes but why does it happen only between 64 and 81 but when trying with 63 or 82 the round is right (and the print value too)? Is this a Fox problem ?


>The floating point numbers cannot be always represented exactly. Run following, and you will see that
? 64.225000000000000000000000000000000000
Keep in mind that maximum size of numeric and float fields in VFP is 20 digits.
>
>>
>>I got a good one for you. I've tried this in fox 7, 8 and also 9 beta. Simple way to reproduce the problem:
>>
>>?ROUND(64.225000000000000000000000000000000000,2)
>>?ROUND(63.225000000000000000000000000000000000,2)
>>
>>Why do I get 64,22 for the first one and 63.23 for the second one ? The round value doesn't seem to be right between 64 and 81. I tried this :
>>
>>?ROUND(64.225000000000000000000000000000000000,2)
>>to
>>?ROUND(81.225000000000000000000000000000000000,2)
>>
>>and the round isn't right !!
>>
>>Somebody and notice this problem ?
>>
>>Note : ?ROUND(ROUND(64.225000000000000000000000000000000000,10),2)is working well, strange isn't it :)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform