Actions
Bug #1854
closedRandom#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
Actions
Like0
Like0