Re: how to declare doubles in f95



<nmm1@xxxxxxxxx> wrote:

[I'll skip all the rest. We appear to have some different viewpoints.]

Well, I understood you to be referring to the default (i.e. 'native')
mode. In which case, pretty well no machine you are likely to find
today outside a few 'star wars' sites.

No, that's not what I was referring to. I was referring to whatever
situation one might end up writing code for, which could be any of
numerous situations. One might call them the "default" in some sense in
that they are the default situation for your code. It happens all the
time for any number of reasons. Your code is used in some larger
environment where the rest of the code requires such settings, or
whatever.

And still, you seem to be referring to machines instead of compilers. I
say yet again, repeatedly, and not for the first time, that I am not
referring to machines, but to compilers.

What I am talking about is things that users today might indeed run into
- not some historical or arcane scenario. I am talking about that
because I think it helps people - one's who do come here and need the
help, not for the amusement of abstract argument.

There are common compilers available and used on desktop machines today
where 64-bit reals are the default. See, for example
<http://www.g95.org/downloads.shtml> and note in particular all the
entries labelled as having 64-bit default integers (I think you'll also
find that they have 64-bit default reals, though I didn't go check).

I suppose you will now argue that those versions don't "count" for some
reason just like you argue that the computers used by most people that I
worked with in the 70s don't count. Perhaps even though 64-bits is the
default for those versions of the compiler, those versions of the
compiler aren't themselves the "default"... or something. Well, if so,
you can argue that, but I'm not interested in such a philosophical
debate. They are real compilers used by real people who will get in
trouble if they code in a way that assume that such compilers don't
exist or don't matter.

Note the comments on that page about how the versions with 64-bit
default integers "may break older programs." Apparently someone thought
this matter worth mentioning on a web site that does not appear to be
aimed exclusively at "a few 'star wars' sites". That is *EXACTLY* the
point I was making - that one should not code so as to assume that
default reals (and integers) are no more than 32 bits. It today's
environments, it is probably safe to assume that they are no less, but
it is not safe to assume that they are no more.

I have spent a non-trivial faction of my career fixing code that
hard-wired assumptions about data size. Some of the fixes were easy.
Some required comple rewrites from scratch. I recall being greatly
thrilled that f90 finally made it possible to write code that asked for
the precision I needed instead of whatever the compiler happened to
default to. I considered it one of the most important features of f90. I
still regularly see related questions in this forum, occasionally from
people who have ignored relevant advice and then later had it come back
to bite them. You are not going to be able to convince me that all such
issues should henceforth be ignored.

I do and will continue to recommend that people use the facilities of
f90+ to select precision rather than asuming that the compiler's
defaults will be right. I have 40 years of experience in this field
(yes, I realize yours is comparable) that makes me confident this is
good advice. See my signature, which is extremely pertinent.

I see no point in prolonging this discussion, at least on my side. There
simply is nothing that you will be able to say that will convince me
that it is good advice to tell people to ignore the issue. If that's not
what you are suggesting, then good.

--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: how to declare doubles in f95
    ... that's not what I was referring to. ... you seem to be referring to machines instead of compilers. ... rather than mainstream programming. ...
    (comp.lang.fortran)
  • Re: Code density and performance?
    ... >and used by the kernel and many ISVs. ... I was referring to. ... compilers, except in a few special cases. ... and the usefulness of profile-based optimisations ...
    (comp.arch)
  • Re: KIND question -- part II
    ... can't use values bigger than, for example, 10**2 if you specify ... If you use the KIND facility specify lots of different minimum ranges ... likely to run into compilers where it is less than 32 bits. ... For reals, I find convincing arguments to specify kinds instead of using ...
    (comp.lang.fortran)
  • Re: KIND question -- part II
    ... can't use values bigger than, for example, 10**2 if you specify ... If you use the KIND facility specify lots of different minimum ranges ... likely to run into compilers where it is less than 32 bits. ... For reals, I find convincing arguments to specify kinds instead of using ...
    (comp.lang.fortran)
  • Re: A function is an address
    ... of today's compilers. ... but this is due to the language ... actually calling it) normally produces a pointer to that function. ... on real machines is, in general, the address of the first instruction ...
    (comp.lang.c)