This commit is contained in:
Daniel Zwanzig 2025-05-12 18:28:15 +02:00
parent 746742c044
commit 2c4163b42a
4 changed files with 5 additions and 1 deletions

BIN
TestComplex Normal file

Binary file not shown.

View File

@ -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
complex.o Normal file

Binary file not shown.

BIN
libcomplex.a Normal file

Binary file not shown.