Z constants, and Z format were part of the IBM F66, Fortran G and H
compilers, earlier than 1971.
IBM never had much support for octal, at least since the beginning of S/360.
It might be that earlier machines did.
-- glen
Well, those authors will perhaps answer for themselves, but it should be
noted that BOZ constants (and edit descriptors) are a feature that was added
to Fortran 90 quite late in the revision cycle, in November 1988, as a
response to requests for it during the first period of public comment. It
was done as the second part of the exercise of adapting the MIL-STD bit
intrinsics to Fortran 90, as there was clear pressure to put all MIL-STD
features into the new standard. It was clear that if you have a means for
interpreting and manipulating an integer as a bit string, then you need a
way to define it (via a DATA statement or input edit descriptor) and to
display it (via an output edit descriptor). The extension to octal and
hexadecimal was obvious.
In our "Fortran 90/95 Explained" they are listed as a new feature in Section
2.14, but don't appear in the list of major new features in Chapter 1. They
are of great value to just a subset of users.
Regards,
Mike Metcalf
A better question...why did we standardize this and not something
better? Other languages support up to 36 different base values (2-36)
in the form <base>#<value> or <base>r<value> (e.g. 16#FFFF). Supporting
just Octal and Hex was short sighted.
>
> John Harper, School of Mathematical and Computing Sciences,
> Victoria University, PO Box 600, Wellington, New Zealand
> e-mail john....@vuw.ac.nz phone (+64)(4)463 5341 fax (+64)(4)463 5045
--
Gary Scott
mailto:gary...@ev1.net
Fortran Library
http://www.fortranlib.com
Support the GNU Fortran G95 Project: http://g95.sourceforge.net
What the Dicken's is BOZ?,:-).
--
Ciao,
Gerry T.
> What the Dicken's is BOZ?,:-).
Binary, Octal, and....um...Hexadecimal. Why Z for Hexadecimal I
don't know except that H was already "taken" by Hollerith.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
BOZ constants are positive integer literal constants expressed in
binary (B) octal (O) or hexadecimal (Z - I have no clue why it's a Z).
Examples:
b'101010'
o'52'
z'2A'
All of which are, of course, the Answer.
Regrds,
David
>Subject: Re: boz-literal history
>From: Richard Maine <nos...@see.signature>
>Organization: NASA Dryden
>Date: 17 Sep 2003 07:36:05 -0700
>Newsgroups: comp.lang.fortran
>
>"Gerald F. Thomas" <gfth...@sympatico.ca> writes:
>
>> What the Dicken's is BOZ?,:-).
>
>Binary, Octal, and....um...Hexadecimal. Why Z for Hexadecimal I
>don't know except that H was already "taken" by Hollerith.
Obviously he_Z_adecimal because X was already taken as well.
At least that was the urban legend I heard back when IBM/360s
were new.
Actually, no. Charles Dickens published his first "Sketches by Boz" at the
age of 21, in 1833. The question was rhetorical - no Answer required!
Regards,
Mike Metcalf
Well, there's binary as well...I'd say the answer is precedent and parsimony
8-), in that one needs the ability to specify an exact bit pattern for certain
purposes (e.g., NANs), bitwise is error-prone, octal supports 12/36/48/60 bit
machines and hex power-of-2 machines. Who would specify some value in base-17?
Jan
"Jan C. Vorbrüggen" <jvorbr...@mediasec.de> wrote in message
news:3F687A4A...@mediasec.de...
> Who would specify some value in base-17?
"James Parsly" <japa...@tva.gov> writes:
> I do it all the time. I tell people I'm 29 years old. This year
> I'm using base 18. Next year I'll be 28, base 19.
I assume you know why programmers often get Halloween and Christmas
confused?
Because 25 Dec equals 31 Oct.
>Subject: Re: boz-literal history
>From: Jan C. =?iso-8859-1?Q?Vorbr=FCggen?= <jvorbr...@mediasec.de>
>Organization: MediaSec Technologies GmbH
>Date: Wed, 17 Sep 2003 17:14:18 +0200
>Newsgroups: comp.lang.fortran
base-17 may be uncommon but base-3 is often useful. Options may be set to
"yes", "no" or "as is". (FrameMaker users will recognize this). Or perhaps
"yes", "no" and "undecided". (For pollsters.) Some circuit level arithmetic
schemes use -1, 0 and +1 for three states. In general the use of n+1 states
for invalid and n states is good practice. I find I tend to use integer
divide and mod when packing multiple subfields as they not binary often
enough to warrant more general treatment and such things tend not to be in
performance bottlenecks. Better to be 1% slow than 100% wrong.
If you want to tie the standard makers up in knots you might request a
convenient mixed radix representation, if you can propose one. ;-)
> Jan
Good on you Mike, that's it. The question was rhetorical replete with
:-). But to be honest I didn't know what O meant so thanks to all
especially John H.
--
Ciao,
Gerry T.
Someone trying to obfuscate for security reasons perhaps? Not knowing
the base interpretation of stored data is sometimes valuable. Data
compression algorithms can switch bases for efficiency in some
predictable fashion. I don't know all the reasons or even the good ones
if they exist, I just know that I have used alternate bases for these
reasons. My main point is why add something half-???ed...
>John Harper wrote:
>>
>> The Fortran 95 Handbook by Adams, Brainerd, Martin, Smith and Wagener,
>> and also various Web pages, don't list boz-literal-constants among the
>> f90 or f95 enhancements of f77. Why not? BOZ constants are not in the
>> f77 standard, though the O and Z forms are in MIL-STD-1753. The Z form
>> was in IBM VS Fortran (1981 vintage), as an IBM extension to f77.
>
>A better question...why did we standardize this and not something
>better? Other languages support up to 36 different base values (2-36)
>in the form <base>#<value> or <base>r<value> (e.g. 16#FFFF). Supporting
>just Octal and Hex was short sighted.
>
a. BOZ constants were existing practice in a large number of existing
(F77) compilers at that time.
b. No one expressed a need for something "better".
-Kurt
Z constants were in IBM's Fortran 66 compilers, and Octal constants in
DEC's, I believe CDC's compilers, and probably others. The coresponding
FORMAT list descriptors also existed in those compilers.
When DEC came out with the VAX as a hex based machine, unlike their previous
octal machines, they added some of this to their compilers. Note, for
example, that PDP-11 instructions are divided into three bit fields, where
VAX instructions are divided into four bit fields. Reading memory dumps of
executable code is much easier in the appropriate base.
For compatibility with existing code, it is best not to use something
"better".
I suppose this leaves out 4 and 32 as possible bases for representing binary
numbers.
-- glen