Re: compilation problem with module function interface definition



glen herrmannsfeldt wrote:
> Richard E Maine wrote:
....
>> The simplest and most problematic case is the precision of real
>> literal constants. If you have something like
>
>> x = 1.23
>
>> then the 1.23 is single precision, because that's the form of a
>> single precision constant. It does *NOT* matter what the precision
>> of x is; the single precision constant is defined without regard
>> to context. The constant 1.23 is always single precision
>> regardless of where it appears. It is fairly common for people to
>> expect 1.23 to be accurate to double precision if x is double
>> precision.
>
> The C answer to this was to always make constants double. ANSI C
> added the ability to specify single precision with a suffix f.
> Also, C normally promotes function arguments to double before
> calls, unless a prototype declaring the argument as float is in
> scope.

My own preprocessor treats KINDless literals as type RATIONAL.
Mixed mode between RATIONAL and REAL gives a REAL result
of the appropriate precision. So, 1.23 is *EXACTLY* 123/100,
which is then converted to REAL of the same precision as X when
the above assignement is done. (The actual conversion is done
in the preprocessor in this case since the argument to the conversion
is a statically known.)

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare


.



Relevant Pages

  • Re: BLAS: dgemm
    ... to a procedure requiring double precision data, ... be 'single precision correct' instead of 'double precision correct'. ... Where is the compiler supposed to get ...
    (comp.lang.fortran)
  • Re: increasing width
    ... which I get every time I want to declare real. ... used to declare single or double precision variables. ... easily support more than one "kind" of single precision variable. ... have at least 13 digits of precision, ...
    (comp.lang.fortran)
  • Re: increasing width
    ... Some fellow over in sci.math.num-analysis tells me I can get at least 6 more sig figs, if instead of declaring as type real, I declare as real. ... used to declare single or double precision variables. ... easily support more than one "kind" of single precision variable. ... have at least 13 digits of precision, ...
    (comp.lang.fortran)
  • Re: Singles to Doubles
    ... of the original code difference between direct promotion as opposed to ... Double you would have gotten full precision to start with... ... You have successfully read the existing single precision data directly ...
    (microsoft.public.vb.general.discussion)
  • Re: Using a GPU for supercomputing?
    ... GPU, because the floating point is single-precision only, and HPC ... Exploiting Single Precision Math in HPC ...
    (comp.sys.ibm.pc.hardware.chips)