Re: compilation problem with module function interface definition




"James Giles" <jamesgiles@xxxxxxxxxxxxxxxx> wrote in message
news:t0ece.149819$cg1.131925@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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.

Whoa!, so you've just rediscovered fire.
Hurry along now Giles, you're late again!

--
You're Welcome,
Gerry T.
______
"The best lesson life has taught me is that the idiots in many cases are
right." -- Churchill.



.



Relevant Pages

  • Re: A newbie question
    ... [Automatic inference of the type and kind of literal constants). ... > There is no reason to degrade precision upon assignment. ... because the compiler fixes it up for them most of the time, ...
    (comp.lang.fortran)
  • Re: "typedef" in F95/2003?
    ... precision literal constants. ... special numbers for his literal constants. ... choosing to write them in a radix-10 representation when internally the ... Notice that this is fundamentally different from "loss of precision", ...
    (comp.lang.fortran)
  • Re: A newbie question
    ... [Automatic inference of the type and kind of literal constants]. ... >>There is no reason to degrade precision upon assignment. ... > degrees of difficulty for a compiler to figure out, ...
    (comp.lang.fortran)
  • Re: Conversion of CDC Fortran program to g77
    ... I suspect it is a precision issue. ... you mostly just have to know what precision your compiler ... declarations and literal constants. ... other thing you need to deal with is literal constants. ...
    (comp.lang.fortran)
  • Re: compilation problem with module function interface definition
    ... >> The simplest and most problematic case is the precision of real ... >> literal constants. ... the single precision constant is defined without regard ... in the preprocessor in this case since the argument to the conversion ...
    (comp.lang.fortran)