From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!newshub.sdsu.edu!router2.astraweb.com!news.astraweb.com!router1.astraweb.com!sn-xt-sjc-04!sn-xt-sjc-01!sn-post-sjc-01!supernews.com!news.supernews.com!nospam From: nospam@see.signature (Richard E Maine) Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Ada vs Fortran for scientific applications Date: Wed, 24 May 2006 08:19:55 -0700 Organization: NASA Dryden Message-ID: <1hfu0ee.1k99fbgsaelhoN%nospam@see.signature> References: <44715DED.5050906@cits1.stanford.edu> <4dd87pF18ot14U1@individual.net> <447207D6.3010408@cits1.stanford.edu> <4dg101F17acafU1@individual.net> <44730df4$1@news.meer.net> <4diimsF1b0c25U1@individual.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: MacSOUP/2.7 (Mac OS X version 10.4.6) X-Complaints-To: abuse@supernews.com Xref: g2news2.google.com comp.lang.ada:4413 comp.lang.fortran:10198 Date: 2006-05-24T08:19:55-07:00 List-Id: Jan Vorbr�ggen wrote: > >>If I have a native complex type, the language implementor is free to arrange > >>the real and imaginary part in memory as he sees fit, > > Although Fortran does restrict the implementation, so the langauge > > implementer is not fully free. > > Is that through sequence association - i.e., I can assume (conceptually) > an EUIVALENCE of two reals, the real and imaginary part in that order, to > be in place for a complex variable? Yes. And it is a bit more than conceptually. The standard is pretty explicit about it.... well at least the f77 standard is. I'm failing to find quite the same words in the f2003 standard. I have no real doubt what the answer to an interp request on it would be (based on compatibility with f77), but I'm not finding the explicit words in f2003. Can anyone pint out where I might have missed them? In f2003 we have, in the section on complex type (4.4.3) "The values of a complex type are ordered pairs of real values. The first real value is called the real part. The second real value is called the imaginary part." But these words talk about values - not about representations. This sounds to me like a description of a mathematical concept. I find words elsewhere saying that complex occupies two consecutive numeric storage units, which says something about representation, but I can't find the words to say what those two storagte units have to look like. In contrast, f77 says, in its section on complex type (4.6) "The representation of a complex datum is in the form of an ordered pair of real data. The first of the pair represents the real part of the complex datum and the second represents the imaginary part. Each part has the same degreee of approximation as for a real datum. A complex datum has two consecutive numeric storage units in a storage sequence: the first storage unit is the real part and the second storage unit is the imaginary part." While the wods about an ordered pair look pretty similar, the f77 version has the word "representation", while the f2003 version doesn't. That makes them say different things acccording to me, although I'm sure the difference is unintentional. The f77 version seems to me to say the same thing twice, but the f2003 version dropped it down to zero times. Section 17.1 of f77 says the same thing a third time, but f2003 doesn't seem to have that copy either. This change in wording happened between f77 and f90. I see that even the f77 version doesn't quite seem to say what I'm sure was intended. Again, I might have missed it, but... F77 talks about the storage units being the real and imaginary parts, and it says that each part has "the same degree of approximation" as for a real datum. But I don't see that it says it has the same representation as a real datum. Now by the time you are tied down that much, I can't see why the representation wouldn't be the same in practice, but I don't say that this says it actually has to be. I'm sure that is the intent, particularly given the words in 17.2(11) and (12). Those words in section 17 don't say what values the partially associated entities become defined with, but there are no other plausible candidate values and it would be quite unlike the usual practice of the standard to say that they become defined, but to omit any mention of what value they become defined with. Sometimes things get processor-dependent values, but the standard at least tends to say that such values are processor dependent rather than just saying that there is a value, but being silent about what it might be. -- 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