If the results are as you claim then it isn't integer division. Make up your 
mind.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


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

From: "Joe Monk" <joemon...@gmail.com>
Sent: Monday, September 07, 2020 1:05 PM


> "No it isn't.  4/3 yields 1.333333... 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.

No it doesn't. See results appended to program.

INTEGER_DIVISION:
   PROCEDURE OPTIONS (MAIN);
   DECLARE (A, B) FIXED DECIMAL (15);

   A = 4; B = 3;

   PUT (4/3);
   PUT (A/B);
   PUT ( (A/B) * 6 );

END INTEGER_DIVISION;
/* RESULTS:
  1.33333333333333                       1                       6
*/

> On Sun, Sep 6, 2020 at 7:34 PM Robin Vowels <robi...@dodo.com.au> wrote:
>
>> 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.333333... to 15 digits,
>> and is of precision (15,14)

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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

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