This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Testing g77 with LAPACK 3.0
- To: craig at jcb-sc dot com
- Subject: Re: Testing g77 with LAPACK 3.0
- From: Kevin Maguire <kcm at tca1 dot dl dot ac dot uk>
- Date: Fri, 13 Aug 1999 15:15:21 +0100 (BST)
- cc: David dot Billinghurst at riotinto dot com dot au, egcs at egcs dot cygnus dot com
Hi
This is from a while ago, but I note that in f90
CMPLX(1.0E0,1.0E0) == CMPLX(1.0D0,1.0D0)
i.e. cmplx(.x.,.y.) returns a default complex type. This is
independent of the types of its arguements, unless the optional kind
argument is supplied. I have seen this in several F90 codes, and is
(to many users) a not-so-obvious cause of loss of precision.
I dont know about the g77 implementation of CMPLX.
Kevin
Craig wrote:
> It is due to non-standard code, though it's a popular-enough idiom that,
> perhaps, g77 should support it someday, at least for legacy code.
>
> Note that I'd recommend using a patch like this instead, to maintain
> code readability:
>
> - ALPHA = ( ONE, -ONE )
> - BETA = ( TWO, -TWO )
> + ALPHA = CMPLX ( ONE, -ONE )
> + BETA = CMPLX ( TWO, -TWO )
> RALPHA = ONE
> RBETA = TWO
> *
> --- BLAS/TESTING/cblat3.f.0 Sun Jun 9 12:15:54 1996
> +++ BLAS/TESTING/cblat3.f Mon Jul 5 11:50:16 1999
> @@ -1989,8 +1989,8 @@
> *
> * Initialize ALPHA, BETA, RALPHA, and RBETA.
> *
> - ALPHA = ( ONE, -ONE )
> - BETA = ( TWO, -TWO )
> + ALPHA = CMPLX ( ONE, -ONE )
> + BETA = CMPLX ( TWO, -TWO )
>
> tq vm, (burley)
>