aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/scanf.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/scanf.rb b/lib/scanf.rb
index dd6ba6c9d0..50eefbcd2d 100644
--- a/lib/scanf.rb
+++ b/lib/scanf.rb
@@ -321,6 +321,8 @@ module Scanf
end
end
(sign == ?- ? -1 : 1) * Math.ldexp(f, exp.to_i)
+ elsif /\A([-+]?\d+)\.([eE][-+]\d+)/ =~ s
+ ($1 << $2).to_f
else
s.to_f
end