Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Only currency is sure computation decimals values ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00798893
Message ID:
00800020
Vues:
55
>>Repeat after me: FLOATING POINT DOES NOT PRODUCE EXACT RESULTS. IF I WANT EXACT RESULTS, I WILL ROUND MY DATA.
>
>I can't repeat this because is impossible round intermediate result.
>
>Example:
>
>SELECT SUM(field) FROM ...
>
>is impossible round intermediate sum, then is impossible give exact result.

Really? Could have fooled me.
CREATE CURSOR TEST (b B DEFAULT 0.1,n N(18,4) DEFAULT 0.1,y Y DEFAULT $0.1)
FOR I=1 TO 10000000
	APPEND BLANK
NEXT
SELECT SUM(ROUND(b,1)) sb,sum(y) sy,sum(ROUND(n,1)) sn FROM test INTO CURSOR result
? TRANSFORM(sb+0.000000000000000)
? sn
? sy
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform