Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: Gary Scott <garylscott@xxxxxxxxxxxxx>
- Date: Thu, 29 Mar 2007 12:20:01 GMT
glen herrmannsfeldt wrote:
Steven G. Kargl wrote:
(snip)
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:
data-stmt-constant is scalar-constant
or scalar-constant-subobject
or signed-int-literal-constant
or signed-real-literal-constant
or null-init
or structure-constructor
Bit patterns for reals can be done with TRANSFER. Yes, it isn't
portable, but REAL(BOZ) isn't portable either. I'm almost tempted
to suggest that J3 was smoking crack when it approved using BOZs
in REAL, INT, and CMPLX. It appears to be a broken attempt to fix the broken semantics of TRANSFER.
Maybe a concession to the fact that no solution is perfect,
but sometimes you need to do it anyway. I suppose I like the
REAL form better than just putting Z constants into DATA statements,
as some compilers used to allow. As far as I know, OS/360 Fortran
is the beginning of Z constants and the Z format descriptor.
(The more obvious X format descriptor already taken.)
and the even more obvious "H" format...(for hex)
-- glen
--
Gary Scott
mailto:garylscott@sbcglobal dot net
Fortran Library: http://www.fortranlib.com
Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html
If you want to do the impossible, don't hire an expert because he knows it can't be done.
-- Henry Ford
.
- Follow-Ups:
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: glen herrmannsfeldt
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- References:
- BOZ literal constants, a puzzle for us Standard-loving types.
- From: Toon Moene
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: Steven G. Kargl
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: glen herrmannsfeldt
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: Steven G. Kargl
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: glen herrmannsfeldt
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: Steven G. Kargl
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: glen herrmannsfeldt
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: Brooks Moses
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: glen herrmannsfeldt
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: Steven G. Kargl
- Re: BOZ literal constants, a puzzle for us Standard-loving types.
- From: glen herrmannsfeldt
- BOZ literal constants, a puzzle for us Standard-loving types.
- Prev by Date: Re: copy and move files
- Next by Date: Re: copy and move files
- Previous by thread: Re: BOZ literal constants, a puzzle for us Standard-loving types.
- Next by thread: Re: BOZ literal constants, a puzzle for us Standard-loving types.
- Index(es):
Relevant Pages
|
|