From 7d9b746c66571c0d3912b09a078fbfe3c32ce9fb Mon Sep 17 00:00:00 2001 From: Paulo van Breugel Date: Wed, 20 Sep 2023 16:54:09 +0200 Subject: [PATCH] Update fuzzy.c Replace the `abs` function (works with integer values) with the `fabs` function (works with floating and double values) --- src/raster/r.fuzzy.set/fuzzy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/raster/r.fuzzy.set/fuzzy.c b/src/raster/r.fuzzy.set/fuzzy.c index 958b8ae9ec..50c7f7e6a5 100644 --- a/src/raster/r.fuzzy.set/fuzzy.c +++ b/src/raster/r.fuzzy.set/fuzzy.c @@ -1,5 +1,6 @@ #include #include "local_proto.h" +#include float fuzzy(FCELL cell) { @@ -42,7 +43,7 @@ float fuzzy(FCELL cell) } if (type == SSHAPE) { - m = pow(2, exp(2 * abs(shape))); + m = pow(2, exp(2 * fabs(shape))); return (shape < 0) ? 1 - pow(cos(x * PI2), m) : pow(sin(x * PI2), m); }