Skip to content

Commit

Permalink
Fixed ppm calculation for negative numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
douweschulte committed Nov 7, 2023
1 parent a9d9c8a commit 6b017df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,6 @@ impl MassOverCharge {
impl Mass {
/// Absolute ppm error between this number and the given other
pub fn ppm(self, b: Self) -> f64 {
((self - b).abs() / self).value * 1e6
((self - b).abs() / self.abs()).value * 1e6
}
}

0 comments on commit 6b017df

Please sign in to comment.