694件ヒット
[1-100件を表示]
(0.176秒)
種類
- インスタンスメソッド (686)
- 特異メソッド (8)
ライブラリ
- ビルトイン (694)
キーワード
- % (10)
- & (10)
- * (10)
- ** (10)
- + (10)
- - (10)
- -@ (10)
-
/ (9) - < (10)
- << (10)
- <= (10)
- <=> (10)
- == (10)
- === (10)
- > (10)
- >= (10)
- >> (10)
- [] (18)
- ^ (10)
- abs (10)
- allbits? (6)
- anybits? (6)
-
bit
_ length (10) - ceil (10)
- ceildiv (1)
- chr (20)
- denominator (10)
- digits (20)
- div (10)
- divmod (10)
- downto (20)
- even? (10)
- fdiv (10)
- floor (10)
- gcd (10)
- gcdlcm (10)
- inspect (10)
- integer? (10)
- lcm (10)
- magnitude (10)
- modulo (10)
- next (10)
- nobits? (6)
- numerator (10)
- odd? (10)
- ord (10)
- pow (20)
- pred (10)
- rationalize (20)
- remainder (10)
- round (10)
- size (10)
- sqrt (6)
- succ (10)
- times (20)
-
to
_ f (10) -
to
_ i (10) -
to
_ int (10) -
to
_ r (10) -
to
_ s (10) - truncate (10)
-
try
_ convert (2) - upto (20)
- | (10)
- ~ (10)
検索結果
先頭5件
-
Integer
# %(other) -> Numeric (8001.0) -
算術演算子。剰余を計算します。
算術演算子。剰余を計算します。
//emlist[][ruby]{
13 % 4 # => 1
13 % -4 # => -3
-13 % 4 # => 3
-13 % -4 # => -1
//}
@param other 二項演算の右側の引数(対象)
@return 計算結果 -
Integer
# &(other) -> Integer (8001.0) -
ビット二項演算子。論理積を計算します。
ビット二項演算子。論理積を計算します。
@param other 数値
//emlist[][ruby]{
1 & 1 # => 1
2 & 3 # => 2
//} -
Integer
# *(other) -> Numeric (8001.0) -
算術演算子。積を計算します。
算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
//emlist[][ruby]{
2 * 3 # => 6
//} -
Integer
# **(other) -> Numeric (8001.0) -
算術演算子。冪(べき乗)を計算します。
...に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//... -
Integer
# +(other) -> Numeric (8001.0) -
算術演算子。和を計算します。
算術演算子。和を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
//emlist[][ruby]{
3 + 4 # => 7
//} -
Integer
# -(other) -> Numeric (8001.0) -
算術演算子。差を計算します。
算術演算子。差を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
//emlist[][ruby]{
4 - 1 #=> 3
//} -
Integer
# -@ -> Integer (8001.0) -
単項演算子の - です。 self の符号を反転させたものを返します。
単項演算子の - です。
self の符号を反転させたものを返します。
//emlist[][ruby]{
- 10 # => -10
- -10 # => 10
//} -
Integer
# / (other) -> Numeric (8001.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
# <(other) -> bool (8001.0) -
比較演算子。数値として小さいか判定します。
比較演算子。数値として小さいか判定します。
@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 < 1 # => false
1 < 2 # => true
//} -
Integer
# <<(bits) -> Integer (8001.0) -
シフト演算子。bits だけビットを左にシフトします。
シフト演算子。bits だけビットを左にシフトします。
@param bits シフトさせるビット数
//emlist[][ruby]{
printf("%#b\n", 0b0101 << 1) # => 0b1010
p -1 << 1 # => -2
//} -
Integer
# <=(other) -> bool (8001.0) -
比較演算子。数値として等しいまたは小さいか判定します。
比較演算子。数値として等しいまたは小さいか判定します。
@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
//}