Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program.exe
Message
From
19/03/2004 08:59:25
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
19/03/2004 08:41:12
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00887823
Message ID:
00887865
Views:
8
I suggest that you write your questions to "All", and not to a specific person. That way, more people will read it.

>Hello,
>I'm glad becuse you are smile
>I want to tel frind in this groupe I'm ...not...very well in english languge
>I make mastake ... every body make mastak's
>any way
>
>Kindly if you please help me for this problem .vfp code or program
> 3
>F(x)=(cos x -2x -0.5) in [0.1,1.1]

You can just use the cos() function, for example:
y = cos(x)
Angle x is in radians. If you need degrees, use dtor(), for example:
y = cos(dtor(x))
>AND  (error percentage=.0003)=m.k
>Step 1 for i= 1 to 5
>Step 2  p=(a+b)/2
>Step 3   if  F(b)*F(a) &lt 0 then
For F(x), you can use a UDF. Better give it a longer name; but I will use F() for the example:
* Main program here
* Test function f()
? f(1)
? f(2)


FUNCTION f(x)
  return cos(x) - 2*x - 0.5
ENDFUNC
> B=p
>Else
> A=p
>? p
>step 4 if i<=5 then
>IF {abcelute} (b-a) <= 0 then

For absolute value, use the abs() function. For IF, don't use THEN.


if abs(b-a) <= 0
? p
exit
else
...
endif

There is a logical error here: the absolute value of a number can be zero, but not negative.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform