mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/scanf.rb (extract_float): allow 2.e+2 style.
[ruby-dev:42452] #3978 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
767d70841a
commit
6ca3ad34a0
2 changed files with 7 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Oct 26 18:51:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* lib/scanf.rb (extract_float): allow 2.e+2 style.
|
||||
[ruby-dev:42452] #3978
|
||||
|
||||
Tue Oct 26 18:09:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* Makefile.in (ASFLAGS): needs INCFLAGS.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue