Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Math
Message
 
 
À
19/03/2004 09:36:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: Math
Divers
Thread ID:
00887884
Message ID:
00887941
Vues:
16
Mohammed,

I'm not sure I'm converting your function correctly, but here's what it would look like in VFP
a = SomeInitialValueGoesHere && whatever your appropriate values are
b = ???
lnEpsilon = 0.0003

for i = 1 to 5
   p = ( a + b ) / 2
   if ( FuncX( a ) * FuncX( b ) < 0.0 )
      b = p
   else
      a = p
      if ( abs( b - a ) <= lnEpsilon )
         ? p
         exit && leaves for loop
      endif
   endif
endfor

function FuncX( lnArg )
return cos( lnArg ) - 2.0 * lnArg ^ 3 - 0.5
> ? out MESSAGE

I am not sure under what conditions you wanted to ? out message.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform