るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< < ... 5 6 7 8 > >>

Integer#lcm(n) -> Integer (3114.0)

自身と整数 n の最小公倍数を返します。

...自身と整数 n の最小公倍数を返します。

@
raise ArgumentError n に整数以外のものを指定すると発生します。

//emlist[][ruby]{
2.lcm(2) # => 2
3.lcm(-7) # => 21
((1<<31)-1).lcm((1<<61)-1) # => 4951760154835678088235319297
//}...
...また、self や n が 0 だった場合は、0 を返します。

//emlist[][ruby]{
3.lcm(0) # => 0
0.lcm(-7) # => 0
//}

@
see Integer#gcd, Integer#gcdlcm...

Integer#modulo(other) -> Numeric (3114.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

//emlist[][ruby]{
13 % 4 # => 1
13 % -4 # => -3
-13 % 4 # => 3
-13 % -4 # => -1
//}

@
param other 二項演算の右側の引数(対象)
@
return 計算結果...

Integer#remainder(other) -> Numeric (3114.0)

self を other で割った余り r を返します。

...self を other で割った余り r を返します。

r の符号は self と同じになります。

@
param other self を割る数。

//emlist[][ruby]{
5.remainder(3) # => 2
-5.remainder(3) # => -2
5.remainder(-3) # => 2
-5.remainder(-3) # => -2

-1234567890987654321.remainder(13731...
...) # => -6966
-1234567890987654321.remainder(13731.24) # => -9906.22531493148
//}

@
see Integer#divmod, Integer#modulo, Numeric#modulo...

Integer#&(other) -> Integer (3108.0)

ビット二項演算子。論理積を計算します。

...ビット二項演算子。論理積を計算します。

@
param other 数値

//emlist[][ruby]{
1 & 1 # => 1
2 & 3 # => 2
//}...

Integer#<<(bits) -> Integer (3108.0)

シフト演算子。bits だけビットを左にシフトします。

...シフト演算子。bits だけビットを左にシフトします。

@
param bits シフトさせるビット数

//emlist[][ruby]{
printf("%#b\n", 0b0101 << 1) # => 0b1010
p -1 << 1 # => -2
//}...

絞り込み条件を変える

Integer#>>(bits) -> Integer (3108.0)

シフト演算子。bits だけビットを右にシフトします。

...。bits だけビットを右にシフトします。

右シフトは、符号ビット(最上位ビット(MSB))が保持されます。
bitsが実数の場合、小数点以下を切り捨てた値でシフトします。

@
param bits シフトさせるビット数

//emlist[][ruby]{
printf("%#b\n...

Integer#^(other) -> Integer (3108.0)

ビット二項演算子。排他的論理和を計算します。

...ビット二項演算子。排他的論理和を計算します。

@
param other 数値

//emlist[][ruby]{
1 ^ 1 # => 0
2 ^ 3 # => 1
//}...

Integer#ceildiv(other) -> Integer (3108.0)

self を other で割り、その(剰余を考えない)商を整数に切り上げたものを返します。 すなわち、self を other で割った商を q とすると、q 以上で最小の整数を返します。

...self を other で割り、その(剰余を考えない)商を整数に切り上げたものを返します。
すなわち、self を other で割った商を q とすると、q 以上で最小の整数を返します。

@
param other self を割る数を指定します。

//emlist[][ruby]{
3.cei...

Integer#ord -> Integer (3108.0)

自身を返します。

...自身を返します。

//emlist[][ruby]{
10.ord #=> 10
# String#ord
?a.ord #=> 97
//}

@
see String#ord...

Integer#pred -> Integer (3108.0)

self から -1 した値を返します。

...self から -1 した値を返します。

//emlist[][ruby]{
1.pred #=> 0
(-1).pred #=> -2
//}

@
see Integer#next...

絞り込み条件を変える

<< < ... 5 6 7 8 > >>