On Tue, 8 Sep 2020 01:04:43 +1000, Greg Price wrote:
>On 2020-09-05 3:01 AM, Paul Gilmartin wrote:
>
>... A few years back there seemed to be a
>religious phase where IBM ID went on a crusade to remove weasel words
>from documentation.
>...
>As it was, whole sections of text I wrote for
From: IBM Mainframe Discussion List on behalf of
Greg Price
Sent: Monday, September 7, 2020 11:04 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
On 2020-09-05 3:01 AM, Paul Gilmartin wrote:
> If the number 3.1416 is used in more than one pl
On 2020-09-05 3:01 AM, Paul Gilmartin wrote:
If the number 3.1416 is used in more than one place in the program,
or if it requires specific data or precision attributes, you must declare
it as a named constant.
In the olden days - years before the iPhone 6 was a thing - there
://mason.gmu.edu/~smetz3
From: IBM Mainframe Discussion List on behalf of Joe
Monk
Sent: Monday, September 7, 2020 8:04 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
"No, FIXED BIN(15,0) is not an integer, and the precision rule
Actually it does...
Under the IBM suboption:
- Nonzero scale factors are permitted in FIXED BIN declarations.
- If the result of any precision-handling built-in function (ADD,
BINARY, and so on) has FIXED BIN attributes, the specified or implied scale
factor can be nonzero.
Under
Fortran mindset.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
>
> From: IBM Mainframe Discussion List on behalf
> of Joe Monk
> Sent: Sunday, September 6, 2020 7:35 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
&
: IBM Mainframe Discussion List on behalf of
Robin Vowels
Sent: Sunday, September 6, 2020 7:06 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
- Original Message -
From: "Seymour J Metz"
To:
Sent: Monday, September 07, 2020 5:33 AM
> PL/I doesn't have in
:58 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
From: "Paul Gilmartin" <000433f07816-dmarc-requ...@listserv.ua.edu>
To:
Sent: Sunday, September 06, 2020 1:33 PM
On Sat, 5 Sep 2020 08:13:42 +1000, Robin Vowels wrote:
>
>As for writing formulas, I p
On 2020-09-07 13:05, Joe Monk wrote:
"No it isn't. 4/3 yields 1.33... to 15 digits,
and is of precision (15,14)"
Depends on RULES(IBM) or RULES(ANS). If its RULES(IBM) it will never be
integer division.
It doesn't depend on whether IBM rules or ANS rules are in force.
What I said it
, September 6, 2020 7:35 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
"PL/I doesn't have integers."
Sorry Shmuel, youre incorrect.
FIXED BINARY (15,0) is a 2 byte integer and FIXED BINARY (31,0) is a 4 byte
integer.
"The ratiio 4/3 is FIXED BIN,"
No, it
PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
From: "Paul Gilmartin" <000433f07816-dmarc-requ...@listserv.ua.edu>
To:
Sent: Sunday, September 06, 2020 1:33 PM
On Sat, 5 Sep 2020 08:13:42 +1000, Robin Vowels wrote:
>
>As for writing formulas, I p
List on behalf of
Robin Vowels
Sent: Sunday, September 6, 2020 8:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
- Original Message -
From: "Paul Gilmartin" <000433f07816-dmarc-requ...@listserv.ua.edu>
Sent: Sunday, September 06, 2020 11:07 PM
On
"No it isn't. 4/3 yields 1.33... to 15 digits,
and is of precision (15,14)"
Depends on RULES(IBM) or RULES(ANS). If its RULES(IBM) it will never be
integer division. If its RULES(ANS) and the operands are unscaled, then it
will be integer division.
Joe
On Sun, Sep 6, 2020 at 7:34 PM Robin
On 2020-09-07 09:35, Joe Monk wrote:
"PL/I doesn't have integers."
Sorry Shmuel, youre incorrect.
FIXED BINARY (15,0) is a 2 byte integer and FIXED BINARY (31,0) is a 4
byte
integer.
"The ratiio 4/3 is FIXED BIN,"
No, its FIXED DECIMAL (1,0)...
No it isn't. 4/3 yields 1.33... to 15
From: "Bob Bridges"
Sent: Monday, September 07, 2020 8:29 AM
To tell you the truth, I haven't written for a compiler in long enough that
I don't have any idea which ones do what. I wouldn't trust REXX, CLIST or
VBA to do it; I try to assume the worst, and make such things explicit.
Actually
From: "Robert Prins"
Sent: Monday, September 07, 2020 3:42 AM
On 2020-09-06 13:07, Paul Gilmartin wrote:
On Sun, 6 Sep 2020 17:25:45 +1000, Robin Vowels wrote:
Beware! Than might left-associate as:
volume = ( 4/3 ) * 3.14159 * radius**3
... and the quotient of integers, 4/3, is 1.
- Original Message -
From: "Paul Gilmartin" <000433f07816-dmarc-requ...@listserv.ua.edu>
Sent: Sunday, September 06, 2020 11:07 PM
On Sun, 6 Sep 2020 17:25:45 +1000, Robin Vowels wrote:
And C:
662 $ cat typetest.c
#include
int main() {
printf( "%10.6f\n", 4/3 * 3.14159 );
From: "Paul Gilmartin" <000433f07816-dmarc-requ...@listserv.ua.edu>
To:
Sent: Sunday, September 06, 2020 1:33 PM
On Sat, 5 Sep 2020 08:13:42 +1000, Robin Vowels wrote:
As for writing formulas, I prefer to follow a well-known formula, thus:
volume = 4/3 * 3.14159 * radius**3
Beware!
half
> of Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
> Sent: Saturday, September 5, 2020 11:33 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: Constant Identifiers
>
> On Sat, 5 Sep 2020 08:13:42 +1000, Robin Vowels wrote:
> >
> >As for writi
- Original Message -
From: "Seymour J Metz"
To:
Sent: Monday, September 07, 2020 5:33 AM
PL/I doesn't have integers.
PL/I has always had integers.
The ratiio 4/3 is FIXED BIN,
No it not. It is FIXED DECIMAL -- as I said a few days ago.
And it hasn't changed since.
with some
"Seymour J Metz" wrote in message
news:bl0pr05mb5156591ed17d7bddfaee695299...@bl0pr05mb5156.namprd05.prod.outlook.com...
The default type for 3 and 4 is FIXED BINARY.
No it's not.
Constants have the type and precision of the constant.
Thus, 3 and 4 are both FIXED DECIMAL (1)
> PL/I does not
: Sunday, September 6, 2020 6:29 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
To tell you the truth, I haven't written for a compiler in long enough that
I don't have any idea which ones do what. I wouldn't trust REXX, CLIST or
VBA to do it; I try to assume the worst, and make
To tell you the truth, I haven't written for a compiler in long enough that
I don't have any idea which ones do what. I wouldn't trust REXX, CLIST or
VBA to do it; I try to assume the worst, and make such things explicit.
Actually I might not trust a compiler to do it, either, even if I knew
Ah, that makes more sense than my first guess.
---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313
/* Logic is an organized way of going wrong with confidence. -Kettering's
Law, quoted in _The Number of the Beast_ by Robert A Heinlein. */
-Original Message-
From: IBM Mainframe
arc-requ...@listserv.ua.edu>
Sent: Saturday, September 5, 2020 11:33 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
On Sat, 5 Sep 2020 08:13:42 +1000, Robin Vowels wrote:
>
>As for writing formulas, I prefer to follow a well-known formula, thus:
>
>volume = 4/3 * 3
://mason.gmu.edu/~smetz3
From: IBM Mainframe Discussion List on behalf of
Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
Sent: Sunday, September 6, 2020 9:07 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
On Sun, 6 Sep 2020
On 2020-09-06 13:07, Paul Gilmartin wrote:
On Sun, 6 Sep 2020 17:25:45 +1000, Robin Vowels wrote:
Beware! Than might left-associate as:
volume = ( 4/3 ) * 3.14159 * radius**3
... and the quotient of integers, 4/3, is 1.
No it's not. 4/3 yields 1.33.. to 15 digits in PL/I.
As I remember PL/1 from the 1980s (and very definitely pre-LE) the rules
for implicit conversions were well-defined, but needed care. Simply adding
parentheses would allow me to control the use of integer operations.
I'll be watching for more recent (relevant) exerience :-)
Rupert
On Sun., Sep.
On Sun, 6 Sep 2020 17:25:45 +1000, Robin Vowels wrote:
>>>
>> Beware! Than might left-associate as:
>> volume = ( 4/3 ) * 3.14159 * radius**3
>> ... and the quotient of integers, 4/3, is 1.
>
>No it's not. 4/3 yields 1.33.. to 15 digits in PL/I.
>You're thinking of FORTRAN.
>
And
On 2020-09-06 13:33, Paul Gilmartin wrote:
On Sat, 5 Sep 2020 08:13:42 +1000, Robin Vowels wrote:
As for writing formulas, I prefer to follow a well-known formula,
thus:
volume = 4/3 * 3.14159 * radius**3
Beware! Than might left-associate as:
volume = ( 4/3 ) * 3.14159 * radius**3
On Sat, 5 Sep 2020 08:13:42 +1000, Robin Vowels wrote:
>
>As for writing formulas, I prefer to follow a well-known formula, thus:
>
>volume = 4/3 * 3.14159 * radius**3
>
Beware! Than might left-associate as:
volume = ( 4/3 ) * 3.14159 * radius**3
... and the quotient of integers, 4/3, is 1.
to floating-point).
- Original Message -
From: "Bob Bridges"
Newsgroups: bit.listserv.ibm-main
To:
Sent: Sunday, September 06, 2020 6:18 AM
Subject: Re: Constant Identifiers
When you care about efficiency, I'd think this would be better:
const=4/3*3.14159E0 /* in the init
: Friday, September 4, 2020 9:04 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
"Seymour J Metz" wrote in message
news:bl0pr05mb5156e311e88735a8afbef5ca99...@bl0pr05mb5156.namprd05.prod.outlook.com...
> If you don't care about maintainable code than should is to strong.
: Re: Constant Identifiers
When you care about efficiency, I'd think this would be better:
const=4/3*3.14159E0 /* in the initialization */
volume=const*radius**3 /* inside the loop */
---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313
/* Things may come to those who wait, but only
du/~smetz3
From: IBM Mainframe Discussion List on behalf of Bob
Bridges
Sent: Saturday, September 5, 2020 4:21 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
Going back to the beginning, Gil: SQRT(X**TWO+Y**TWO) looks like ~exactly~ the
sort of thing t
On Sat, 5 Sep 2020, at 21:21, Bob Bridges wrote:
> Going back to the beginning, Gil: SQRT(X**TWO+Y**TWO) looks like
> ~exactly~ the sort of thing that oughta be made a constant rather than
> being coded more than once. That is, if X, Y and TWO all constants
> themselves; and if they are not
Going back to the beginning, Gil: SQRT(X**TWO+Y**TWO) looks like ~exactly~ the
sort of thing that oughta be made a constant rather than being coded more than
once. That is, if X, Y and TWO all constants themselves; and if they are not
then this isn't an example of what you're talking about.
When you care about efficiency, I'd think this would be better:
const=4/3*3.14159E0 /* in the initialization */
volume=const*radius**3 /* inside the loop */
---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313
/* Things may come to those who wait, but only those things left behind by
Gotta side with Robin on that one.
---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313
/* Law #37 of combat operations: Anything you do can get you killed, including
nothing. */
-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf
"Seymour J Metz" wrote in message
news:bl0pr05mb5156e311e88735a8afbef5ca99...@bl0pr05mb5156.namprd05.prod.outlook.com...
If you don't care about maintainable code than should is to strong.
If you care about maintainable code then should is too weak.
The purpose of a LRM is to tell you what
Sent: Friday, September 4, 2020 6:13 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
On 2020-09-05 05:03, Paul Gilmartin wrote:
> On Fri, 4 Sep 2020 17:10:36 +, Farley, Peter x23353 wrote:
>
>> Sounds to me like the documentation writer was a bit confused. Looks
&
From: IBM Mainframe Discussion List on behalf of
Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
Sent: Friday, September 4, 2020 5:37 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
On Fri, 4 Sep 2020 17:04:34
On 2020-09-05 05:03, Paul Gilmartin wrote:
On Fri, 4 Sep 2020 17:10:36 +, Farley, Peter x23353 wrote:
Sounds to me like the documentation writer was a bit confused. Looks
to me like it should read instead:
If th nnumber 3.1416 is used in more than one place in the program,
then you
On 2020-09-05 01:43, Paul Gilmartin wrote:
I'm a PL/I novice, or less. A recent thread here moved me
to browse the Ref., where I read that any constant used more
than once must be declared and the identifier used instead.
Sorta tyrannical enforcement of coding conventions. OK.
I agree that
On Fri, 4 Sep 2020 17:04:34 +, Seymour J Metz wrote:
>Do you have a URL and page number? Is that an exact quote, or was there a
>conditional?
>
I cited the Language Ref.
>It is good form to use a constant that stands for itself, e.g., "X**2". It is
>bad form to use a constant for, e.g.,
On Fri, 4 Sep 2020 17:10:36 +, Farley, Peter x23353 wrote:
>Sounds to me like the documentation writer was a bit confused. Looks to me
>like it should read instead:
>
>If th nnumber 3.1416 is used in more than one place in the program, then you
>*should* declare it as a named constant.
>If
Sent: Friday, September 4, 2020 3:06 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
On 2020-09-04 15:43, Paul Gilmartin wrote:
> I'm a PL/I novice, or less. A recent thread here moved me
> to browse the Ref., where I read that any constant used more
> than
On 2020-09-04 17:01, Paul Gilmartin wrote:
I see everything twice:
On Fri, 4 Sep 2020 19:05:32 +, Robert Prins wrote:
On Fri, 4 Sep 2020 19:06:49 +, Robert Prins wrote:
Yes, problems posting. Should be OK now.
And I don't think that anyone in their right mind would ever use anything
du/~smetz3
From: IBM Mainframe Discussion List on behalf of
Farley, Peter x23353 <031df298a9da-dmarc-requ...@listserv.ua.edu>
Sent: Friday, September 4, 2020 1:10 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
Sounds to me like the documentation writer wa
u.edu/~smetz3
From: IBM Mainframe Discussion List on behalf of
Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
Sent: Friday, September 4, 2020 1:00 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
On Fri, 4 Sep 2020 10:
in the
program, then you *must* declare it as a named constant.
Peter
-Original Message-
From: IBM Mainframe Discussion List On Behalf Of
Paul Gilmartin
Sent: Friday, September 4, 2020 1:01 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers
On Fri, 4 Sep 2020 10:55:19
Do you have a URL and page number? Is that an exact quote, or was there a
conditional?
It is good form to use a constant that stands for itself, e.g., "X**2". It is
bad form to use a constant for, e.g., an approximation, an empirical value, a
value subject to regulatory change. The general
On Fri, 4 Sep 2020 10:55:19 -0500, Steve Smith wrote:
>I'm not a PL/I novice, if not an expert. Whatever you read, it does not
>mean what you think it means.
>
Enterprise PL/I for z/OS Language Reference
Version 5 Release 1 IBM SC27-8940-00
Datatypes and attributes. . . 17
If the number
On 2020-09-04 15:43, Paul Gilmartin wrote:
> I'm a PL/I novice, or less. A recent thread here moved me
> to browse the Ref., where I read that any constant used more
> than once must be declared and the identifier used instead.
> Sorta tyrannical enforcement of coding conventions. OK.
> I agree
On 2020-09-04 15:43, Paul Gilmartin wrote:
I'm a PL/I novice, or less. A recent thread here moved me
to browse the Ref., where I read that any constant used more
than once must be declared and the identifier used instead.
Sorta tyrannical enforcement of coding conventions. OK.
I agree that
I'm not a PL/I novice, if not an expert. Whatever you read, it does not
mean what you think it means.
A constant (or variable) named TWO is an abomination in any language.
sas
On Fri, Sep 4, 2020 at 10:44 AM Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
> I'm a PL/I
56 matches
Mail list logo