1860件ヒット
[1-100件を表示]
(0.079秒)
ライブラリ
- ビルトイン (1454)
- abbrev (12)
- benchmark (12)
- bigdecimal (24)
- date (36)
- e2mmap (12)
- forwardable (24)
- openssl (24)
- psych (12)
- rake (24)
-
rexml
/ document (12) -
rexml
/ streamlistener (12) -
rubygems
/ commands / which _ command (12) - scanf (12)
- stringio (12)
- tsort (46)
-
webrick
/ log (24) - zlib (96)
クラス
- Array (287)
- BasicObject (12)
-
Benchmark
:: Tms (12) - BigDecimal (24)
- Date (12)
- DateTime (24)
-
Encoding
:: Converter (48) -
Enumerator
:: Lazy (117) - Float (12)
-
Gem
:: Commands :: WhichCommand (12) - Hash (74)
- IO (12)
- Integer (48)
- Module (48)
- Numeric (48)
- Object (48)
-
OpenSSL
:: BN (24) -
Psych
:: Handler (12) -
REXML
:: DocType (12) -
Rake
:: FileList (12) - Range (35)
- Regexp (12)
- String (48)
- StringIO (12)
- Struct (38)
- Time (90)
-
WEBrick
:: Log (24) -
Zlib
:: GzipReader (84) -
Zlib
:: GzipWriter (12)
モジュール
- Enumerable (513)
- Exception2MessageMapper (12)
- Forwardable (24)
-
REXML
:: StreamListener (12) - TSort (46)
キーワード
- ** (12)
- =~ (12)
- Fail (6)
- Raise (6)
- abbrev (12)
- chunk (24)
-
class
_ eval (24) - collect (12)
- count (72)
-
default
_ proc= (12) - delegate (12)
-
delete
_ if (24) - detect (24)
- divmod (24)
-
each
_ byte (24) -
each
_ strongly _ connected _ component _ from (23) - entitydecl (12)
-
enum
_ for (24) - filter (28)
- filter! (28)
- find (24)
-
find
_ all (24) -
find
_ index (36) -
find
_ paths (12) - format (12)
-
group
_ by (24) - include (12)
- inspect (6)
-
instance
_ delegate (12) -
keep
_ if (48) - lineno (12)
- lineno= (12)
- map (12)
-
mask
_ bits! (12) - max (66)
-
max
_ by (48) -
method
_ missing (12) - min (42)
-
min
_ by (48) - minmax (36)
-
minmax
_ by (24) -
mod
_ inverse (12) -
module
_ eval (24) - modulo (36)
- nonzero? (12)
- nsec (12)
- pack (21)
- partition (24)
- pathmap (12)
- pos (12)
- pow (12)
-
primitive
_ convert (48) - printf (24)
- reject (48)
- reject! (24)
- rfc3339 (12)
- scanf (12)
- select (48)
- select! (48)
-
slice
_ after (22) -
slice
_ before (36) -
slice
_ when (11) - sort (24)
-
sort
_ by! (24) -
start
_ document (12) - stat (12)
- step (21)
- strftime (24)
- subsec (12)
- tell (12)
-
time
_ format (12) -
time
_ format= (12) -
to
_ enum (24) -
to
_ h (19) -
tsort
_ each (23) -
tv
_ nsec (12) -
tv
_ sec (12) -
tv
_ usec (12) - ungetc (12)
- unpack (12)
- usec (12)
-
values
_ at (12) - write (12)
- xmlschema (12)
検索結果
先頭5件
-
BigDecimal
# %(n) -> BigDecimal (21225.0) -
self を n で割った余りを返します。
...bigdecimal'
x = BigDecimal((2**100).to_s)
( x % 3).to_i # => 1
(-x % 3).to_i # => 2
( x % -3).to_i # => -2
(-x % -3).to_i # => -1
//}
戻り値は n と同じ符号になります。これは BigDecimal#remainder とは
異なる点に注意してください。詳細は Numeric#%、
Numeric#rema... -
Numeric
# %(other) -> Numeric (21207.0) -
self を other で割った余り r を返します。
...q は整数
をみたす数です。
余り r は、other と同じ符号になります。
商 q は、Numeric#div (あるいは 「/」)で求められます。
modulo はメソッド % の呼び出しとして定義されています。
@param other 自身を割る数を指定します。
//e......mlist[例][ruby]{
p 13.modulo(4) #=> 1
p (11.5).modulo(3.5) #=> 1.0
p 13.modulo(-4) #=> -3
p (-13).modulo(4) #=> 3
p (-13).modulo(-4) #=> -1
p (-11).modulo(3.5) #=> 3.0
//}
@see Numeric#divmod, Numeric#remainder... -
String
# %(args) -> String (18293.0) -
printf と同じ規則に従って args をフォーマットします。
...ist[例][ruby]{
p "i = %d" % 10 # => "i = 10"
p "i = %x" % 10 # => "i = a"
p "i = %o" % 10 # => "i = 12"
p "i = %#d" % 10 # => "i = 10"
p "i = %#x" % 10 # => "i = 0xa"
p "i = %#o" % 10 # => "i = 012"
p "%d" % 10 # => "10"
p "%d,%o" % [10, 10] # => "10,12......トは基本的に C 言語の sprintf(3)
のものと同じです。ただし、short や long などの C 特有の型に対する修飾子が
ないこと、2進数の指示子(%b, %B)が存在すること、sprintf のすべての方言をサ
ポートしていないこと(%': 3桁区切り)な......整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるので)
..f のような表示をします。絶対値に符号を付けた形式
で出力するためには %+x、% x のように指定します。
以下は s... -
Integer
# %(other) -> Numeric (18225.0) -
算術演算子。剰余を計算します。
...算術演算子。剰余を計算します。
//emlist[][ruby]{
13 % 4 # => 1
13 % -4 # => -3
-13 % 4 # => 3
-13 % -4 # => -1
//}
@param other 二項演算の右側の引数(対象)
@return 計算結果... -
Range
# %(s) -> Enumerator :: ArithmeticSequence (18219.0) -
範囲内の要素を s おきに繰り返します。
...::ArithmeticSequence を返します。
@return ブロックを指定しなかったその他の Range の時は Enumerator を返します。(例: String の Range)
//emlist[例][ruby]{
(1..10).step(3) {|v| p v}
# => 1
# 4
# 7
# 10
("a".."f").step(2) {|v| p v}
# => "a"
# "c"
# "e"......e は each でイテレートできない
(Time.utc(2024, 12, 25)...Time.utc(2024, 12, 26)).each { |t| p t }
# => 'Range#each': can't iterate from Time (TypeError)
# step は使用可能
(Time.utc(2024, 12, 25)...Time.utc(2024, 12, 26)).step(60*60*6) { |t| p t }
# => 2024-12-25 00:00:00 UTC
# 20......24-12-25 06:00:00 UTC
# 2024-12-25 12:00:00 UTC
# 2024-12-25 18:00:00 UTC
("a"..).step("*").take(3) # => ["a", "a*", "a**"]
//}... -
Range
# %(s) -> Enumerator (18119.0) -
範囲内の要素を s おきに繰り返します。
...::ArithmeticSequence を返します。
@return ブロックを指定しなかったその他の Range の時は Enumerator を返します。(例: String の Range)
//emlist[例][ruby]{
(1..10).step(3) {|v| p v}
# => 1
# 4
# 7
# 10
("a".."f").step(2) {|v| p v}
# => "a"
# "c"
# "e"......e は each でイテレートできない
(Time.utc(2024, 12, 25)...Time.utc(2024, 12, 26)).each { |t| p t }
# => 'Range#each': can't iterate from Time (TypeError)
# step は使用可能
(Time.utc(2024, 12, 25)...Time.utc(2024, 12, 26)).step(60*60*6) { |t| p t }
# => 2024-12-25 00:00:00 UTC
# 20......24-12-25 06:00:00 UTC
# 2024-12-25 12:00:00 UTC
# 2024-12-25 18:00:00 UTC
("a"..).step("*").take(3) # => ["a", "a*", "a**"]
//}... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol (12125.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...つ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバ......source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incompl......:undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (12125.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...つ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバ......source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incompl......:undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (12125.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...つ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバ......source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incompl......:undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (12125.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...つ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバ......source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incompl......:undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive...