Actions
Bug #1854
closedRandom#float Should Reject Infinity and NaN as Upper Limits
    Bug #1854:
    Random#float Should Reject Infinity and NaN as Upper Limits
  
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-08-01 trunk 24343) [i686-linux]
Backport:
Description
=begin
Random#float happily accepts Infinity and NaN as arguments. It should reject them for three reasons:
- Accepting an argument of Infinity implies that the value returned will be between 0.0 and Infinity, when in fact Infinity is always returned.
 - If Infinity or NaN were given by mistake the method would function without error despite not even being pseudo random. That is very dangerous.
 - NaN is meaningless as maximum value.
=end 
        
          
          Updated by nobu (Nobuyoshi Nakada) over 16 years ago
          
          
        
        
      
      - Status changed from Open to Closed
 - % Done changed from 0 to 100
 
=begin
Applied in changeset r24347.
=end
Actions