Namir, Byte and REXX
09-10-2018, 12:14 PM (This post was last modified: 09-10-2018 12:15 PM by toml_12953.)
Post: #6
 toml_12953 Senior Member Posts: 2,061 Joined: Dec 2013
RE: Namir, Byte and REXX
(09-07-2018 11:32 AM)Massimo Gnerucci Wrote:  A blast from the past.

While browsing a 1996 backup of an old computer of mine, I found a directory with my dabbling exercises in Personal REXX 2.0 in the late 80ies.
And, lo and behold, there I found some examples - bundled with the program - from Namir's review of the product on BYTE.

Here's one:

Code:
 /*______________________________________________________________________________*​/ /*ROOT.REX Accompanies the review, "Personal REXX" by Namir Clement Shammas, Byte, January 1988, page 167*/ /*______________________________________________________________________________*​/ /* Root seeing using Newton's method */ /* Personal REXX version */ NUMERIC DIGITS 10 NUMERIC FORM SCIENTIFIC SAY 'Enter expression (of variable X) ' pull fstring fstring = 'Y = '||fstring SAY 'Enter guess and accuracy ' pull guess accr diff = 2 * accr iter = 0 MAXITER = 30 DO WHILE ABS(diff) > accr   IF ABS(guess) > 1.0 THEN h = 0.01 * guess; ELSE h = 0.01   SAY 'guess = ' guess   diff = 2.0 * h * FF(guess) / (FF(guess + h) - FF(guess - h))   guess = guess - diff   iter = iter + 1   IF iter > MAXITER THEN diff = 0 END SAY ' ' SAY ' ' SAY 'Root = ' guess SAY ' ' SAY 'Number of iterations = ' iter EXIT FF: PROCEDURE EXPOSE fstring  arg X  INTERPRET fstring  /* variable Y is part of the interpreted fstring */  RETURN Y

Serendipity...

Has anyone tried to run this in Regina REXX? I get an error:

Code:
Enter expression (of variable X) 2*x^2+3*x-12 Enter guess and accuracy 5 .0001 guess =  5     38 +++       INTERPRET fstring     22 +++    diff = 2.0 * h * FF(guess) / (FF(guess + h) - FF(guess - h)) Error 64 running "D:\Program Files\rexx.org\Regina\demo\NewtonsRoot.rexx", line 38: [Syntax error while parsing] Error 64.1: [Syntax error at line 38]

Of course I haven't run REXX since my OS/2 days so I may be entering the data wrong.

Tom L
Cui bono?
 « Next Oldest | Next Newest »

 Messages In This Thread Namir, Byte and REXX - Massimo Gnerucci - 09-07-2018, 11:32 AM RE: Namir, Byte and REXX - Zaphod - 09-08-2018, 06:34 PM RE: Namir, Byte and REXX - Geoff - 09-10-2018, 03:07 PM RE: Namir, Byte and REXX - Duane Hess - 09-09-2018, 05:36 AM RE: Namir, Byte and REXX - Massimo Gnerucci - 09-09-2018, 10:34 AM RE: Namir, Byte and REXX - toml_12953 - 09-10-2018, 12:11 PM RE: Namir, Byte and REXX - toml_12953 - 09-10-2018 12:14 PM RE: Namir, Byte and REXX - Massimo Gnerucci - 09-10-2018, 01:26 PM RE: Namir, Byte and REXX - Thomas Klemm - 09-10-2018, 12:52 PM RE: Namir, Byte and REXX - toml_12953 - 09-11-2018, 12:35 PM RE: Namir, Byte and REXX - Thomas Klemm - 09-10-2018, 04:00 PM

User(s) browsing this thread: 1 Guest(s)