るりまサーチ

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

別のキーワード

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

クラス

キーワード

検索結果

<< < 1 2 3 > >>

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

自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 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 (33.0)

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

...す。

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

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

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

OpenSSL::BN#lshift!(n) -> self (33.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#mod_add(other, m) -> OpenSSL::BN (33.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 (33.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 計算時エラー...

絞り込み条件を変える

OpenSSL::BN#mod_mul(other, m) -> OpenSSL::BN (33.0)

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

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

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

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

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

OpenSSL::BN#mod_sub(other, m) -> OpenSSL::BN (33.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#rshift!(n) -> self (33.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 (33.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?...
<< < 1 2 3 > >>