Re: Unexpected 15 digits precision from "REAL"
- From: "robin" <robin_v@xxxxxxxxxxx>
- Date: Thu, 26 Mar 2009 11:02:38 GMT
"Terence" <tbwright@xxxxxxxxx> wrote in message
news:ecc87732-9b55-4a51-a49a-0d623400bbc7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am working on many old Fortran IV programs written for the IBM
mainframes of 1961-66.
My question is "What was (in the old days) the default precision of
real variables NOT defined as "double precision" nor as REAL*8, but
simple as
DIMENSION A(50),B(5),C(1)?
The data type declarations are almost all defined with dimension
statements. All references to a variable are considered to be of REAL
type unless the variable name commenced with one of the letters I to N
in wgich case ther were of integer type. There are no character and
almost no logical variables in the old programs. And the IMPLICIT
statement didn't exist at that time.
Compilations of the programs today, produce executables which run the
test data sets and ALMOST produce the exact published results on
comparison.
The only differences between expected and observed results exist only
for real variables printed or output with more than 7 digits of
precision.
(E.g. a format of F15.7 will produce trailing decimal zeroes in such a
way that the digits to the left of the string of trailing zeroes are
no more than 7 in number.
Obviously, in the PC compilation, the real variables are automatically
REAL*4 (and the integers are INTEGER*4). As a check, I dumped
unformatted work files from PC runs and determined that, on an Intel-
cored PC, the default data types were of width 4 bytes for both real
and integer variables as expected . (Compilers CVF 6.6.c and MS 3.31)
But the original compilations produced data with at least 15 digits of
precsion. Which IMPLIES that the default precision was REAL*8.
You seem to be contradicting yourself.
Three paragraphs back, you stated that the old programs
gave 7 significant (leading) digits, followed by a string of zeros.
In the paragraph directly above, you say that they gave 15 digits.
Which if true, because of COMMON alignments, means the integers
variables had to be INTEGER*8 too, Otherwise the programs wouldn't run
(unless you got lucky).
INTEGER*8 wasn't invented then.
Integer precisions were whatever the word size was.
typically 32, 36 bits, etc.
If course, in machine code, you could make an
integer as long as you needed.
Gratituous 15-digit precision (i.e. double precision)
would not have been the default because
(1) it was very slow, and
(2) doubled storage requirements,
at a time when
(a) time was expensive, and
(b) memory was scarce.
And I noted that "double precision" was ONLY used to save 6-byte
character strings as constants.
So I know why the data output from compile-running on a PC has only 7
digits of precision (Reals are REAL*4 unless specified otherwise). But
what was the situation on the Mainframes of that time?.
Am I missing something about what REAL and INTEGER meant and produced
'back then'?
No.
As for IBM's System 360, default was 32-bit integers
and reals, and double precision was 64-bit floats.
.
- Follow-Ups:
- Re: Unexpected 15 digits precision from "REAL"
- From: Terence
- Re: Unexpected 15 digits precision from "REAL"
- References:
- Unexpected 15 digits precision from "REAL"
- From: Terence
- Unexpected 15 digits precision from "REAL"
- Prev by Date: Re: array slice
- Next by Date: Re: Unexpected 15 digits precision from "REAL"
- Previous by thread: Re: Unexpected 15 digits precision from "REAL"
- Next by thread: Re: Unexpected 15 digits precision from "REAL"
- Index(es):
Relevant Pages
|