Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG in round() function?!?
Message
De
29/01/2004 07:47:20
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
BUG in round() function?!?
Divers
Thread ID:
00871732
Message ID:
00871732
Vues:
63
Hi there,

I found some realy strange behavior in the round() funtion in VFP7 and VFP8

When i round 147.3250000000 on 2 decimal places i get 147.33 as result (as aspected).
when i round 147.32500000000 on 2 decimal places i get 147.32!?!? :
?round(147.3250000000,2)
?round(147.32500000000,2)
After this i tried some other things to find out what is wrong here:
for lnValueBasic = 1 to 200
lnValue = lnValueBasic + 0.325
lnValueLong = round(lnValue,11)
lnValueRound = round(lnValueLong,2)
lnDifferenceBasic_Round=lnValueRound-lnValueBasic && has to be 0.33
if lnDifferenceBasic_Round <> 0.33
messagebox(lnValueBasic)
endif
endfor
If you run this piece of code you'll see that for lnValueBasic being between 128 and 163 the round()-function does not work properly.

Is somebody familiar with this problem?
Is this a bug?

Willem-Jan van Ede
Vektis BV
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform