pub fn div(self: Self, other: Self) Self
Returns the quotient of two complex numbers.
self: Self
other: Self
70 71 72 73 74 75 76 77 78 79
pub fn div(self: Self, other: Self) Self { const re_num = self.re * other.re + self.im * other.im; const im_num = self.im * other.re - self.re * other.im; const den = other.re * other.re + other.im * other.im; return Self{ .re = re_num / den, .im = im_num / den, }; }
Returns the quotient of two complex numbers.