The answer is here: https://www.ibm.com/support/knowledgecenter/SSY2V3_5.2.0/com.ibm.ent.pl1.zos.doc/lr/resarithoprt.html
Joe On Mon, Sep 7, 2020 at 8:12 AM Robin Vowels <robi...@dodo.com.au> wrote: > You are looking at the wrong part of the table. > This discussion is about DECIMAL operands. > what I wrote is correct for such. > See Table 15 top entry, for ANS rules for division; > Table 16 top entry, for IBM rules. > > On 2020-09-07 22:19, Joe Monk wrote: > > 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 the ANS suboption: > > > > > > - Nonzero scale factors are not permitted in FIXED BIN declares. > > > > > > - 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 must be zero. > > > > > > > https://www.ibm.com/support/knowledgecenter/SSZHNR_2.0.0/com.ibm.ent.pl1.zos.doc/pg/rules.html > > > > Joe > > > > On Mon, Sep 7, 2020 at 12:23 AM Robin Vowels <robi...@dodo.com.au> > > wrote: > > > >> On 2020-09-07 13:05, Joe Monk wrote: > >> > "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. > >> > >> It doesn't depend on whether IBM rules or ANS rules are in force. > >> > >> What I said it correct for IBM rules also. > >> The result is always an integer. > >> See Table 16. > >> When the operands have maximum precision, the result is integer. > >> > >> The formulas for precision and scale factor are exactly the same. > >> > >> > If its RULES(ANS) and the operands are unscaled, then it > >> > will be integer division. > >> > > >> > 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) > > ---------------------------------------------------------------------- > 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