Re: compilation problem with module function interface definition
- From: "James Giles" <jamesgiles@xxxxxxxxxxxxxxxx>
- Date: Sun, 01 May 2005 23:31:37 GMT
Soem people may see this twice. I hit the send button
prematurely.
bv wrote:
> James Giles wrote:
>>
>> And what, *precisely*, is the definition of the operation that
>> function W performs?
>
> I thought example was self explanatory!? OK, una ves mas,
> let w() -> dble(), then
>
> external dble
> real*8 a,dble
> data x/1023.99995/
> a = dble(x)
> print*, a
> gives,
> 1024.00000000000
> 1023.99993896484
> with and w/o "external" respectively.
So, what you're saying is that the version without the external
statement works correctly and the version that you wrote as
an external mangles the data. That's what I already thought.
What part of this did you think I didn't understand?
What still not clear is how far I must be from 1024 before
the mangling stops. Or, does it always mangle? And if the
latter, to how many decimal equivalent digits does the mangling
tool assume the programmer wants mangled? What *precisely*
is the function your tool performs? Start simple: which of the
following are converted to 0.1d0 and which does it convert to
something else?
x = 0.11 -> W(x) = ?
x = 0.101 -> W(x) = ?
x = 0.1001 -> W(x) = ?
x = 0.10001 -> W(x) = ?
x = 0.100001 -> W(x) = ?
x = 0.1000001 -> W(x) = ?
Without an answer to that question the mangling tool remains
a useless curiosity. *With* and answer it may on *rare*
occasions have a legitimate use. Probably never the use
you promote, but still it may *sometimes* be useful elsewhere.
--
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
.
- Follow-Ups:
- References:
- Prev by Date: Re: help on memory corruption when visual fortran and VC++6.0 togather
- Next by Date: Re: Find the size of variables in Fortran
- Previous by thread: Re: compilation problem with module function interface definition
- Next by thread: Dirty numbers (was: compilation problem with module function interface definition)
- Index(es):
Loading