るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

クラス

キーワード

検索結果

<< 1 2 > >>

OpenSSL::BN#clear_bit!(n) -> self (234.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#lshift!(n) -> self (234.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#rshift!(n) -> self (234.0)

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

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

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

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

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

OpenSSL::BN#set_bit!(n) -> self (234.0)

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

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

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

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

@
param n 1にするビットの位置
@
raise OpenSSL::BNError 計算時エラー
@
see OpenSSL::clear_bit!, OpenSSL::bit_set?...

OpenSSL::BN#mask_bits!(n) -> self (228.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 計算時...

絞り込み条件を変える

OpenSSL::BN#mod_sub(other, m) -> OpenSSL::BN (165.0)

(self - other) % m を返します。

...(self - other) % m を返します。

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

OpenSSL
::BN.new("27").mod_sub(OpenSSL::BN.new("3"), OpenSSL::BN.new("5")) # => 4
//}

@
param other 引く数
@
param m 剰余を取る数
@
raise OpenSSL::BNError 計算時エラー...

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

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

...ther, self] という配列にして返します。

基本的に other が整数のときに、自身を Integer のオブジェクトに
変換して [other, 変換後オブジェクト] にして返します。
それ以外の場合は例外 TypeError を発生させます。

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

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

coerce メソッドの詳細な説明は、Numeric#coerce にあります。
@
see Numeric#coerce...

OpenSSL::BN#mod_add(other, m) -> OpenSSL::BN (149.0)

(self + other) % m を返します。

...(self + other) % m を返します。

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

OpenSSL
::BN.new("7").mod_add(OpenSSL::BN.new("3"), OpenSSL::BN.new("6")) # => 4
//}

@
param other 和を取る数
@
param m 剰余を取る数
@
raise OpenSSL::BNError 計算時エラー...

OpenSSL::BN#mod_exp(other, m) -> OpenSSL::BN (149.0)

(self ** other) % m を返します。

...(self ** other) % m を返します。

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

OpenSSL
::BN.new("7").mod_exp(OpenSSL::BN.new("3"), OpenSSL::BN.new("6")) # => 1
//}

@
param other 指数
@
param m 剰余を取る数
@
raise OpenSSL::BNError 計算時エラー...
<< 1 2 > >>