Ruby 2.3.0 リファレンスマニュアル > ライブラリ一覧 > opensslライブラリ > OpenSSL::BNクラス > mod_sub

instance method OpenSSL::BN#mod_sub

mod_sub(other, m) -> OpenSSL::BN[permalink][rdoc]

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


require 'openssl'

OpenSSL::BN.new("27").mod_sub(OpenSSL::BN.new("3"), OpenSSL::BN.new("5")) # => 4
[PARAM] other:
引く数
[PARAM] m:
剰余を取る数
[EXCEPTION] OpenSSL::BNError:
計算時エラー