Re: Integer Coersion



Gordon Sande wrote:

The bundle of related isuues is confused because the situation is not
simple.
It is worth pointing out to those who advocate byte size that it does not
even address the simplest of the complicatons, namely floating point
formats.
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. How
is
a "portable" code supposed to proceed when the intrinsic response is that
there
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


.



Relevant Pages

  • RE: Excel and Busines Objects . .
    ... since you are defining the formula as a test ... the cells formats do not affect the result of the formula. ... "Rachel Costanza" wrote: ...
    (microsoft.public.excel.misc)
  • Re: Intrinsic functions in fortran 90
    ... CS people I know claim that most languages that we use are somewhere between pure compiler and pure interpreter. ... Maybe more obvious, Fortran FORMATTED I/O has to interpret the format strings, or an intermediate representation of them. ... They were left with the problem that run time formats had to be interpreted. ...
    (comp.lang.fortran)
  • Re: Is it possible to specify runtime edit descriptors in format statements ?
    ... If so, that compiler violated the standard, no matter where the spaces ... formats are the one place where blanks are ignored ... source form was a source of some controversy in an interpretation as ...
    (comp.lang.fortran)
  • Re: floating point calculations.
    ... such extra formats can be very efficient. ... However, you'll probably lose all benefits of having clear and understandable source code, unless your compiler supports such formats directly. ... That can help significantly with the syntax, but it can still be hard to get an optimal implementation. ...
    (comp.arch.embedded)
  • Re: Numerical Precision Standard
    ... standard floating point? ... If your compiler supports IEEE floating point format, ... in the fortran standard that IEEE be supported. ... or DEC VAX formats, or 72-bit DEC or UNIVAC formats). ...
    (comp.lang.fortran)