Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Math
Message
 
 
To
19/03/2004 09:36:44
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: Math
Miscellaneous
Thread ID:
00887884
Message ID:
00887941
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform