Ruby 4.0 リファレンスマニュアル

instance method OpenSSL::BN#bit_set?

bit_set?(n) -> bool[permalink][rdoc][edit]

自身の n ビット目が立っているなら true を返します。

require 'openssl'

p OpenSSL::BN.new("129").bit_set?(0) # => true
p OpenSSL::BN.new("129").bit_set?(1) # => false
[PARAM] n:
調べるビットの位置

[SEE_ALSO] OpenSSL::BN#set_bit!