Skip to content

Commit

Permalink
fix: Fix sign of NaNs produced by toml macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 26, 2023
1 parent d843064 commit 2e778c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/toml/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ macro_rules! toml_internal {
}};

(@value (-nan)) => {
$crate::Value::Float(-::std::f64::NAN)
$crate::Value::Float(::std::f64::NAN.copysign(-1.0))
};

(@value (nan)) => {
$crate::Value::Float(::std::f64::NAN)
$crate::Value::Float(::std::f64::NAN.copysign(1.0))
};

(@value nan) => {
$crate::Value::Float(::std::f64::NAN)
$crate::Value::Float(::std::f64::NAN.copysign(1.0))
};

(@value (-inf)) => {
Expand Down

0 comments on commit 2e778c7

Please sign in to comment.