--On Tuesday, August 10, 2004 11:55 AM +0200 Guylaine prat
<[log in to unmask]> wrote:
> I initialise some parameters with the intrinsic function epsilon, such as:
> in one module, I create:
> integer, parameter, public :: my_real = selected_real_kind(13)
>
> elsewhere, I initailise:
> real(my_real), parameter :: epsilon_machine = epsilon(1._my_real)
>
> By writing the value epsilon_machine, I obtain:
> 1.797693134862316E+308
>
> When I write directly in the code the value epsilon(1._my_real), I obtain
> the right result: 2.220446049250313E-016
>
> So, if someone can tell me if this code is ANSI compliant,
I don't see enough actual code to tell. All you show is two isolated lines.
Although those lines look fine in isolation, there are plenty of ways
that the actual code could have errors outside of those lines.
Note in particular, that the 1.79...e+308 value looks *VERY* typical
of what is obtained from interpreting the bits of a single precision
value as double precision. This can easily happen from such errors as
argument type mismatches or lots of other causes (exceeding array
dimensions,
etc.).
I won't say that the compiler couldn't have an error, but you simply
have not shown enough for anyone to draw such a conclusion. It
shouldn't take more than a few extra lines to show a complete,
compilable and runable sample if the problem is simple.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|