From 589ceb60a3bc33c6a5feb55c1875cc8bbceaacbb Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 16 Feb 2022 12:07:23 -0500 Subject: [PATCH] use NANs instead of zeros --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 10d05d6..976ca76 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -219,10 +219,10 @@ impl ChartManager { if !y.is_nan() { (x, x2, y) } else { - (0.0, 0.0, 0.0) + (f32::NAN, f32::NAN, f32::NAN) } }) - .filter(|ele| ele != &(0.0, 0.0, 0.0)) + .filter(|ele| ele != &(f32::NAN, f32::NAN, f32::NAN)) .collect(); let area: f32 = data2.iter().map(|(_, _, y)| y * step).sum(); // sum of all rectangles' areas (data2, area)