Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Only currency is sure computation decimals values ?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00798893
Message ID:
00800020
Views:
54
>>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?
Previous
Reply
Map
View

Click here to load this message in the networking platform