Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test ref impl of div_add
  • Loading branch information
PaulXiCao committed Oct 25, 2025
commit e8ce02045e4686b8ff5bcefc2220a678c27e1c04
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ impl<T: Clone + Num + MulAdd<Output = T> + Neg<Output = T>> DivAdd<Complex<T>> f
let n = other.norm_sqr();
let (a, b) = (self.re, self.im);
let (c, d) = (other.re, other.im);

let re = a.clone().mul_add(c.clone(), b.clone() * d.clone());
let im = a.mul_add(-d, b * c);

Expand Down Expand Up @@ -2665,6 +2665,7 @@ pub(crate) mod test {
for &b in &non_zero_consts {
for &c in &all_consts {
assert_eq!(a.div_add(b, c), a / b + c);
assert_eq!((&a).div_add(&b, &c), a / b + c);
}
}
}
Expand Down