Skip to content

Commit

Permalink
use relative eq for all comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulk29 committed Aug 5, 2024
1 parent 9b5bbe4 commit 593c70a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions substrate/src/simulation/waveform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ where

#[cfg(test)]
mod tests {
use approx::{assert_abs_diff_eq, assert_relative_eq, assert_relative_ne};
use approx::{assert_relative_eq, assert_relative_ne};

use super::*;

Expand Down Expand Up @@ -946,7 +946,7 @@ mod tests {
assert_relative_eq!(wav.sample_at(4.0), 0.0, epsilon = 1e-15);
assert_relative_eq!(wav.sample_at(4.3), 0.3, epsilon = 1e-15);
assert_relative_eq!(wav.sample_at(4.5), 0.5, epsilon = 1e-15);
assert_abs_diff_eq!(wav.sample_at(4.9), 0.9, epsilon = 1e-15);
assert_relative_eq!(wav.sample_at(4.9), 0.9, epsilon = 1e-15);
assert_relative_ne!(wav.sample_at(4.9) + 1e-12, 0.9, epsilon = 1e-15);
assert_relative_eq!(wav.sample_at(4.99), 0.99, epsilon = 1e-15);
assert_relative_ne!(wav.sample_at(4.99) + 1e-12, 0.99, epsilon = 1e-15);
Expand Down

0 comments on commit 593c70a

Please sign in to comment.