From c081567bc7f4ad36bcbce9668e1067b8c71ceced Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Mon, 13 Apr 2020 14:58:26 +0100 Subject: [PATCH] Use `<= EPSILON` This seems to be the more common use. --- rasterizer/src/raster.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rasterizer/src/raster.rs b/rasterizer/src/raster.rs index ab9dd3b..fe5ea51 100644 --- a/rasterizer/src/raster.rs +++ b/rasterizer/src/raster.rs @@ -48,7 +48,7 @@ impl Rasterizer { /// rasterizer.draw_line(point(0.0, 0.48), point(1.22, 0.48)); /// ``` pub fn draw_line(&mut self, p0: Point, p1: Point) { - if (p0.y - p1.y).abs() < core::f32::EPSILON { + if (p0.y - p1.y).abs() <= core::f32::EPSILON { return; } let (dir, p0, p1) = if p0.y < p1.y {