From: phdmn@gaia.phy.bris.ac.uk (Dave Newbold)
Subject: Re: how to use sincos()?
Date: 1995/08/13 [thread overview]
Message-ID: <DD99nw.24t@uns.bris.ac.uk> (raw)
In-Reply-To: 40fsbp$lra@nntpd.lkg.dec.com
Hi,
According to the manpage, sincos has a type of 'double complex', and it mentions
that the routine can only be used by languages that support that type.
At a guess, this means that you can:
- Call it from fortran, which has a 'complex*16' type. You'll need to write
a C 'buffer' routine to pass the argument, as sincos wants its argument
passed by value, not by reference. Be careful of the function prototypes
in <math.h>, or you may get unwanted type conversion.
- The fortran docs state that the complex*16 type is stored as two
consecutive real*8. So define a simple structure to mimic the double_complex
type. Again, could be problems with prototypes in the header file.
As somebody mentioned, I think the compiler recognizes apt situations to use
sincos - make sure you make it 'obvious' that you are taking the cos, sin of
the same thing (use the same variable as an argument?).
_Dave_
------------------------------------------------------------------------------
The opinions expressed here are not necessarily those of any other person
object or organisation. So don't sue them.
dave.newbold@bristol.ac.uk / dmn@vsnhd1.cern.ch / newbold@vxcern.cern.ch
prev parent reply other threads:[~1995-08-13 4:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-08-08 4:00 how to use sincos()? Brian R. Hunt
1995-08-09 4:00 ` Dave Eklund
1995-08-09 4:00 ` Brian R. Hunt
1995-08-11 4:00 ` Dave Eklund
1995-08-13 4:00 ` Dave Newbold [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox