Re: BOZ literal constants, a puzzle for us Standard-loving types.



Brooks Moses wrote:
glen herrmannsfeldt wrote:

Steven G. Kargl wrote:

There are no negative integers in gfortran. There is a unary
minus operator and whole numbers. :)

Traditionally DATA statements were maybe the only place where
signed constants were allowed. In F2003:
(snip)

We've had this conversation before, I think. I distinctly remember that Richard Maine told me I was splitting the standard's hairs far too fine when I suggested that this meant that an integer equal to -HUGE(I)-1 ought to be allowable in DATA statements even though it's an overflow elsewhere. :)

I don't believe that the standard can allow it, as it still
allows digit complement and sign magnitude representations
(as does C).

Before that post I looked to see if OS/360 Fortran allowed it as
an extension, but I didn't see it.

Regardless, yeah -- otherwise something like -23 would be an expression, which isn't allowed in DATA statement.

(snip)

Personally, I think it will make more sense once we have a BITS datatype, because a lot of this actually starts having some sort of coherency if one thinks of it as conversions between different datatypes.

Yes, PL/I does it with the bit string data type, and UNSPEC function
and pseudo-variable.

UNSPEC(r)='10000000000000000000000000000000'B;

> Otherwise, if a BOZ-literal has no type, one starts
describing it as having a context-dependent meaning, and that's completely alien to Fortran and thus fits quite poorly into the rest of the language.

You mean like character data before the CHARACTER type was added?

-- glen

.



Relevant Pages

  • Fortran - Custom Data Types
    ... Is there a way in Fortran to create a datatype that has the ... Is of type integer and when declared will ... allocate 64 bytes but when manipulate arithmetically only does 32 byte ...
    (comp.lang.fortran)
  • Re: BOZ literal constants, a puzzle for us Standard-loving types.
    ... and parameters in DATA statements, but initialization expressions ... The variable r is not initialized to the bit pattern of the BOZ ... Fortran 66 and Fortran 77 compilers with BOZ constants as an extension ...
    (comp.lang.fortran)
  • Re: Fortran - Custom Data Types
    ... > Is there a way in Fortran to create a datatype that has the ... Is of type integer and when declared will ... Fortran usually has more than 1 way to "skin a cat" ...
    (comp.lang.fortran)
  • Re: choosing programming language to deal large numbers
    ... is there a good programming language that can deal with large int ... Fortran gets more complicated, but for number-crunching it is great. ...
    (alt.linux)
  • Interface Visual Fortran and VB6
    ... I am trying to program an interface for a long Fortran ... DATA STATEMENTS ... are supposed to be passed between the VB6 and Fortran code? ...
    (comp.lang.fortran)