Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: VFP it mistakes to make the sums.
Message
From
11/06/2003 11:56:39
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
BUG: VFP it mistakes to make the sums.
Miscellaneous
Thread ID:
00798979
Message ID:
00798979
Views:
87
NUMERIC(X,Y) is fixed decimal numeric format of VFP.

therefore, the sum of values of the data domain, if not verification overflow, must belong to the data domain, and it does not have it are to us approximation error.

If i sum 1000000 of 0.100000 on N(17,6), result is 100000.000000.

In fact Microsoft SQL return 100000.000000.
DECLARE @TEST TABLE (n DECIMAL (17,6))
DECLARE @numero int
SET @numero=1
WHILE @numero<=1000000
	BEGIN
		INSERT INTO @TEST VALUES (0.100000)
		SET @numero=@numero+1
	END
SELECT SUM(n) sumn FROM @TEST
VFP return 100000.000001.
CREATE CURSOR TEST (n N(17,6))
FOR I=1 TO 1000000
   INSERT INTO TEST VALUES (0.100000)
NEXT
SELECT SUM(n) sumn FROM test INTO CURSOR result

? sumn,1000000*0.1000
I can use VFP only for short computations.

Fabio
Next
Reply
Map
View

Click here to load this message in the networking platform