home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
unix
/
volume10
/
complex-lib
/
cxmul.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-07-14
|
424b
|
25 lines
/*
CxMul -- multiply one complex by another
CxMul( &a, &b ) multiplies a by b and returns &a
last edit: 86/01/04 D A Gwyn
SCCS ID: @(#)cxmul.c 1.1
*/
#include <complex.h>
complex *
CxMul( ap, bp )
register complex *ap, *bp; /* (may coincide) */
{
double ap__re = ap->re;
double bp__re = bp->re;
ap->re = ap__re * bp__re - ap->im * bp->im;
ap->im = ap__re * bp->im + ap->im * bp__re;
return ap;
}