Issue 1:
Numpy.clip does not seem to correctly mantain the dtype of the clipped array with some clipping min and max values.

In particular, we found out that the max (and/or min) values that can be used as clipping values is 2^62, any higher number gives a different dtype wrt to the original unclipped array.

Reproducing code example:

import numpy as np

a = np.array([1,2,3,4,5])
# returns int64
print(a.dtype)

i = - int(np.exp2(64))
j = int(np.exp2(64))
ac = np.clip(a,i,j)
# returns object
print(ac.dtype)

i = - int(np.exp2(63))
j = int(np.exp2(63))
ac = np.clip(a,i,j)
# returns float64
print(ac.dtype)

i = - int(np.exp2(62))
j = int(np.exp2(62))
ac = np.clip(a,i,j)
# returns int64 again
print(ac.dtype)

As stated above, the output is:

int64
object
float64
int64

Numpy/Python version information:

numpy.version: 1.18.1

sys.version: 3.8.2 (default, Mar 10 2020, 15:23:31)

Issue 2:
This issue is probably a duplicate of #13267 and #10736, but I think that it could be interesting to know what people think what interpolation should do. The results surprised me.

Reproducing code example

import numpy as np

x = [0, 0, 0, 0, 3, 3, 3, 3]

methods = ['linear', 'lower', 'higher', 'nearest', 'midpoint']

for method in methods:
print(method)
print("=" * len(method))

for i in range(0, 110, 10):
whitespace = ' ' * (3 - len(str(i)))
print(whitespace + '{0:}-th percentile: {1}'.format(
i, np.percentile(x, i, interpolation=method)))

print()

Actual output

linear
======
0-th percentile: 0.0
10-th percentile: 0.0
20-th percentile: 0.0
30-th percentile: 0.0
40-th percentile: 0.0
50-th percentile: 1.5
60-th percentile: 3.0
70-th percentile: 3.0
80-th percentile: 3.0
90-th percentile: 3.0
100-th percentile: 3.0

lower
=====
0-th percentile: 0
10-th percentile: 0
20-th percentile: 0
30-th percentile: 0
40-th percentile: 0
50-th percentile: 0
60-th percentile: 3
70-th percentile: 3
80-th percentile: 3
90-th percentile: 3
100-th percentile: 3

higher
======
0-th percentile: 0
10-th percentile: 0
20-th percentile: 0
30-th percentile: 0
40-th percentile: 0
50-th percentile: 3
60-th percentile: 3
70-th percentile: 3
80-th percentile: 3
90-th percentile: 3
100-th percentile: 3

nearest
=======
0-th percentile: 0
10-th percentile: 0
20-th percentile: 0
30-th percentile: 0
40-th percentile: 0
50-th percentile: 3
60-th percentile: 3
70-th percentile: 3
80-th percentile: 3
90-th percentile: 3
100-th percentile: 3

midpoint
========
0-th percentile: 0.0
10-th percentile: 0.0
20-th percentile: 0.0
30-th percentile: 0.0
40-th percentile: 0.0
50-th percentile: 1.5
60-th percentile: 3.0
70-th percentile: 3.0
80-th percentile: 3.0
90-th percentile: 3.0
100-th percentile: 3.0

Expected output

linear
======
0-th percentile: 0.0
10-th percentile: 0.3
20-th percentile: 0.6
30-th percentile: 0.9
40-th percentile: 1.2
50-th percentile: 1.5
60-th percentile: 1.8
70-th percentile: 2.1
80-th percentile: 2.4
90-th percentile: 2.7
100-th percentile: 3.0

lower
=====
0-th percentile: 0
10-th percentile: 0
20-th percentile: 0
30-th percentile: 0
40-th percentile: 0
50-th percentile: 0
60-th percentile: 0
70-th percentile: 0
80-th percentile: 0
90-th percentile: 0
100-th percentile: 3

higher
======
0-th percentile: 0
10-th percentile: 3
20-th percentile: 3
30-th percentile: 3
40-th percentile: 3
50-th percentile: 3
60-th percentile: 3
70-th percentile: 3
80-th percentile: 3
90-th percentile: 3
100-th percentile: 3

nearest
=======
0-th percentile: 0
10-th percentile: 0
20-th percentile: 0
30-th percentile: 0
40-th percentile: 0
50-th percentile: 3
60-th percentile: 3
70-th percentile: 3
80-th percentile: 3
90-th percentile: 3
100-th percentile: 3

midpoint
========
0-th percentile: 0.0
10-th percentile: 1.5
20-th percentile: 1.5
30-th percentile: 1.5
40-th percentile: 1.5
50-th percentile: 1.5
60-th percentile: 1.5
70-th percentile: 1.5
80-th percentile: 1.5
90-th percentile: 1.5
100-th percentile: 3.0

Observation

The value of interpolation has an impact on the median only, while it should have an impact on all the quantiles that must be interpolated (10, 20, ..., 90) imho.

Numpy/Python version information:

import sys, numpy; print(numpy.__version__, sys.version)
1.16.4 3.7.1 (default, Dec 14 2018, 13:28:58)
[Clang 4.0.1 (tags/RELEASE_401/final)]