Skip to content

Commit

Permalink
Use Float#finite?.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Apr 22, 2011
1 parent 4e04749 commit d5b4cf7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/xmlrpc/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ def conv2value(param)
end

when Float
raise "Wrong value Infinity. Not allowed!" if param.infinite?
raise "Wrong value NaN. Not allowed!" if param.nan?
raise "Wrong value #{param}. Not allowed!" unless param.finite?
@writer.tag("double", param.to_s)

when Struct
Expand Down

0 comments on commit d5b4cf7

Please sign in to comment.