Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: VFP it mistakes to make the sums.
Message
 
 
À
11/06/2003 11:56:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00798979
Message ID:
00799072
Vues:
29
Fabio,
This is not a bug. VFP states in the Help (Microsoft Visual FoxPro\Reference\General Reference\Visual FoxPro System Capacities) that the maximum digits of precision is 16. You are using a numeric 17 so it goes beyond VFP's limit.

Regards.

>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
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform