From 802dc176f2be69c04b90c12b5adc9501f0affd35 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 28 Jul 2006 16:27:42 +0000 Subject: * io.c (io_close): always calls "close" method of the receiver. [ruby-core:6911] [ruby-core:8112] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sprintf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sprintf.c') diff --git a/sprintf.c b/sprintf.c index 9ad7e0c4c..c29b9f978 100644 --- a/sprintf.c +++ b/sprintf.c @@ -213,7 +213,12 @@ sign_bits(base, p) * s | Argument is a string to be substituted. If the format * | sequence contains a precision, at most that many characters * | will be copied. - * u | Treat argument as an unsigned decimal number. + * u | Treat argument as an unsigned decimal number. Negative integers + * | are displayed as a 32 bit two's complement plus one for the + * | underlying architecture; that is, 2 ** 32 + n. However, since + * | Ruby has no inherent limit on bits used to represent the + * | integer, this value is preceded by two dots (..) in order to + * | indicate a infinite number of leading sign bits. * X | Convert argument as a hexadecimal number using uppercase * | letters. Negative numbers will be displayed with two * | leading periods (representing an infinite string of @@ -230,6 +235,7 @@ sign_bits(base, p) * sprintf("%1$*2$s %2$d %1$s", "hello", 8) #=> " hello 8 hello" * sprintf("%1$*2$s %2$d", "hello", -8) #=> "hello -8" * sprintf("%+g:% g:%-g", 1.23, 1.23, 1.23) #=> "+1.23: 1.23:1.23" + * sprintf("%u", -123) #=> "..4294967173" */ VALUE -- cgit