るりまサーチ

最速Rubyリファレンスマニュアル検索!
2589件ヒット [2501-2589件を表示] (0.111秒)

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

キーワード

検索結果

<< < ... 24 25 26 >>

Array#pack(template, buffer: String.new) -> String (291.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

...配列の内容を template で指定された文字列にしたがって、
バイナリとしてパックした文字列を返します。

テンプレートは
型指定文字列とその長さ(省略時は1)を並べたものです。長さと
して * が指定された時は「残りのデ...
...プレート文字列の通りです。

buffer が指定されていれば、バッファとして使って返値として返します。
もし template の最初にオフセット (@) が指定されていれば、
結果はオフセットの後ろから詰められます。
buffer の元の内...
...てください。
buffer のサイズ(capacity)が足りなければ、packはメモリを確保します。

//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}

@param template 自身のバイナリとしてパックする...

Kernel#check_signedness(type, headers = nil, opts = nil) -> "signed" | "unsigned" | nil (197.0)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

...Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS...
...F_', followed by the +type+
name, followed by '=X' where 'X' is positive integer if the +type+ is
unsigned, or negative integer if the +type+ is signed.

For example, if size_t is defined as unsigned, then
check_signedness('size_t') would returned +1 and the
SIGNEDNESS_OF_SIZE_T=+1 preprocesso...
...r macro would be passed to the
compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
done....

Kernel#check_signedness(type, headers = nil, opts = nil) { ... } -> "signed" | "unsigned" | nil (197.0)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

...Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS...
...F_', followed by the +type+
name, followed by '=X' where 'X' is positive integer if the +type+ is
unsigned, or negative integer if the +type+ is signed.

For example, if size_t is defined as unsigned, then
check_signedness('size_t') would returned +1 and the
SIGNEDNESS_OF_SIZE_T=+1 preprocesso...
...r macro would be passed to the
compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
done....

Range#bsearch -> Enumerator (125.0)

ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。

...要素の場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す

ブロックの評価結果が true になる最初の要素を返すか、nil を返します。


//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
(0...ary.size).bsearch {|i| ary[...
...i] >= 4 } # => 1
(0...ary.size).bsearch {|i| ary[i] >= 6 } # => 2
(0...ary.size).bsearch {|i| ary[i] >= 8 } # => 3
(0...ary.size).bsearch {|i| ary[i] >= 100 } # => nil

(0.0...Float::INFINITY).bsearch {|x| Math.log(x) >= 0 } # => 1.0
//}

find-any モードは bsearch(3) のように動作します...
...st[例][ruby]{
ary = [0, 100, 100, 100, 200]
(0..4).bsearch {|i| 100 - ary[i] } # => 1, 2 or 3
(0..4).bsearch {|i| 300 - ary[i] } # => nil
(0..4).bsearch {|i| 50 - ary[i] } # => nil
//}

上記の 2 つのモードを混在して使用しないでください(ブロックの評価結果は
常に t...

Range#bsearch {|obj| ... } -> object | nil (125.0)

ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。

...要素の場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す

ブロックの評価結果が true になる最初の要素を返すか、nil を返します。


//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
(0...ary.size).bsearch {|i| ary[...
...i] >= 4 } # => 1
(0...ary.size).bsearch {|i| ary[i] >= 6 } # => 2
(0...ary.size).bsearch {|i| ary[i] >= 8 } # => 3
(0...ary.size).bsearch {|i| ary[i] >= 100 } # => nil

(0.0...Float::INFINITY).bsearch {|x| Math.log(x) >= 0 } # => 1.0
//}

find-any モードは bsearch(3) のように動作します...
...st[例][ruby]{
ary = [0, 100, 100, 100, 200]
(0..4).bsearch {|i| 100 - ary[i] } # => 1, 2 or 3
(0..4).bsearch {|i| 300 - ary[i] } # => nil
(0..4).bsearch {|i| 50 - ary[i] } # => nil
//}

上記の 2 つのモードを混在して使用しないでください(ブロックの評価結果は
常に t...

絞り込み条件を変える

Array#bsearch -> Enumerator (107.0)

ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探 索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し ます。self はあらかじめソートしておく必要があります。

...ラメータの値か前の要素の場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す

ブロックの評価結果が true になる最初の要素を返すか、nil を返します。

//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bs...
...ラメータの値が求める値の範囲よりも大きい(j <= k < self.size)場合: 負の数を返す

ブロックの評価結果が 0 になるいずれかの要素を返すか、nil を返します。

//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
# 4 <= v < 8 になる要素を検索
ary...
...結果は
常に true/false、数値のいずれかを一貫して返すようにしてください)。
また、二分探索の各イテレーションで値がどのような順序で選ばれるかは
未規定です。

ブロックが与えられなかった場合は、 Enumerator のインス...

Array#bsearch { |x| ... } -> object | nil (107.0)

ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探 索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し ます。self はあらかじめソートしておく必要があります。

...ラメータの値か前の要素の場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す

ブロックの評価結果が true になる最初の要素を返すか、nil を返します。

//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bs...
...ラメータの値が求める値の範囲よりも大きい(j <= k < self.size)場合: 負の数を返す

ブロックの評価結果が 0 になるいずれかの要素を返すか、nil を返します。

//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
# 4 <= v < 8 になる要素を検索
ary...
...結果は
常に true/false、数値のいずれかを一貫して返すようにしてください)。
また、二分探索の各イテレーションで値がどのような順序で選ばれるかは
未規定です。

ブロックが与えられなかった場合は、 Enumerator のインス...

Array#each_index -> Enumerator (107.0)

各要素のインデックスに対してブロックを評価します。

...ブロックを評価します。

以下と同じです。

//emlist[例][ruby]{
(0 ... ary.size).each do |index|
# ....
end
//}

ブロックが与えられなかった場合は、自身と each_index から生成した
Enumerator オブジェクトを返します。

@see Array#each, Array#reve...
<< < ... 24 25 26 >>