[NumPy-Tickets] [NumPy] #1541: random.uniform gives inf when using finfo('float').min, finfo('float').max as intervall

NumPy Trac numpy-tickets@scipy....
Sun Aug 8 02:47:10 CDT 2010


#1541: random.uniform gives inf when using finfo('float').min, finfo('float').max
as intervall
------------------------------------------------+---------------------------
 Reporter:  bowie_22                            |       Owner:  somebody
     Type:  defect                              |      Status:  new     
 Priority:  normal                              |   Milestone:  1.5.0   
Component:  numpy.random                        |     Version:  1.4.0   
 Keywords:  Random.uniform  inf finfo('float')  |  
------------------------------------------------+---------------------------

Comment(by rgommers):

 This is because the interval is too large:
 {{{
 In [33]: np.finfo('float').max - np.finfo('float').min
 Warning: overflow encountered in double_scalars
 Out[33]: inf
 }}}
 Maybe an error should be raised instead of returning infs. This is a
 corner case though.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1541#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list