[Numpy-discussion] Re: representation of valid float type range

2022-01-10 Thread alejandro . giacometti
I see what you mean, there is, however, some inconsistency on how this is handled, and it's not entirely intuitive ``` _type=np.int8 N=8 np.linspace( start=np.iinfo(_type).min, stop=np.iinfo(_type).max, num=N, dtype=_type, ) =>array([-128, -92, -56, -19, 17, 54, 90,

[Numpy-discussion] Re: representation of valid float type range

2022-01-06 Thread alejandro . giacometti
I'm not sure I know what that is? do you have a reference I can follow? ___ 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-discuss

[Numpy-discussion] Re: representation of valid float type range

2022-01-06 Thread alejandro . giacometti
Thanks for your answer. I think i understand it - is it that `f64_info.max - f64_info.min` does not fit in float64? because it approximates `2 * f64_info.max`? In that case, I agree with Klaus, linspace should be able to handle this? ___ NumPy-Discussi

[Numpy-discussion] representation of valid float type range

2021-12-29 Thread alejandro . giacometti
I am getting an interesting result, and I'm wondering if anyone would care to give me some intuition of why. The example is simple enough, I want to get a range of values that are representable by a type: ```python f64_info = np.finfo(np.float64) valid_range = np.linspace( start=f64_info.mi