768件ヒット
[301-400件を表示]
(0.210秒)
種類
- インスタンスメソッド (758)
- 特異メソッド (10)
ライブラリ
- ビルトイン (768)
キーワード
- % (11)
- & (11)
- * (11)
- ** (11)
- + (11)
- - (11)
- -@ (11)
-
/ (10) - < (11)
- << (11)
- <= (11)
- <=> (11)
- == (11)
- === (11)
- > (11)
- >= (11)
- >> (11)
- [] (21)
- ^ (11)
- abs (11)
- allbits? (7)
- anybits? (7)
-
bit
_ length (11) - ceil (11)
- ceildiv (2)
- chr (22)
- denominator (11)
- digits (22)
- div (11)
- divmod (11)
- downto (22)
- even? (11)
- fdiv (11)
- floor (11)
- gcd (11)
- gcdlcm (11)
- inspect (11)
- integer? (11)
- lcm (11)
- magnitude (11)
- modulo (11)
- next (11)
- nobits? (7)
- numerator (11)
- odd? (11)
- ord (11)
- pow (22)
- pred (11)
- rationalize (22)
- remainder (11)
- round (11)
- size (11)
- sqrt (7)
- succ (11)
- times (22)
-
to
_ f (11) -
to
_ i (11) -
to
_ int (11) -
to
_ r (11) -
to
_ s (11) - truncate (11)
-
try
_ convert (3) - upto (22)
- | (11)
- ~ (11)
検索結果
先頭5件
-
Integer
# ceil(ndigits = 0) -> Integer (17102.0) -
self と等しいかより大きな整数のうち最小のものを返します。
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
# ceildiv(other) -> Integer (17102.0) -
self を other で割り、その(剰余を考えない)商を整数に切り上げたものを返します。 すなわち、self を other で割った商を q とすると、q 以上で最小の整数を返します。
self を other で割り、その(剰余を考えない)商を整数に切り上げたものを返します。
すなわち、self を other で割った商を q とすると、q 以上で最小の整数を返します。
@param other self を割る数を指定します。
//emlist[][ruby]{
3.ceildiv(3) # => 1
4.ceildiv(3) # => 2
5.ceildiv(3) # => 2
3.ceildiv(1.2) # => 3
-5.ceildiv(3) # => -1
-5.ceildiv(-3) # => 2
//} -
Integer
# divmod(other) -> [Integer , Numeric] (17102.0) -
self を other で割った商 q と余り r を、 [q, r] という 2 要素の配列にし て返します。 商 q は常に整数ですが、余り r は整数であるとは限りません。
self を other で割った商 q と余り r を、 [q, r] という 2 要素の配列にし
て返します。 商 q は常に整数ですが、余り r は整数であるとは限りません。
@param other self を割る数。
@see Numeric#divmod -
Integer
# floor(ndigits = 0) -> Integer (17102.0) -
self と等しいかより小さな整数のうち最大のものを返します。
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
# ord -> Integer (17102.0) -
自身を返します。
自身を返します。
//emlist[][ruby]{
10.ord #=> 10
# String#ord
?a.ord #=> 97
//}
@see String#ord -
Integer
# round(ndigits = 0 , half: :up) -> Integer (17102.0) -
self ともっとも近い整数を返します。
self ともっとも近い整数を返します。
@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。
@param half ちょうど半分の値の丸め方を指定します。
サポートされている値は以下の通りです。
* :up or nil: 0から遠い方に丸められます。
* :even: もっとも近い偶数に丸められます。
* :down: 0に近い方に丸められます。
//emlist[][ruby]{
1.round # =... -
Integer
# truncate(ndigits = 0) -> Integer (17102.0) -
0 から self までの整数で、自身にもっとも近い整数を返します。
0 から self までの整数で、自身にもっとも近い整数を返します。
@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}
@see Numeric#truncate -
Integer
# |(other) -> Integer (17102.0) -
ビット二項演算子。論理和を計算します。
ビット二項演算子。論理和を計算します。
@param other 数値
//emlist[][ruby]{
1 | 1 # => 1
2 | 3 # => 3
//} -
Integer
# ~ -> Integer (17102.0) -
ビット演算子。否定を計算します。
ビット演算子。否定を計算します。
//emlist[][ruby]{
~1 # => -2
~3 # => -4
~-4 # => 3
//} -
Integer
# / (other) -> Numeric (17025.0) -
除算の算術演算子。
...除算の算術演算子。
other が Integer の場合、整商(整数の商)を Integer で返します。
普通の商(剰余を考えない商)を越えない最大の整数をもって整商とします。
other が Float、Rational、Complex の場合、普通の商を other と
同......側の引数(対象)
@return 計算結果
//emlist[例][ruby]{
7 / 2 # => 3
7 / -2 # => -4
7 / 2.0 # => 3.5
7 / Rational(2, 1) # => (7/2)
7 / Complex(2, 0) # => ((7/2)+0i)
begin
2 / 0
rescue => e
e # => #<ZeroDivisionError: divided by 0>
end
//}
@see Integer#div, Integer#fdiv, Numeric#quo... -
Integer
# upto(max) -> Enumerator (17014.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
# allbits?(mask) -> bool (17013.0) -
self & mask の全てのビットが 1 なら true を返します。
...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?...