On 2020-09-08 00:15, Seymour J Metz wrote:
Did you read what I wrote? The code you wrote has nothing to do with
the expression I gave.

Oops, a typo.
The PUT should have read
PUT ( (I/J)*6 );
to produce 6.

How about

DECLARE (I, J) FIXED DECIMAL (15);
I = 4; J = 3;
PUT ((I/J*J));

That's nothing like what you wrote.
You wrote (4/3)*6

________________________________________
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on
behalf of Robin Vowels <robi...@dodo.com.au>
Sent: Monday, September 7, 2020 5:49 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: PL/I integers (was: Constant Identifiers)

On 2020-09-07 16:13, Seymour J Metz wrote:
PL/I has never had integers.

You are still wrong.

Recently you have made numerous erroneous claims about PL/I.

4 is an integer in PL/I.
3 is an integer in PL/I.

The arithmetic rules for scaled fixed
point are different from those for integers.

Scaled, with a scale factor other than zero and with
a fractional part, yes, because they are not then integers.
However, with scale factor of zero, they are integers.

In integer arithmetic,
(4/3)*6 is 6 That's not the result you get in PL/I.

With the following declarations, you'll get the same
result in PL/I, namely, 6:
DECLARE (I, J) FIXED DECIMAL (15);
I = 4; J = 3;
PUT (I/J);
will print 6

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to