るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. _builtin typeerror
  2. sort typeerror
  3. dump typeerror
  4. $@ typeerror
  5. $~ typeerror

ライブラリ

キーワード

検索結果

OpenSSL::BN#coerce(other) -> Array (43.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 変換に失敗した場合に発...

OpenSSL::BN#<=>(other) -> -1 | 0 | 1 (25.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 T...

OpenSSL::BN#cmp(other) -> -1 | 0 | 1 (25.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 T...

OpenSSL::BN#ucmp(other) -> -1 | 0 | 1 (25.0)

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

...1 を返します。

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

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

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

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