るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

キーワード

検索結果

<< 1 2 3 > >>

OpenSSL::BN#pretty_print(pp) (14.0)

Kernel.#pp でオブジェクトの内容を出力するときに、内部で呼ばれるメソッドです。

...nel.#pp でオブジェクトの内容を出力するときに、内部で呼ばれるメソッドです。

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

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

@param pp PP クラスのインスタンスオブジェクト...

OpenSSL::BN#<=>(other) -> -1 | 0 | 1 (8.0)

自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。

...いときには 1 を返します。

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

OpenSSL::BN
.new(5) <=> 5 # => 0

OpenSSL::BN
.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN
.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN
.new(5) <=> OpenSSL::BN.new(-5) # => 1
//}

@param other 比較する整数...
...@raise TypeError 比較できないときに発生します。
@see OpenSSL::BN#ucmp...

OpenSSL::BN#>>(other) -> OpenSSL::BN (8.0)

自身を other ビット右シフトした値を返します。

...自身を other ビット右シフトした値を返します。

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

bn = 2.to_bn
bn >> 1 # => #<OpenSSL::BN 1>
bn # => #<OpenSSL::BN 2>
//}

@param other シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#rshift!...

OpenSSL::BN#bit_set?(n) -> bool (8.0)

自身の n ビット目が立っているなら true を返します。

...自身の n ビット目が立っているなら true を返します。

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

OpenSSL::BN
.new("129").bit_set?(0) # => true
OpenSSL::BN
.new("129").bit_set?(1) # => false
//}

@param n 調べるビットの位置
@see OpenSSL::set_bit!...

OpenSSL::BN#clear_bit!(n) -> self (8.0)

自身の n ビット目を0にします。

...自身の n ビット目を0にします。

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

a = OpenSSL::BN.new("129")
a.clear_bit!(0)
a # => 128
//}

@param n 0にするビットの位置
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::set_bit!...

絞り込み条件を変える

OpenSSL::BN#cmp(other) -> -1 | 0 | 1 (8.0)

自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。

...いときには 1 を返します。

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

OpenSSL::BN
.new(5) <=> 5 # => 0

OpenSSL::BN
.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN
.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN
.new(5) <=> OpenSSL::BN.new(-5) # => 1
//}

@param other 比較する整数...
...@raise TypeError 比較できないときに発生します。
@see OpenSSL::BN#ucmp...

OpenSSL::BN#coerce(other) -> Array (8.0)

自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。

...[other, 変換後オブジェクト] にして返します。
それ以外の場合は例外 TypeError を発生させます。

//emlist[][ruby]{
require
'openssl'
p 1.to_bn.coerce(2) # => [2, 1]
//}

@param other 変換の基準となるオブジェクト
@raise TypeError 変換に失敗した場...

OpenSSL::BN#lshift!(n) -> self (8.0)

自身を n ビット左シフトします。 OpenSSL::BN#<<と異なり、破壊的メソッドです。

...す。
OpenSSL::BN
#<<と異なり、破壊的メソッドです。

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

bn = 1.to_bn
bn.lshift!(2) # => #<OpenSSL::BN 4>
bn # => #<OpenSSL::BN 4>
//}

@param n シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#<<...

OpenSSL::BN#mask_bits!(n) -> self (8.0)

自身を下位 n ビットでマスクし、破壊的に変更します。

...い場合は例外 OpenSSL::BNError
が発生します。

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

bn = 0b1111_1111.to_bn

bn.mask_bits!(8)
p "%b" % bn # => "11111111"

bn.mask_bits!(3)
p "%b" % bn # => "111"
//}

@param n マスクするビット数
@raise OpenSSL::BNError 計算時エ...
<< 1 2 3 > >>