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) < 0 thenFor 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
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)