The `res.dtype.type is np.float64` may be preferable for these type checks. The reason is that `np.float` is a type while `res.dtype` is an instance of dtype, so it is sort of apples and oranges but `==` is implemented to make it work.