summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 844c069c0..fbe41442b 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -3541,7 +3541,7 @@ def _percentile(a, q, axis=None, out=None,
elif interpolation == 'higher':
indices = ceil(indices).astype(intp)
elif interpolation == 'midpoint':
- indices = floor(indices) + 0.5
+ indices = 0.5 * (floor(indices) + ceil(indices))
elif interpolation == 'nearest':
indices = around(indices).astype(intp)
elif interpolation == 'linear':