Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Destroy NaN signaling and payload too
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 26, 2023
1 parent 88c032f commit 1cda03f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ impl From<f32> for Number {
impl From<f64> for Number {
fn from(mut f: f64) -> Self {
if f.is_nan() {
f = f.copysign(1.0);
// Destroy NaN sign, signaling, and payload. YAML only has one NaN.
f = f64::NAN.copysign(1.0);
}
Number { n: N::Float(f) }
}
Expand Down

0 comments on commit 1cda03f

Please sign in to comment.