diff --git a/src/fcweight.c b/src/fcweight.c index 276b4679f02b4e2423ae8abaeb576a0f13bbc6ec..224299efc1036d121883915ed3409a0885be18ab 100644 --- a/src/fcweight.c +++ b/src/fcweight.c @@ -46,7 +46,7 @@ static double lerp(double x, int x1, int x2, int y1, int y2) int dx = x2 - x1; int dy = y2 - y1; assert (dx > 0 && dy >= 0 && x1 <= x && x <= x2); - return y1 + (dy*(x-x1) + dx/2) / dx; + return y1 + (x-x1) * dy / dx; } double