As discussed 
[here](https://github.com/numpy/numpy/issues/5032#issuecomment-1830838701), 
[here](https://github.com/numpy/numpy/issues/5032#issuecomment-2307927804), and 
[here](https://github.com/google/jax/issues/18661#issuecomment-1829031914), I'm 
interested in a uniform interface for accessing the minimum or maximum value of 
a given dtype.

Currently, this requires branching on the type of dtype (boolean, integer, or 
floating point) and then (for the latter two) calling either 
[iinfo](https://numpy.org/doc/stable/reference/generated/numpy.iinfo.html) or 
[finfo](https://numpy.org/doc/stable/reference/generated/numpy.finfo.html), 
respectively. It would be more ergonomic to have a single, uniform interface 
for accessing this information that is dtype-independent.

Possible interfaces include:

```python3
import numpy as np
dt = np.dtype('int32')

dt.min
np.dtypes.info(dt).min
np.dtypes.min(dt)
np.dtypes.min_value(dt)
```
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to