るりまサーチ

最速Rubyリファレンスマニュアル検索!
830件ヒット [801-830件を表示] (0.042秒)
トップページ > 種類:インスタンスメソッド[x] > クラス:Integer[x] > クエリ:integer[x] > ライブラリ:ビルトイン[x]

別のキーワード

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

キーワード

検索結果

<< < ... 7 8 9 >>

Integer#to_int -> self (9004.0)

self を返します。

self を返します。

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

Integer#to_r -> Rational (9004.0)

自身を Rational に変換します。

自身を Rational に変換します。

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

Integer#to_s(base=10) -> String (9004.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 以外の数値を指定した場合に発生します。
<< < ... 7 8 9 >>