Re: PL/I CAN 25
From: David Frank (dave_frank_at_hotmail.com)
Date: 12/30/03
- Next message: Richard Maine: "Re: Lahey 6.2 vs Intel 5.0 module compilation: Who is right?"
- Previous message: Tony Jay: "Templating by type"
- In reply to: *** Hendrickson: "Re: PL/I CAN 25"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Dec 2003 17:07:45 GMT
"*** Hendrickson" <***.hendrickson@att.net> wrote in message
news:3FF1ABA3.EF8A8F8F@att.net...
>
>
> robin wrote:
> >
> > > 25. CANT -- asserts there is no PL/I syntax for below:
> > > . declare multiple arrays with 1 declaration for dimension.
> >
> > FALSE. dcl (a,b,c)(100,100) float;
> >
> > > . set array to random numbers with 1 statement.
> >
> > FALSE. a = random();
> >
> > > . calculate array using logic in 1 statement.
> >
> > FALSE. see below for complete program.
> >
> > > ! ---------------------------
> > > program more_array_operations
> > > real, dimension(100,100) :: a,b,c ! arrays are same 2d
> > > call random_number(a) ! set array to random
> > > call random_number(b)
> > > where ( b/=0. ) c = a/b ! no divide by zero
> > > end program
> >
> > more_array_operations:
> > procedure options (main);
> > dcl (a,b,c)(100,100) float; /* arrays are same 2d */
> > a = random(); /* set array to random */
> > b = random();
> > c = a/(b+(b=0)); /* no divide by zero */
> > end;
> I don't know any PL/I, so my answer might be a little off ;-)
> but what the heck, it's a holiday week.
>
> It doesn't look like the two programs do the same thing. I'm
> assuming b=0 is 1 where b is zero and zero otherwise. If that's
> correct then your last statement will, in general, have instances
> like
> c(i) = a(i) / 1 !when b(i) = 0
> for some values of i. If a(i) happens to ba a NaN then the PL/I
> case will trigger some sort of interrupt or fault. The Fortran
> example won't act as if it did the divides when b(i) = 0.
>
> Also, the Fortran case leaves c(i) unchanged when b(i) is zero, I'd
> guess the PL/I version sets c in all cases.
>
> *** Hendrickson
>
FWIW, I have replied to ALL these CANs in comp.lang.pl1
and my position is that he hasnt proven his CANs and they
remain CANTS.
Since you have replied to one of the asserts,
have a look at PL/I's random number and see if you can
decipher IBM's explanation as to whether it returns an array
and thus is equivalent to CALL RANDOM_NUMBER(array).
The algorithm looks like it dates back to when PL/I was
1st released.
- Next message: Richard Maine: "Re: Lahey 6.2 vs Intel 5.0 module compilation: Who is right?"
- Previous message: Tony Jay: "Templating by type"
- In reply to: *** Hendrickson: "Re: PL/I CAN 25"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]