るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

キーワード

検索結果

Integer#to_i -> self (54328.0)

self を返します。

self を返します。

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

Integer#to_int -> self (18328.0)

self を返します。

self を返します。

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

Integer#to_f -> Float (43.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_bn -> OpenSSL::BN (25.0)

Integer を同じ数を表す OpenSSL::BN のオブジェクトに 変換します。

...
Integer
を同じ数を表す OpenSSL::BN のオブジェクトに
変換します。

//emlist[][ruby]{
require 'pp'
require 'openssl'

pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}

なお、実装は、以下のようになっています。

//emlist[][ruby]{
clas...
...s Integer
def to_bn
OpenSSL::BN::new(self)
end
end
//}

@see OpenSSL::BN.new, OpenSSL::BN#to_i...