From d91f7b06defc2ad4b64e164307dbcf728af5139d Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Mon, 4 Nov 2024 13:33:02 +0100 Subject: [PATCH] reduce: prefer use of `VIPS_FABS()` (#4243) To ensure we handle negative zero (-0.0) correctly. (cherry picked from commit 852fd7c69ef6903be838fb10937994388fd81263) --- libvips/resample/templates.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libvips/resample/templates.h b/libvips/resample/templates.h index 49a56b5ae5..e652149aa3 100644 --- a/libvips/resample/templates.h +++ b/libvips/resample/templates.h @@ -361,8 +361,7 @@ static double inline filter(double x); template <> double inline filter(double x) { - if (x < 0.0) - x = -x; + x = VIPS_FABS(x); if (x < 1.0) return 1.0 - x;