For Programmers: Free Programming Magazines  


Home > Archive > Fortran > December 2004 > Re: small numerical differences in floating point result between









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: small numerical differences in floating point result between
Richard E Maine

2004-12-15, 3:59 pm

Rich Townsend <rhdt@barVOIDtol.udel.edu> writes:

[code elided]

> Now, both compilers I've tried this on compile and run without error
> (Lahey and Intel). Assuming such behaviour is *correct*, this means
> that -- so long as one knows its definition -- a derived type with
> private components can be ped into. Presumably, these components
> can be poked as well. Wow -- the gates to a whole new continent of
> cruft have just opened before me!


"Correct" isn't the right term here. Such behavior is allowed.
It is not guaranteed. Derived types don't *HAVE* to be laid out
with internal structure the qay you might expect... and sometimes
they aren't. Your odds are probably good in the particular case
you showed, but it is by no means guaranteed by the standard.

Yes, TRANSFER is one of the tools to use when you want to
hack like that. But, in addition my comment about dragons, I
might summarize it by saying that if you have to ask, then you
probably shouldn't be doing it. :-(

--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com