### Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted:

**Sat Apr 16, 2016 4:37 am**Greetings, back in the day (mid '90s) while working with IBM at Rochester MN

(USA) I had the need for the square root function, in REXX (believe it or not).

I wrote a routine for REXX (for the S370 system) that provides not only the

square root function sqrt(n) but also the transcedental functions--

trigonometric, exponential, logarithmic, hyperbolic -- and I placed these

routines in a REXX script called COMPUTE.REX/

When Dougie Lawson (also former IBMer) pointed me to oorexx on the RPi, I got

very nostalgic for my COMPUTE.REX and the memory of a day when the sqrt(n)

function was missing from a 'computer' language. I pulled it out of my archives

and decided to share it with yous guys.

oorexx (regina-rexx) is available on the repositories; so, I downloaded it

and voila-- COMPUTE.REX still works, no hits, no runs, no errors (if you

can stand the baseball metaphor (the season is fast approaching!)

I read the man page for regina-rexx (after downloading for RPi) and found that

it 'still' has no sqrt(n) function! BIG surprise...

You can download regina-rexx with:

Read through the man page with:

For historical purposes (and just fun) I have uploaded my COMPUTE.REX module

from 1993 right here in this forum so that every RPi REXX user can 'finally'

have a sqrt(n) function... as well as arbitrary precision, and transcendentals;

including a couple of ways to calculate PI.

I'm not going to gaurantee that COMPUTE.REX is suitable for any purpose

what-so-ever, nor that it is complete, nor that it doesn't have bugs!

And, as always, we are somewhat embarrassed by our own old code... we would

surely not have done it 'that way' would we?

But, here it is for fun and enjoyment (and a bit of history to boot).

The script can be run embedded, can be placed into another script, or

can be run interactively. To start, I'll just show you how to call it in

regina-rexx at the command line to compute sqrt(2) !

To expand the tarball use:

From within the directory where you expand the tarball, run:

Now, for a little fun...

PS This is the shasum for the tarball

(USA) I had the need for the square root function, in REXX (believe it or not).

I wrote a routine for REXX (for the S370 system) that provides not only the

square root function sqrt(n) but also the transcedental functions--

trigonometric, exponential, logarithmic, hyperbolic -- and I placed these

routines in a REXX script called COMPUTE.REX/

When Dougie Lawson (also former IBMer) pointed me to oorexx on the RPi, I got

very nostalgic for my COMPUTE.REX and the memory of a day when the sqrt(n)

function was missing from a 'computer' language. I pulled it out of my archives

and decided to share it with yous guys.

oorexx (regina-rexx) is available on the repositories; so, I downloaded it

and voila-- COMPUTE.REX still works, no hits, no runs, no errors (if you

can stand the baseball metaphor (the season is fast approaching!)

I read the man page for regina-rexx (after downloading for RPi) and found that

it 'still' has no sqrt(n) function! BIG surprise...

You can download regina-rexx with:

Code: Select all

```
sudo apt-get install regina-rexx
```

Code: Select all

```
man rexx
```

from 1993 right here in this forum so that every RPi REXX user can 'finally'

have a sqrt(n) function... as well as arbitrary precision, and transcendentals;

including a couple of ways to calculate PI.

I'm not going to gaurantee that COMPUTE.REX is suitable for any purpose

what-so-ever, nor that it is complete, nor that it doesn't have bugs!

And, as always, we are somewhat embarrassed by our own old code... we would

surely not have done it 'that way' would we?

But, here it is for fun and enjoyment (and a bit of history to boot).

The script can be run embedded, can be placed into another script, or

can be run interactively. To start, I'll just show you how to call it in

regina-rexx at the command line to compute sqrt(2) !

To expand the tarball use:

Code: Select all

```
cd ~/working_directory
tar -xvf compute.tar.gz --gunzip
```

Code: Select all

```
rexx ./compute.rex 'sqrt(2)'
```

Code: Select all

```
rexx ./compute.rex 'sqrt(2)@75'
```

Code: Select all

```
rexx ./compute.rex 'pia()@200'
```

Code: Select all

```
a6cf2412916c346b50bc699a59d965d44ff25c2b compute.tar.gz
```