るりまサーチ

最速Rubyリファレンスマニュアル検索!
768件ヒット [601-700件を表示] (0.167秒)
トップページ > クラス:Integer[x] > クエリ:_builtin[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

キーワード

検索結果

<< < ... 5 6 7 8 > >>

Integer#round(ndigits = 0, half: :up) -> Integer | Float (8001.0)

self ともっとも近い整数を返します。

...合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。
@param half ちょうど半分の値の...

Integer#size -> Integer (8001.0)

整数の実装上のサイズをバイト数で返します。

...整数の実装上のサイズをバイト数で返します。

//emlist[][ruby]{
p 1.size # => 8
p 0x1_0000_0000.size # => 8
//}

@see Integer#bit_length...

Integer#succ -> Integer (8001.0)

self の次の整数を返します。

...self の次の整数を返します。

//emlist[][ruby]{
1.next #=> 2
(-1).next #=> 0
1.succ #=> 2
(-1).succ #=> 0
//}

@see Integer#pred...

Integer#times -> Enumerator (8001.0)

self 回だけ繰り返します。 self が正の整数でない場合は何もしません。

...れます。

//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.times { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}

@see Integer#upto, Integer#downto, Numeric#step...

Integer#times {|n| ... } -> self (8001.0)

self 回だけ繰り返します。 self が正の整数でない場合は何もしません。

...れます。

//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.times { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}

@see Integer#upto, Integer#downto, Numeric#step...

絞り込み条件を変える

Integer#to_f -> Float (8001.0)

self を浮動小数点数(Float)に変換します。

self を浮動小数点数(Float)に変換します。

self が Float の範囲に収まらない場合、Float::INFINITY を返します。

//emlist[][ruby]{
1.to_f # => 1.0
(Float::MAX.to_i * 2).to_f # => Infinity
(-Float::MAX.to_i * 2).to_f # => -Infinity
//}

Integer#to_i -> self (8001.0)

self を返します。

self を返します。

//emlist[][ruby]{
10.to_i # => 10
//}

Integer#to_int -> self (8001.0)

self を返します。

self を返します。

//emlist[][ruby]{
10.to_i # => 10
//}

Integer#to_r -> Rational (8001.0)

自身を Rational に変換します。

自身を Rational に変換します。

//emlist[][ruby]{
1.to_r # => (1/1)
(1<<64).to_r # => (18446744073709551616/1)
//}

Integer#to_s(base=10) -> String (8001.0)

整数を 10 進文字列表現に変換します。

整数を 10 進文字列表現に変換します。

引数を指定すれば、それを基数とした文字列表
現に変換します。

//emlist[][ruby]{
p 10.to_s(2) # => "1010"
p 10.to_s(8) # => "12"
p 10.to_s(16) # => "a"
p 35.to_s(36) # => "z"
//}

@return 数値の文字列表現
@param base 基数となる 2 - 36 の数値。
@raise ArgumentError base に 2 - 36 以外の数値を指定した場合に発生します。

絞り込み条件を変える

<< < ... 5 6 7 8 > >>