Skip to content

Commit

Permalink
stop hiding negative 0
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Oct 7, 2024
1 parent 35f4a85 commit 107a9da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/grid_fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl GridFmt for f64 {
fn fmt_grid(&self, params: GridFmtParams) -> Grid {
let f = *self;
let positive = f.abs();
let is_neg = f < 0.0;
let is_neg = f.is_sign_negative();
let minus = if is_neg { "¯" } else { "" };
let s = if (positive - PI).abs() <= f64::EPSILON {
format!("{minus}π")
Expand Down

0 comments on commit 107a9da

Please sign in to comment.