Re: Reading complex multidimensionalarrays from C
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Sat, 28 Apr 2007 11:34:05 -0700
e p chandler <epc8@xxxxxxxx> wrote:
You
are not guaranteed that a particular compiler supports what might be
declared as (non-standard) DOUBLE COMPLEX or COMPLEX*16 or a type of
complex using kinds).
Yes, support of double precision complex is guaranteed by the standard
as of f90. (The code already uses an f90 syntax and the mentioned
compilers are f90/f95 ones). You do have to use the f90 kind syntax to
declare them; the syntax forms "double cimplex" and complex*16 were not
standardized, but the functionality of double precision complex was.
In fact, the f90 standard requires that *EVERY* real kind have a
corresponding complex kind. I have seen vendors try to rationalize that
they can support a quad precision real without also supporting a quad
precision complex, but I don't think that the rationalizations hold up.
The usual rationalization claims that the quad precision real is an
extension and thus that the requirement for a corresonding complex
doesn't apply.
However, I don't buy that rationalization because I don't think such
vendors actually implement quad precision real in a way that counts as
an extension. An extension can't make standard conforming code invalid;
if that happens, the compiler is violating the standard rather than
extending it. The distinction is critical.
For example, selected_real_kind is required to return either a valid
kind number or a negative error indication. Any positive number returned
from it is supposed to be valid. I claim it is a compiler violation of
the standard - not an extension - if a positive value returned from
selected_real_kind can't be used as a complex kind value.
It might be possible to do a quad precision real in a way that counted
as an extension and had no corresponding quad complex, but I bet that's
not what any vendors do.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: Reading complex multidimensionalarrays from C
- From: glen herrmannsfeldt
- Re: Reading complex multidimensionalarrays from C
- References:
- Reading complex multidimensionalarrays from C
- From: timos
- Re: Reading complex multidimensionalarrays from C
- From: e p chandler
- Reading complex multidimensionalarrays from C
- Prev by Date: Re: Reading complex multidimensionalarrays from C
- Next by Date: Re: Reading complex multidimensionalarrays from C
- Previous by thread: Re: Reading complex multidimensionalarrays from C
- Next by thread: Re: Reading complex multidimensionalarrays from C
- Index(es):
Relevant Pages
|
|