Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Decimal bug
Message
 
À
13/03/2003 14:23:00
Todd Cottengim
Alpine Land Information Services
Redding, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00765485
Message ID:
00765590
Vues:
18
Using VFP 7.0 SP1, the following code does not produce the same results. Am I doing anything different that you can see?
nX = 40
nY = 10
SET DECIMALS TO 10
m.lnValue = nX / nY
?m.lnValue
SET DECIMALS TO 11
m.lnValue = nX / nY
?m.lnValue
I also tried storing nX and nY to a field....
CREATE CURSOR temp (nx N(20,10), ny N(20,10))
APPEND blank
replace nX with 40, nY WITH 10
SET DECIMALS TO 10
m.lnValue = nX / nY
?m.lnValue
SET DECIMALS TO 11
m.lnValue = nX / nY
?m.lnValue
Still, not the same as your results...



>>I tried the following lines:
>>m.lnValue = INT(nX / nY)
>>?m.lnValue
>>
>>If SET DECIMAL is less than or equal to 10 I get 4
>>If SET DECIMAL is greater than or equal to 11 I get 3.99999999996
>
>Sorry, I screwed up that last message.
>
>I have tried the following:
>m.lnValue = INT(nX / nY)
>?m.lnValue
>If SET DECIMAL is less than or equal to 10 I get 4
>If SET DECIMAL is greater than or equal to 11 I get 3
>
>I then tried the following - NOTE: No INT()
>m.lnValue = nX / nY
>?m.lnValue
>If SET DECIMAL is less than or equal to 10 I get 4
>If SET DECIMAL is greater than or equal to 11 I get 3.99999999996
>
>TC
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform