Re: Paper on PL/I



multicsfan wrote:
The use is to get around the problem that is you have something like:

dcl a float bin;

a=3*4+2; /* IIRC this gives an answer of 4 in PL/1-F and other compilers */

all the number oare considerd fixed decimal (1,0) compile time so all the math is done as fixed decimal (1,0) until the assignment is reached at which point the fixed decimal(1,0) number is converted to float bin.

Not in any dialect of PL/I I'm familiar with. If MULTICS PL/I does that, it's a huge mistake. PL/I does have problems in this area, especially when fixed-point division is involved, but it isn't supposed to do that.


The usual decimal/binary failure is caused by not fully declaring ENTRY attributes.

CALL DOIT (2);
....

DOIT: PROCEDURE (X);
  DECLARE X FLOAT;
  ...

fails, but

DECLARE DOIT ENTRY (FLOAT);
....
CALL DOIT (2);
....

DOIT: PROCEDURE (X);
  DECLARE X FLOAT;
  ...

works.

--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
  -- Charles Williams.  "Judgement at Chelmsford"
.



Relevant Pages

  • Re: UDF and SQL2000 - Why doesnt this work?
    ... assignment to the @DailyVal variable is the problem. ... loop actually works when I return a datetime and only update the date. ... DECLARE @TempDate datetime ... DECLARE @TempVal float ...
    (microsoft.public.sqlserver.programming)
  • Re: Floating point arithmetic support in DCL
    ... If A had been previously declared as float, ... > the data type of the value that is assigned to them. ... > assignment it should contain the value 1 and be of type integer. ... Consider this - introduce a new assignment mechanism to declare ...
    (comp.os.vms)
  • Re: sound synthesis
    ... > the declarations and using short float helped, ... (defun mix (target-samples source-samples start sample-rate) ... (declare (float sample-rate seconds) ... (defun fm-gong (time freq) ...
    (comp.lang.lisp)
  • Re: Extending T-SQL with COM
    ... Using Excel for this is an extremely heavy weight way of performing what ... declare @rate float ... > GRANT EXECUTE ON dbo.sp_hexadecimal TO Public ...
    (microsoft.public.sqlserver.programming)
  • Re: fgets problem
    ... float f; ... Your array "f" is used only inside main, so there's no reason to ... declare it at file scope. ... can invoke undefined behavior in some cases. ...
    (comp.lang.c)