るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< < ... 3 4 5 6 7 ... > >>

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

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

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

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

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

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

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

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

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

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

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

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

...大きいか判定します。

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

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

Integer#ceil(ndigits = 0) -> Integer (26.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 (26.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#denominator -> Integer (26.0)

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

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

@
return 分母を返します。

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

@
see Integer#numerator...

Integer#floor(ndigits = 0) -> Integer (26.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 (26.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] (26.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 (26.0)

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

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

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

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

絞り込み条件を変える

Integer#numerator -> Integer (26.0)

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

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

@
return 分子を返します。

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

@
see Integer#denominator...
<< < ... 3 4 5 6 7 ... > >>