るりまサーチ

最速Rubyリファレンスマニュアル検索!
722件ヒット [101-200件を表示] (0.153秒)
トップページ > クエリ:t[x] > クエリ:Ruby[x] > クエリ:ruby[x] > 種類:インスタンスメソッド[x] > クエリ:@[x] > クラス:Integer[x]

別のキーワード

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

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Integer#allbits?(mask) -> bool (6132.0)

self & mask の全てのビットが 1 なら true を返します。

... true を返します。

self & mask == mask と等価です。

@
param mask ビットマスクを整数で指定します。

//emlist[][ruby]{
42.allbits?(42) # => true
0b1010_1010.allbits?(0b1000_0010) # => true
0b1010_1010.allbits?(0b1000_0001) # => false
0b1000_0010.allbits?(...
...0b1010_1010) # => false
//}

@
see Integer#anybits?
@
see Integer#nobits?...

Integer#anybits?(mask) -> bool (6132.0)

self & mask のいずれかのビットが 1 なら true を返します。

... true を返します。

self & mask != 0 と等価です。

@
param mask ビットマスクを整数で指定します。

//emlist[][ruby]{
42.anybits?(42) # => true
0b1010_1010.anybits?(0b1000_0010) # => true
0b1010_1010.anybits?(0b1000_0001) # => true
0b1000_0010.anybits?(0...
...b0010_1100) # => false
//}

@
see Integer#allbits?
@
see Integer#nobits?...

Integer#downto(min) {|n| ... } -> self (6132.0)

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。

...で 1 ずつ減らしながらブロックを繰り返し実行します。
self < min であれば何もしません。

@
param min 数値
@
return self を返します。

//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}

@
see Integer#upto, Numeric#step, Integer#times...

Integer#inspect(base=10) -> String (6132.0)

整数を 10 進文字列表現に変換します。

...列表
現に変換します。

//emlist[][ruby]{
p 10.to_s(2) # => "1010"
p 10.to_s(8) # => "12"
p 10.to_s(16) # => "a"
p 35.to_s(36) # => "z"
//}

@
return 数値の文字列表現
@
param base 基数となる 2 - 36 の数値。
@
raise ArgumentError base に 2 - 36 以外の数値を...

Integer#nobits?(mask) -> bool (6132.0)

self & mask のすべてのビットが 0 なら true を返します。

... true を返します。

self & mask == 0 と等価です。

@
param mask ビットマスクを整数で指定します。

//emlist[][ruby]{
42.nobits?(42) # => false
0b1010_1010.nobits?(0b1000_0010) # => false
0b1010_1010.nobits?(0b1000_0001) # => false
0b0100_0101.nobits?(0b...
...1010_1010) # => true
//}

@
see Integer#allbits?
@
see Integer#anybits?...

絞り込み条件を変える

Integer#to_bn -> OpenSSL::BN (6132.0)

Integer を同じ数を表す OpenSSL::BN のオブジェクトに 変換します。

...
Integer
を同じ数を表す OpenSSL::BN のオブジェクトに
変換します。

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

pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}

なお、実装は、以下のようになっています。

//emlist[][ruby]{
clas...
...s Integer
def to_bn
OpenSSL::BN::new(self)
end
end
//}

@
see OpenSSL::BN.new, OpenSSL::BN#to_i...
...
Integer
を同じ数を表す OpenSSL::BN のオブジェクトに
変換します。

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

pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}

なお、実装は、以下のようになっています。

//emlist[][ruby]{
class Integer
d...
...ef to_bn
OpenSSL::BN::new(self)
end
end
//}

@
see OpenSSL::BN.new, OpenSSL::BN#to_i...

Integer#to_s(base=10) -> String (6132.0)

整数を 10 進文字列表現に変換します。

...列表
現に変換します。

//emlist[][ruby]{
p 10.to_s(2) # => "1010"
p 10.to_s(8) # => "12"
p 10.to_s(16) # => "a"
p 35.to_s(36) # => "z"
//}

@
return 数値の文字列表現
@
param base 基数となる 2 - 36 の数値。
@
raise ArgumentError base に 2 - 36 以外の数値を...

Integer#upto(max) {|n| ... } -> Integer (6132.0)

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

...self から max まで 1 ずつ増やしながら繰り返します。
self > max であれば何もしません。

@
param max 数値
@
return self を返します。

//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}

@
see Integer#downto, Numeric#step, Integer#times...

Integer#denominator -> Integer (6126.0)

分母(常に1)を返します。

...分母(常に1)を返します。

@
return 分母を返します。

//emlist[][ruby]{
10.denominator # => 1
-10.denominator # => 1
//}

@
see Integer#numerator...

Integer#numerator -> Integer (6126.0)

分子(常に自身)を返します。

...分子(常に自身)を返します。

@
return 分子を返します。

//emlist[][ruby]{
10.numerator # => 10
-10.numerator # => -10
//}

@
see Integer#denominator...

絞り込み条件を変える

<< < 1 2 3 4 ... > >>