るりまサーチ

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

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer chr
  5. integer new

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Integer#%(other) -> Numeric (27126.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

//emlist[][ruby]{
13 % 4 # => 1
13 % -4 # => -3
-13 % 4 # => 3
-13 % -4 # => -1
//}

@param other 二項演算の右側の引数(対象)
@return 計算結果...

String#%(args) -> String (18252.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...
...ないこと、2進数の指示子(%b, %B)が存在すること、sprintf のすべての方言をサ
ポートしていないこと(%': 3桁区切り)などの違いがあります。

Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に...
...るためには %+x、% x のように指定します。


以下は sprintf フォーマットの書式です。[] で囲まれた部分は省略可
能であることを示しています。

%
[nth$][フラグ][幅][.精度]指示子
%
[<name>][フラグ][幅][.精度]指示子

`%' 自身を出...

Integer#modulo(other) -> Numeric (12026.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

//emlist[][ruby]{
13 % 4 # => 1
13 % -4 # => -3
-13 % 4 # => 3
-13 % -4 # => -1
//}

@param other 二項演算の右側の引数(対象)
@return 計算結果...

Integer#pow(other, modulo) -> Integer (9115.0)

算術演算子。冪(べき乗)を計算します。

...象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の...

Integer#**(other) -> Numeric (9015.0)

算術演算子。冪(べき乗)を計算します。

...象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の...

絞り込み条件を変える

Integer#pow(other) -> Numeric (9015.0)

算術演算子。冪(べき乗)を計算します。

...象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の...

Array#pack(template) -> String (206.0)

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

...] # 仮数部
//}

そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-126-23...
...,52] # 仮数部
//}

そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-1022-5...
...cd"].pack("u") # => "$86)C9```\n"
["a"*45].pack("u") # => "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n"
["a"*46].pack("u") # => "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n"
["abcdefghi"].pack("u6") # => "&86)C9&5F\n#9VAI\n"
//}

: U...

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

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

...] # 仮数部
//}

そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-126-23...
...,52] # 仮数部
//}

そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-1022-5...
...cd"].pack("u") # => "$86)C9```\n"
["a"*45].pack("u") # => "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n"
["a"*46].pack("u") # => "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n"
["abcdefghi"].pack("u6") # => "&86)C9&5F\n#9VAI\n"
//}

: U...

String#unpack(template) -> Array (206.0)

Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。

...] # 仮数部
//}

そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-126-23...
...,52] # 仮数部
//}

そして、s, e, f の意味は以下の通りです。
//emlist[][ruby]{
sgn = s == "0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-1022-5...
...cd"].pack("u") # => "$86)C9```\n"
["a"*45].pack("u") # => "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n"
["a"*46].pack("u") # => "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n"
["abcdefghi"].pack("u6") # => "&86)C9&5F\n#9VAI\n"
//}

: U...

Enumerable#find_index {|obj| ... } -> Integer | nil (128.0)

条件に一致する最初の要素の位置を返します。

...も真にならなかった場合は nil を返します。

//emlist[例][ruby]{
(1..10).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> nil
(1..100).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> 34
//}

引数、ブロックのどちらも与えられなかった場合は、
Enumerator の...

絞り込み条件を変える

<< 1 2 3 ... > >>