8 extern void sig_die(char*,int);
9 void c_div(complex *c
, complex *a
, complex *b
)
15 if( (abr
= b
->r
) < 0.)
17 if( (abi
= b
->i
) < 0.)
22 #ifdef IEEE_COMPLEX_DIVIDE
25 if (a
->i
!= 0 || a
->r
!= 0)
27 c
->i
= c
->r
= af
/ bf
;
30 sig_die("complex division by zero", 1);
33 ratio
= (double)b
->r
/ b
->i
;
34 den
= b
->i
* (1 + ratio
*ratio
);
35 cr
= (a
->r
*ratio
+ a
->i
) / den
;
36 c
->i
= (a
->i
*ratio
- a
->r
) / den
;
41 ratio
= (double)b
->i
/ b
->r
;
42 den
= b
->r
* (1 + ratio
*ratio
);
43 cr
= (a
->r
+ a
->i
*ratio
) / den
;
44 c
->i
= (a
->i
- a
->r
*ratio
) / den
;