Skip to content

Commit

Permalink
Remove unnecessary abs()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefffrey committed Nov 7, 2023
1 parent 1493f21 commit fe06405
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parquet/src/record/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ impl fmt::Display for Field {
Field::UInt(value) => write!(f, "{value}"),
Field::ULong(value) => write!(f, "{value}"),
Field::Float(value) => {
if !(1e-15..=1e19).contains(&value) && value.abs() != 0.0 {
if !(1e-15..=1e19).contains(&value) && value != 0.0 {
write!(f, "{value:E}")
} else if value.trunc() == value {
write!(f, "{value}.0")
Expand All @@ -746,7 +746,7 @@ impl fmt::Display for Field {
}
}
Field::Double(value) => {
if !(1e-15..=1e19).contains(&value) && value.abs() != 0.0 {
if !(1e-15..=1e19).contains(&value) && value != 0.0 {
write!(f, "{value:E}")
} else if value.trunc() == value {
write!(f, "{value}.0")
Expand Down

0 comments on commit fe06405

Please sign in to comment.