[#78949] [Ruby trunk Feature#13095] [PATCH] io.c (rb_f_syscall): remove deprecation notice — kosaki.motohiro@...
Issue #13095 has been updated by Motohiro KOSAKI.
3 messages
2017/01/03
[#78997] [Ruby trunk Bug#13110] Byte-based operations for String — shugo@...
Issue #13110 has been updated by Shugo Maeda.
3 messages
2017/01/06
[#79228] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150] — Eric Wong <normalperson@...>
naruse@ruby-lang.org wrote:
5 messages
2017/01/23
[#79511] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Eric Wong <normalperson@...>
2017/02/13
Eric Wong <normalperson@yhbt.net> wrote:
[#79518] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Nobuyoshi Nakada <nobu@...>
2017/02/13
On 2017/02/13 10:04, Eric Wong wrote:
[#79298] [Ruby trunk Bug#13085][Assigned] io.c io_fwrite creates garbage — nobu@...
Issue #13085 has been updated by Nobuyoshi Nakada.
3 messages
2017/01/29
[#79337] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write — SASADA Koichi <ko1@...>
Eric:
4 messages
2017/01/31
[#79352] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write
— Eric Wong <normalperson@...>
2017/01/31
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:79270] [Ruby trunk Bug#13153] Inconsistent sprintf formatting for 0 value
From:
zn@...
Date:
2017-01-26 14:03:54 UTC
List:
ruby-core #79270
Issue #13153 has been updated by Kazuhiro NISHIYAMA.
Old ruby's results are `0x00`.
It changed between `1.9.0-0` and `1.9.0-5`.
```
% rbenv each ruby -ve 'puts "%#0.2x" % 0'
ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux]
0x00
ruby 1.8.6 (2010-09-02 patchlevel 420) [x86_64-linux]
0x00
ruby 1.8.7 (2008-05-31 patchlevel 0) [x86_64-linux]
0x00
ruby 1.8.7 (2013-12-22 patchlevel 375) [x86_64-linux]
0x00
ruby 1.9.0 (2007-12-25 revision 14709) [x86_64-linux]
0x00
ruby 1.9.0 (2008-10-04 revision 19669) [x86_64-linux]
00
ruby 1.9.1p0 (2009-01-30 revision 21907) [x86_64-linux]
00
ruby 1.9.1p431 (2011-02-18 revision 30908) [x86_64-linux]
00
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
00
ruby 1.9.2p330 (2014-08-07 revision 47094) [x86_64-linux]
00
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
00
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
00
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
00
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]
00
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
00
ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-linux]
00
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
00
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-linux]
00
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
00
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
00
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
00
```
----------------------------------------
Bug #13153: Inconsistent sprintf formatting for 0 value
https://bugs.ruby-lang.org/issues/13153#change-62688
* Author: Rick Hull
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
```ruby
0.upto(5).map { |i| "%#0.2x" % i }
# expect: ["0x00", "0x01", "0x02", "0x03", "0x04", "0x05"]
# actual: ["00", "0x01", "0x02", "0x03", "0x04", "0x05"]
```
Notice that the 0x is omitted when i == 0. The 0x prefix is specified by '#' (and 'x') in the format string. If this is expected behavior, then it sure is surprising and undocumented AFAIK. *goes back to double check*
Behavior on 2.4.0 confirmed on 2.3.3 as well.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>