[Numpy-discussion] Re: NumPy-Discussion Digest, Vol 183, Issue 33

2021-12-29 Thread Stefano Miccoli
Lev, excuse me if I go in super pedantic mode, but your answer and the current text of the article fail to grasp an important point. 1) The proleptic Gregorian calendar is about leap year rules. It tracks days without making any assumption on the length of days. If we agree on using this calend

[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

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

2021-12-29 Thread Sebastian Gurovich
Could it be you need to get a handle on the "epsilon machine"? On Wed, 29 Dec 2021, 9:21 am , wrote: > 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 > repre

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

2021-12-29 Thread Lev Maximov
• Short answer: It's because >>> f64_info.max - f64_info.min inf • Long answer: linspace(a,b,n) tries to calculate the step by (b-a)/n and fails at (b-a). You need to either – split your range into two parts and then glue them back: np.r_[np.linspace(f64_info.min, 0, 5), np.linspace(0, f64_info