[Numpy-discussion] Would it be sensible to augment `casting` policies with a `clip` policy?

2023-03-16 Thread Sergio Callegari
I think it is a not so infrequent requirement to do castings from float types to integer types of from float types to lower precision float types where it is OK to have a loss of precision, but you want to be sure not to get values that are completely unrelated to the input ones because of wrapp

[Numpy-discussion] `dtype` parameter in `clip` method

2023-03-16 Thread Sergio Callegari
I am trying to use the `clip` method to transform floats to integers with clipping. I was expecting to be able to do both the clipping and the type conversion at once, passing the `dtype` parameter to `clip`, together with a suitable `casting` param. Such expectation came from reading the docume