[ruby-core:82568] [Ruby trunk Bug#13833] String#scanf("%a") incorrectly requires a sign on the (binary) exponent

From: tarousann11922960@...
Date: 2017-08-31 07:34:24 UTC
List: ruby-core #82568
Issue #13833 has been updated by tarotaro0 (kodai nakamura).


Hi, cabo.

I implemented to fix this bug and created PR:

https://github.com/ruby/ruby/pull/1689

Could you please check this?

----------------------------------------
Bug #13833: String#scanf("%a") incorrectly requires a sign on the (binary) exponent
https://bugs.ruby-lang.org/issues/13833#change-66386

* Author: cabo (Carsten Bormann)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
~~~
>> Float("0x1p9")
=> 512.0
>> Float("0x1p+9")
=> 512.0
>> "0x1p+9".scanf("%a")
=> [512.0]
>> "0x1p9".scanf("%a")
=> [0.0]                              # Oops
>> RUBY_VERSION
=> "2.4.1"
~~~

In scanf.rb, there are three regexps that say the equivalent of [pP][+-] where they should say [pP][+-]?



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next