On 24 October 2013 02:42, Tony Harminc wrote:
On 23 October 2013 19:43, Paul Gilmartin wrote:
> > I have occasionally gotten
> > flamboyant and coded such as:
> >
> > X = copies( 'gubbins', A==B ) /* instead of: */
> >
> > if A==B
> > then X = 'gubbins'
> > else X = ''
On 24 October 2013 02:43, Paul Gilmartin wrote:
>
> The search may be terminated early (however infrequently) on
> discovering an exact match. But this requires an extra comparison
> if ternary results are unavailable (as they are in assembler --
> is that sufficiently on-topic?) The cost of th
>From C28-6514-5 on bitsavers, on page 16:
"Division by zero is permitted and yields a zero result."
After that, (and presumably also earlier) it has to stay that
way as code (macros) might depend on that.
There is no reason given.
-- glen
What arithmetic expression allows divide by 0?
Jon Perryman.
>
> From: Paul Gilmartin
>
>OK. Pure HLASM. I've long wondered why division by zero is permitted
>in arithmetic expressions when otherwise overflows (even in division)
>are reported as errors.
>
>The o
Never has been allowed. From the POPS for all integer divide instructions:
When the divisor is zero, or when the magnitudes of
the dividend and divisor are such that the quotient
cannot be expressed by a 32-bit signed binary integer,
a fixed-point-divide exception is recognized. This
includes the
From: "Paul Gilmartin"
Sent: Thursday, October 24, 2013 11:30 AM
OK. Pure HLASM. I've long wondered why division by zero is permitted
It is? According to my manual, the operation is suppressed,
and an exception occurs.
in arithmetic expressions when otherwise overflows (even in division
From: "Paul Gilmartin"
Sent: Thursday, October 24, 2013 11:51 AM
On 2013-10-23 18:36, robin wrote:
Any overflow is detected.
And anyway, how do you think that J > K is computed?
The comparison is performed by subtracting K from J
(without changing either J or K, of course).
Why not use t
On 2013-10-23 18:36, robin wrote:
>
> Any overflow is detected.
>
> And anyway, how do you think that J > K is computed?
>
> The comparison is performed by subtracting K from J
> (without changing either J or K, of course).
Why not use the Compare instruction? (As in Assembler
-- on-topic.)
-- g
Sounds like a plausible answer! My guess would be that IBM thought
assembler programmers sufficiently
Intelligent so as to avoid doing that!
On Oct 23, 2013 8:31 PM, "Paul Gilmartin" wrote:
> On 2013-10-23 17:54, Kurt LeBesco wrote:
> > I've been reading quietly and wondering how the dialog drift
On 2013-10-23 17:51, robin wrote:
>>>
>> ... the value of comparison operands [operators -- gil] having
>> a ternary result. Of course this is available in (zSeries)
>> assembler. It might typically shorten a table search by one
>> iteration.
>
> How is that?
>
The search may be terminated early
On 23 October 2013 19:43, Paul Gilmartin wrote:
> I have occasionally gotten
> flamboyant and coded such as:
>
> X = copies( 'gubbins', A==B ) /* instead of: */
>
> if A==B
> then X = 'gubbins'
> else X = ''
That's a very APLish thing to do.
Tony H.
From: "Paul Gilmartin"
Sent: Thursday, October 24, 2013 10:47 AM
On 2013-10-23 17:33, robin wrote:
What? Rexx'sm = ( j > k ) - ( j < k );
would be exactly the same in PL/I.
However, you would never write it like that. It's just obfuscation.
simplest (and trivial-est) in PL/I is m = si
Glad you got some use out of it.
It's a pretty simplistic implementation, but sufficient for our needs.
Although based on how rapidly the discussion veered into other languages I
thought I'd missed your point somehow.
Sent from my iPad
> On Oct 23, 2013, at 9:43 AM, "Dougie Lawson" wrote:
>
On 2013-10-23 17:54, Kurt LeBesco wrote:
> I've been reading quietly and wondering how the dialog drifted off to rexx
> and pl1 land. Can we get back on topic? Thanks
>
OK. Pure HLASM. I've long wondered why division by zero is permitted
in arithmetic expressions when otherwise overflows (even in
- Original Message -
From: "Paul Gilmartin"
To:
Sent: Thursday, October 24, 2013 10:43 AM
Subject: Re: signum
On 2013-10-23 17:26, robin wrote:
In Rexx, this could be written with no (explicit) branches
as:
m = ( j > k ) - ( j < k );
In PL/I,
m = sign(j-k);
The objective
I've been reading quietly and wondering how the dialog drifted off to rexx
and pl1 land. Can we get back on topic? Thanks
On Oct 23, 2013 7:43 PM, "Paul Gilmartin" wrote:
> On 2013-10-23 17:26, robin wrote:
> >
> >> In Rexx, this could be written with no (explicit) branches
> >> as:
> >>
> >>
From: "Paul Gilmartin"
Sent: Tuesday, October 22, 2013 1:42 AM
On 2013-10-21, at 07:13, John Gilmore wrote:
Perhaps also worth noting explicitly is that the linear-search scheme
done well is not significantly less complex than the binary-search
one.
You've earlier advocated the value of com
On 2013-10-23 17:33, robin wrote:
>
> What? Rexx'sm = ( j > k ) - ( j < k );
>
> would be exactly the same in PL/I.
>
> However, you would never write it like that. It's just obfuscation.
>
> simplest (and trivial-est) in PL/I is m = sign(j-k);
>
But beware: for extreme values of j and k this m
On 2013-10-23 17:26, robin wrote:
>
>> In Rexx, this could be written with no (explicit) branches
>> as:
>>
>>m = ( j > k ) - ( j < k );
>
> In PL/I,
>m = sign(j-k);
>
The objective was to synthesize sign() in a language such as
Rexx which, unlike PL/I, lacks it. I have occasionally gotten
- Original Message -
From: "John Gilmore"
To:
Sent: Thursday, October 24, 2013 8:09 AM
Subject: Re: signum
Boolean values are bits in PL/I.
Writing, say,
declare (a,b, d) signed binary fixed(63,0), signum signed binary fixed(7, 0),
(bigger, equal, smaller) aligned bit ;
permits eit
From: "Paul Gilmartin"
Sent: Thursday, October 24, 2013 2:28 AM
What are the representations of boolean values in PL/I?
A single bit.
True is 1, false is 0.
In Rexx, this could be written with no (explicit) branches
as:
m = ( j > k ) - ( j < k );
In PL/I,
m = sign(j-k);
Boolean values are bits in PL/I.
Writing, say,
declare (a,b, d) signed binary fixed(63,0), signum signed binary fixed(7, 0),
(bigger, equal, smaller) aligned bit ;
permits either
d = a - b ;
select ;
when(d > 0) signum = +1 ;
when(d = 0) signum = 0 ;
when(d < 0) signum = -1 ;
end ;
o
On 2013-10-23, at 07:35, robin wrote:
> From: "John Gilmore"
> Sent: Wednesday, October 23, 2013 10:02 PM
>
>
>> Interestingly, when I take your C example,
>>
>> if ( j < k ) m = -1;
>> else if (j > k) m = 1;
>> else m = 0;
>> return m;
>>
>> and rewrite it trivially modified in PL/I as
>>
>> if
From: "John Gilmore"
Sent: Wednesday, October 23, 2013 10:02 PM
Interestingly, when I take your C example,
if ( j < k ) m = -1;
else if (j > k) m = 1;
else m = 0;
return m;
and rewrite it trivially modified in PL/I as
if j < k then m = -1;
else if j > k then m = 1;
else m = 0;
ret
Hi Alan,
I found some test data.
I found a ready written IMS macro to sort my test data (which was a real
bonus).
And I got your code sample to run and get the right answer.
Thank you - I owe you a virtual beer.
To all the other correspondents - thank you - a simple request has
generated some
From: "Dougie Lawson"
Sent: Monday, October 21, 2013 10:32 PM
If I have a table of 3,500 entries of twelve bytes (I'm doing a compare of
eight bytes to find the entry I'm looking for and a check on a half word
marker for the end of the table to avoid running off the end) then is it
worth the p
I understand. I don't even need a computer to do that :-) The "return" was
just to discourage the optimizer to throw away all the code because I
didn't use the result.
The thing that kept me awake briefly was whether the optimizer would
recognize that the shortcut and code a single compare with tw
Rob,
Interestingly, when I take your C example,
if ( j < k ) m = -1;
else if (j > k) m = 1;
else m = 0;
return m;
and rewrite it trivially modified in PL/I as
if j < k then m = -1;
else if j > k then m = 1;
else m = 0;
return (m);
I cannot reproduce your results.
John Gilmor
From: "Rob van der Heij"
Sent: Wednesday, October 23, 2013 8:12 PM
Since the machine architectures that came to mind all have this 3-state
result after comparison, I expected the compiler to take advantage of it
when I write something like
if ( j < k ) m = -1;
else if (j > k) m = 1;
else m
Since the machine architectures that came to mind all have this 3-state
result after comparison, I expected the compiler to take advantage of it
when I write something like
if ( j < k ) m = -1;
else if (j > k) m = 1;
else m = 0;
return m;
A few surprises with gcc, like pretty dumb code wit
From: "John Gilmore"
Sent: Tuesday, October 22, 2013 9:31 AM
PL/I was robbed of FIXEDOVERFLOW for binary fixed values.
Use SIZE instead.
It is still
available for PL/I decimal fixed, i.e., packed decimal values.
The LE does in fact make a facility available for executing what is in
efff
31 matches
Mail list logo