るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.063秒)
トップページ > バージョン:2.4.0[x] > ライブラリ:openssl[x] > クエリ:new[x] > クエリ:openssl[x] > クラス:Integer[x]

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

検索結果

Integer#to_bn -> OpenSSL::BN (24505.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...