aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rexml/functions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/functions.rb')
-rw-r--r--lib/rexml/functions.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb
index c09ffdeae7..d741dbdab7 100644
--- a/lib/rexml/functions.rb
+++ b/lib/rexml/functions.rb
@@ -326,8 +326,8 @@ module REXML
else
str = string( object )
#puts "STRING OF #{object.inspect} = #{str}"
- if str =~ /^\d+/
- object.to_s.to_f
+ if str =~ /^-?\.?\d/
+ str.to_f
else
(0.0 / 0.0)
end