On Sat, 6 Mar 2004, 12:05pm +0900, [log in to unmask] wrote:
> The one thing I don't like about Fortran is not the "%" (I don't
> often use derived types anyway) but the fact that default real seems
> to be converging on four bytes. In F77 days I used only
> DOUBLE PRECISION with all real literals with a D exponent. That was
> ugly then, but in F90 I explicitly specify kind parameters for all
> real literals (not really all, I use "2" instead of "2.0_rk").
> Fortran is supposed to be for number crunching, but the most
> convenient default real can not be trusted.
What do you mean "cannot be trusted"? Do you mean "cannot be
trusted to be 8 bytes" or "cannot be trusted to be the same on
all platforms"?
The default size is generally the size that makes
the most sense on the current hardware/OS. On a 32-bit
architecture, this is, well, 32 bits. Note that breaking
the equivalence between default real and default integer
sizes would wreak real havoc, and you really don't want
64-bit default ints in a 32-bit executable.
You seem to be assuming that all or most number-crunching
applications require 8-byte reals. I see no justification
for that assumption. Why not 16-byte reals, for that matter?
So my own view is that I don't see a problem with default
reals generally being 4 bytes in length. It seems to me
that the mechanism we have for specifying other kinds is
quite adequate, if that's what you need.
-P.
|