summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-01-16 17:50:52 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2013-01-16 17:56:57 -0800
commit2e8f82404c3911618e3dc3bec3a9e5e6b414f95a (patch)
tree0f1b296e4a3b8d198d1c738be125fb0c95c4af29 /lib
parente3a7fce6f3109d9b880c1450a3e98b3b37adf34a (diff)
downloadpsych-2e8f82404c3911618e3dc3bec3a9e5e6b414f95a.tar.gz
* ext/psych/lib/psych/scalar_scanner.rb: use constants rather than
calculating Inf and NaN.
Diffstat (limited to 'lib')
-rw-r--r--lib/psych/scalar_scanner.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb
index 5759459..8aa594e 100644
--- a/lib/psych/scalar_scanner.rb
+++ b/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