From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3dc050a3099d6072 X-Google-Attributes: gidfee84,public From: phdmn@gaia.phy.bris.ac.uk (Dave Newbold) Subject: Re: how to use sincos()? Date: 1995/08/13 Message-ID: #1/1 X-Deja-AN: 108079902 sender: usenet@uns.bris.ac.uk (Usenet news owner) references: <40fsbp$lra@nntpd.lkg.dec.com> organization: Bristol High Energy Physics reply-to: dave.newbold@bristol.ac.uk newsgroups: comp.unix.osf.osf1 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 , 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