るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 ... > >>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

絞り込み条件を変える

String#%(args) -> String (18250.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
に負の数を与えると (左側に...
...sprintf("%s", /e+/) #=> "(?-mix:e+)"
p sprintf("%p", /e+/) #=> "/e+/"
//}


: d
: i

引数の数値を10進表現の整数として出力します。

引数が整数でなければ関数 Kernel.#Integer と同じ規則で整数に
変換されます。

//emlist[][ruby]{
p sprintf("%d", -1) #...

Ruby用語集 (438.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...語集
A B C D E F G I J M N O R S Y

a ka sa ta na ha ma ya ra wa

=== 記号・数字
: %記法
: % notation
%」記号で始まる多種多様なリテラル記法の総称。

参照:d:spec/literal#percent

: 0 オリジン
: zero-based...
...大きな整数オブジェクトが属す
クラスだった。Ruby 2.4 で Fixnum と共に Integer に一本化された。
このとき Bignum は形式的には残されたが単なる Integer のエイリアスとなった。

: blade
Ruby の各種メーリングリストのアーカイ...
...く実装するための手法の一つ。

例えば新しい数値クラス N を定義し、Integer と N の演算を可能にしたいとする。
Integer
と N の加算を行うと、Integer 側では相手が未知のため、自身を引数に
まず相手側の N#coerce を呼ぶ。N...

Array#pack(template) -> String (204.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 (204.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 (204.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...

絞り込み条件を変える

<< 1 2 3 ... > >>