Skip to content

Commit

Permalink
Better justification for the use of f64::to_bits
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothée Haudebourg committed Oct 20, 2021
1 parent 9046e3f commit 48393ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl core::hash::Hash for N {
N::PosInt(i) => i.hash(h),
N::NegInt(i) => i.hash(h),
N::Float(f) => {
// Using `f64::to_bits` here is fine since any float values are always finite.
// Using `f64::to_bits` here is fine since any float values are never `Nan`.
f.to_bits().hash(h);
}
}
Expand Down

0 comments on commit 48393ab

Please sign in to comment.