aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-17 01:49:55 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-17 01:49:55 +0000
commit679a646e377340177666688c2d6baa3e0bbb140b (patch)
tree8c8924954131504fb5e672f20c4a69f53517f17d
parent66013dc6d071f432fc6a1902f8e0d16abb08aa5a (diff)
downloadruby-679a646e377340177666688c2d6baa3e0bbb140b.tar.gz
* ext/psych/lib/psych/scalar_scanner.rb: use constants rather than
calculating Inf and NaN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 248540a1dc..2167026ee3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jan 17 10:48:56 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: use constants rather than
+ calculating Inf and NaN.
+
Thu Jan 17 10:21:05 2013 Eric Hodel <drbrain@segment7.net>
* doc/syntax/miscellaneous.rdoc: Added Ending an Expression and
diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb
index 575945990f..8aa594e333 100644
--- a/ext/psych/lib/psych/scalar_scanner.rb
+++ b/ext/psych/lib/psych/scalar_scanner.rb
@@ -68,11 +68,11 @@ module Psych
string
end
when /^\.inf$/i
- 1 / 0.0
+ Float::INFINITY
when /^-\.inf$/i
- -1 / 0.0
+ -Float::INFINITY
when /^\.nan$/i
- 0.0 / 0.0
+ Float::NAN
when /^:./
if string =~ /^:(["'])(.*)\1/
@symbol_cache[string] = $2.sub(/^:/, '').to_sym