5 VOID
z_div(c
, a
, b
) doublecomplex
*a
, *b
, *c
;
7 extern void sig_die(char*, int);
8 void z_div(doublecomplex
*c
, doublecomplex
*a
, doublecomplex
*b
)
14 if( (abr
= b
->r
) < 0.)
16 if( (abi
= b
->i
) < 0.)
21 #ifdef IEEE_COMPLEX_DIVIDE
22 if (a
->i
!= 0 || a
->r
!= 0)
24 c
->i
= c
->r
= abi
/ abr
;
27 sig_die("complex division by zero", 1);
31 den
= b
->i
* (1 + ratio
*ratio
);
32 cr
= (a
->r
*ratio
+ a
->i
) / den
;
33 c
->i
= (a
->i
*ratio
- a
->r
) / den
;
39 den
= b
->r
* (1 + ratio
*ratio
);
40 cr
= (a
->r
+ a
->i
*ratio
) / den
;
41 c
->i
= (a
->i
- a
->r
*ratio
) / den
;