Message Boards Message Boards

0
|
3506 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Why this Goto[end] statement does not work?

Posted 6 years ago

The Goto [end] statement does not function, and every time I run this program, it will show hold[Goto[end]]

Attachments:
POSTED BY: Jingxuan Sun

Hi,

see this discussion.

So this works:

b = Input["enter value of base"]; 
a = Input["enter value of output"];
u = Input["enter value of upper bound"]; 
l = Input["enter value of lower bound"];
(Label[step1]; c = (u + l)/2; Print[Abs[b^c - a]];
If [b^c < a, l = c, u = c]; 
If[Abs[b^c - a] <= 0.00001, Goto[end], Goto[step1]]; Label[end]);
Print["the answer is = ", c]

Also, this is not very good programming style in the Wolfram Language.

Best wishes, Marco

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract