Skip to content

Commit

Permalink
reduce: prefer use of VIPS_FABS() (libvips#4243)
Browse files Browse the repository at this point in the history
To ensure we handle negative zero (-0.0) correctly.

(cherry picked from commit 852fd7c)
  • Loading branch information
kleisauke authored and jcupitt committed Nov 4, 2024
1 parent 9fe7ac3 commit d91f7b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libvips/resample/templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,7 @@ static double inline filter(double x);
template <>
double inline filter<VIPS_KERNEL_LINEAR>(double x)
{
if (x < 0.0)
x = -x;
x = VIPS_FABS(x);

if (x < 1.0)
return 1.0 - x;
Expand Down

0 comments on commit d91f7b0

Please sign in to comment.