Re: Integer Coersion
- From: "PJH" <abc@xxxxxxxxxxx>
- Date: Wed, 7 Feb 2007 19:04:57 -0000
Gordon Sande wrote:
The bundle of related isuues is confused because the situation is notsimple.
It is worth pointing out to those who advocate byte size that it does notformats.
even address the simplest of the complicatons, namely floating point
That assumes that those advocates would listen when all the evidence is to
the contrary.
I would actually say that fp format is the most difficult of the intrinsic
inquiry issues to resolve, in that it doesnt have an obvious simple
"answer". How can you define say standard IEEE 754 in comparison with other
formats? An enumerated list of possible formats is one way, but that means
that someone has to produce and maintain a master list, and what if someone
comes up with a different format, how long will it take vendors to update
the intrinsic module? Maybe the existing intrinsic functions can be used to
derive the bitfield format? But that is well beyond my limited mathematical
abilities.
In comparison, an intrinsic that gives you the bit length of a fp type kind
and ont that gives the bit size of a Byte is trivial (provided of course you
can get a standard definitin of a Byte - smallest addressable memory
location size?).
For Fortran, even if bytes are not a particularly sensible option for
defining type kinds, I would certainly like the option of defining by
minimum number of bits rather than numeric ranges.
Being able to pose a question is no guarantee that an answer exists. Howis
a "portable" code supposed to proceed when the intrinsic response is thatthere
is no such solution?
Any code that uses system dependent information is inhearently non-portable,
and is probably that way because it has to interface with other system
elements. Ideally, the programmer should know that it is non-portable and
treat it accordingly. ie separate it from the rest of the code and document
it thoroughly. If you hit a compiler that can't give answers to these
questions, either redesign the code or get a compiler that can answer them
or use a C procedure. And besides, resorting to external C procedures to
keep your core Fortran "portable" is a bit of a see-no-evil attitude.
I keep reading posts on this ng that describe all sorts of gloomy
portability scenarios, but, with little experience outside of PCs and a bit
of VAX/VMS in the dim and distant past, I have no real way to judge how
credible this doom-mongering is in current reality. Are there still
systems/compilers out there that radically depart from a "normal"
implementation and for which new fortran code is being produced? Or is the
doom'n'gloom the result of painful past memories before such a thing as a
"normal" implemetation existed?
Paul Holden
.
- Follow-Ups:
- Re: Integer Coersion
- From: glen herrmannsfeldt
- Re: Integer Coersion
- References:
- Integer Coersion
- From: PJH
- Re: Integer Coersion
- From: David Frank
- Re: Integer Coersion
- From: PJH
- Re: Integer Coersion
- From: David Frank
- Re: Integer Coersion
- From: PJH
- Re: Integer Coersion
- From: mecej4
- Re: Integer Coersion
- From: Gordon Sande
- Re: Integer Coersion
- From: PJH
- Re: Integer Coersion
- From: Gordon Sande
- Integer Coersion
- Prev by Date: Re: Integer Coersion
- Next by Date: Re: finding available kind values, precisions and exponent ranges
- Previous by thread: Re: Integer Coersion
- Next by thread: Re: Integer Coersion
- Index(es):
Relevant Pages
|