るりまサーチ

最速Rubyリファレンスマニュアル検索!
722件ヒット [501-600件を表示] (0.148秒)
トップページ > クエリ: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

ライブラリ

キーワード

検索結果

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

Integer#==(other) -> bool (3126.0)

比較演算子。数値として等しいか判定します。

...比較演算子。数値として等しいか判定します。

@
param other 比較対象の数値
@
return self と other が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 == 2 # => false
1 == 1.0 # => true
//}...

Integer#===(other) -> bool (3126.0)

比較演算子。数値として等しいか判定します。

...比較演算子。数値として等しいか判定します。

@
param other 比較対象の数値
@
return self と other が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 == 2 # => false
1 == 1.0 # => true
//}...

Integer#>(other) -> bool (3126.0)

比較演算子。数値として大きいか判定します。

...演算子。数値として大きいか判定します。

@
param other 比較対象の数値
@
return self よりも other の方が小さい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 > 0 # => true
1 > 1 # => false
//}...

Integer#>=(other) -> bool (3126.0)

比較演算子。数値として等しいまたは大きいか判定します。

...ます。

@
param other 比較対象の数値
@
return self よりも other の方が小さい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 >= 0 # => true
1 >= 1 # => true
1 >= 2...

Integer#ceil(ndigits = 0) -> Integer (3126.0)

self と等しいかより大きな整数のうち最小のものを返します。

...最小のものを返します。

@
param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[][ruby]{
1.ceil # => 1
1.ceil(2...
...) # => 1
18.ceil(-1) # => 20
(-18).ceil(-1) # => -10
//}

@
see Numeric#ceil...

絞り込み条件を変える

Integer#ceil(ndigits = 0) -> Integer | Float (3126.0)

self と等しいかより大きな整数のうち最小のものを返します。

...

@
param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返...
...します。
小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[][ruby]{
1.ceil # => 1
1.ceil(2) # => 1.0
18.ceil(-1) # => 20
(-18).ceil(-1) # => -10
//}

@
see Numeric#ceil...

Integer#floor(ndigits = 0) -> Integer (3126.0)

self と等しいかより小さな整数のうち最大のものを返します。

...最大のものを返します。

@
param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[][ruby]{
1.floor # => 1
1.floor...
...(2) # => 1
18.floor(-1) # => 10
(-18).floor(-1) # => -20
//}

@
see Numeric#floor...

Integer#floor(ndigits = 0) -> Integer | Float (3126.0)

self と等しいかより小さな整数のうち最大のものを返します。

...

@
param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返...
...します。
小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[][ruby]{
1.floor # => 1
1.floor(2) # => 1.0
18.floor(-1) # => 10
(-18).floor(-1) # => -20
//}

@
see Numeric#floor...

Integer#gcdlcm(n) -> [Integer] (3126.0)

自身と整数 n の最大公約数と最小公倍数の配列 [self.gcd(n), self.lcm(n)] を返します。

...

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

//emlist[][ruby]{
2.gcdlcm(2) # => [2, 2]
3.gcdlcm(-7) # => [1, 21]
((1<<31)-1).gcdlcm((1<<61)-1) # => [1, 4951760154835678088235319297]
//}

@
see Integer#gcd, Integer#lcm...

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

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

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

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

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

絞り込み条件を変える

Integer#remainder(other) -> Numeric (3126.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 (3120.0)

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

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

@
param other 数値

//emlist[][ruby]{
1 & 1 # => 1
2 & 3 # => 2
//}...
<< < ... 4 5 6 7 8 > >>