Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ISSUE: SET DECIMAL and comparison
Message
 
 
À
18/04/2005 17:07:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01005982
Message ID:
01006101
Vues:
17
Hi Fabio,

I haven't seen it documented anywhere. Looks like it affects floating point literals only. The following code works fine
		  IF NOT m.x-&sL+(1-xFraction)=1	&& WORST CASE
		  	 ? m.nl,m.nd,m.nl+m.nd;
		  	 	,m.x-&sL+(1-xFraction)=1	 ;	&&  COMPUTATION 1
		  	 	,m.x-&sL+(m.one-xFraction)=1 	; &&  COMPUTATION 2
		  	 	,m.x-m.xInteger+(m.one-xFraction)=1 &&  COMPUTATION 3
		  ENDIF
Notice that I removed parenrhesises around &sL otherwise it would not match which is also strange.

>Where is documented that SET DECIMAL change the comparison results ?
>
>CLEAR
>FOR DD=4 TO 6
>	SET DECIMALS TO m.DD
>	? "DECIMALS ",SET("Decimals")
>	FOR NN=1 TO 11
>	  FOR ND=1 TO m.NN-1
>		  m.NL=m.NN-m.ND
>		  sL=REPLICATE('9',m.NL)
>		  sD=REPLICATE('9',m.ND)
>		  x=&sL..&sD
>		  xInteger=&sL
>		  xFraction= .&sD
>		  one = 1
>		  IF NOT m.x-(&sL)+(1-.&sD)=1	&& WORST CASE
>		  	 ? m.nl,m.nd,m.nl+m.nd;
>		  	 	,m.x-&sL+(1-.&sD)=1	 ;	&&  COMPUTATION 1
>		  	 	,m.x-&sL+(m.one-.&sD)=1 	; &&  COMPUTATION 2
>		  	 	,m.x-m.xInteger+(m.one-.&sD)=1 &&  COMPUTATION 3
>		  ENDIF
>	  NEXT
>	NEXT
>NEXT
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform