summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/func.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/func.cc b/src/func.cc
index 4377a90..8675963 100644
--- a/src/func.cc
+++ b/src/func.cc
@@ -355,9 +355,9 @@ Value builtin_lookup(const Context *, const EvalContext *evalctx)
}
}
if (p <= low_p)
- return Value(low_v);
- if (p >= high_p)
return Value(high_v);
+ if (p >= high_p)
+ return Value(low_v);
double f = (p-low_p) / (high_p-low_p);
return Value(high_v * f + low_v * (1-f));
}
contact: Jan Huwald // Impressum