MA-1
This commit is contained in:
parent
746742c044
commit
2c4163b42a
BIN
TestComplex
Normal file
BIN
TestComplex
Normal file
Binary file not shown.
@ -78,9 +78,11 @@ Complex mulComplex(Complex y, Complex x) {
|
||||
\*--------------------------------------------------------------------*/
|
||||
Complex divComplex(Complex x, Complex y)
|
||||
{
|
||||
Complex quotient;
|
||||
Complex quotient = {};
|
||||
|
||||
if(y.real != 0 && y.imag != 0 )
|
||||
{
|
||||
|
||||
quotient.real = (x.real * y.real + x.imag * y.imag) / (y.real * y.real + y.imag * y.imag);
|
||||
quotient.imag = (x.imag * y.real - x.real * y.imag) / (y.real * y.real + y.imag * y.imag);
|
||||
|
||||
@ -89,6 +91,8 @@ Complex divComplex(Complex x, Complex y)
|
||||
|
||||
return quotient;
|
||||
}
|
||||
|
||||
return quotient;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------*\
|
||||
|
BIN
libcomplex.a
Normal file
BIN
libcomplex.a
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user