Skip to content

Commit

Permalink
Add rem_euclid comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Mar 2, 2023
1 parent 5745c83 commit 95f6974
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/euler_one_qubit_decomposer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,9 @@ fn complex_phase(x: Complex64) -> f64 {

#[inline]
fn mod_2pi(angle: f64) -> f64 {
// f64::rem_euclid() isn't exactly the same as Python's % operator, but because
// the RHS here is a constant and positive it is effectively equivalent for
// this case
(angle + PI).rem_euclid(2. * PI) - PI
}

Expand Down

0 comments on commit 95f6974

Please sign in to comment.