The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Namir, Byte and REXX
09-07-2018, 11:32 AM
Post: #1
Namir, Byte and REXX
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... :)

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


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