るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

クラス

キーワード

検索結果

<< < 1 2 3 >>

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

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

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

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

//emlist[][ruby]{
require '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 (127.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 (127.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 (127.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 (127.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#ucmp(other) -> -1 | 0 | 1 (127.0)

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

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

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

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

OpenSSL
::BN.new(5).ucmp(OpenSSL::BN.new(-9)) # => -1
OpenSSL
::BN.ne...
...w(-5).ucmp(OpenSSL::BN.new(5)) # => 0
OpenSSL
::BN.new(-5).ucmp(OpenSSL::BN.new(2)) # => 1
//}

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