110件ヒット
[101-110件を表示]
(0.261秒)
ライブラリ
- ビルトイン (110)
クラス
- Complex (15)
-
Enumerator
:: ArithmeticSequence (7) - Float (4)
- Integer (25)
- Numeric (53)
- Object (2)
- Range (1)
- Rational (2)
- UnboundMethod (1)
キーワード
- % (2)
- * (1)
- ** (1)
- + (1)
- +@ (1)
- - (1)
- -@ (1)
-
/ (4) - <=> (1)
- [] (3)
- abs (2)
- abs2 (2)
- angle (2)
- arg (2)
- begin (1)
- ceil (2)
- clone (1)
- coerce (1)
- conj (1)
- conjugate (1)
- denominator (1)
- div (1)
- divmod (3)
- downto (2)
- dup (1)
- end (1)
- eql? (1)
- fdiv (2)
- finite? (1)
- first (2)
- floor (3)
- i (1)
- imag (2)
- imaginary (2)
- infinite? (1)
- integer? (1)
- last (2)
- magnitude (2)
- modulo (2)
- negative? (1)
- nonzero? (1)
- numerator (1)
- owner (1)
- phase (2)
- polar (2)
- positive? (1)
- pow (2)
- quo (3)
- real (2)
- real? (2)
- rect (2)
- rectangular (2)
- remainder (2)
- round (2)
- size (1)
- step (10)
- times (2)
-
to
_ c (1) -
to
_ i (1) -
to
_ int (1) - truncate (3)
- upto (2)
- zero? (1)
検索結果
先頭5件
-
Integer
# truncate(ndigits = 0) -> Integer (24022.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
# upto(max) -> Enumerator (24022.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
# upto(max) {|n| . . . } -> Integer (24022.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 -
Object
# clone(freeze: nil) -> object (24022.0) -
オブジェクトの複製を作成して返します。
オブジェクトの複製を作成して返します。
dup はオブジェクトの内容, taint 情報をコピーし、
clone はそれに加えて freeze, 特異メソッドなどの情報も含めた完全な複製を作成します。
clone や dup は浅い(shallow)コピーであることに注意してください。後述。
TrueClass, FalseClass, NilClass, Symbol, そして Numeric クラスのインスタンスなど一部のオブジェクトは複製ではなくインスタンス自身を返します。
@param freeze true を指定すると freeze されたコピーを返します。
... -
Object
# dup -> object (24022.0) -
オブジェクトの複製を作成して返します。
オブジェクトの複製を作成して返します。
dup はオブジェクトの内容, taint 情報をコピーし、
clone はそれに加えて freeze, 特異メソッドなどの情報も含めた完全な複製を作成します。
clone や dup は浅い(shallow)コピーであることに注意してください。後述。
TrueClass, FalseClass, NilClass, Symbol, そして Numeric クラスのインスタンスなど一部のオブジェクトは複製ではなくインスタンス自身を返します。
@param freeze true を指定すると freeze されたコピーを返します。
... -
Range
# size -> Integer | Float :: INFINITY | nil (24022.0) -
範囲内の要素数を返します。始端、終端のいずれかのオブジェクトが
Numeric のサブクラスのオブジェクトではない場合には nil を返します。
//emlist[例][ruby]{
(10..20).size # => 11
("a".."z").size # => nil
(-Float::INFINITY..Float::INFINITY).size # => Infinity
//} -
Rational
# / (other) -> Rational | Float (24022.0) -
商を計算します。
商を計算します。
@param other 自身を割る数
other に Float を指定した場合は、計算結果を Float で返します。
//emlist[例][ruby]{
r = Rational(3, 4)
r / 2 # => (3/8)
r / 2.0 # => 0.375
r / 0.5 # => 1.5
r / Rational(1, 2) # => (3/2)
r / 0 # => ZeroDivisionError
//}
@raise ZeroD... -
Rational
# quo(other) -> Rational | Float (24022.0) -
商を計算します。
商を計算します。
@param other 自身を割る数
other に Float を指定した場合は、計算結果を Float で返します。
//emlist[例][ruby]{
r = Rational(3, 4)
r / 2 # => (3/8)
r / 2.0 # => 0.375
r / 0.5 # => 1.5
r / Rational(1, 2) # => (3/2)
r / 0 # => ZeroDivisionError
//}
@raise ZeroD... -
UnboundMethod
# owner -> Class | Module (24022.0) -
このメソッドが定義されている class か module を返します。
このメソッドが定義されている class か module を返します。
//emlist[例][ruby]{
Integer.instance_method(:to_s).owner # => Integer
Integer.instance_method(:to_c).owner # => Numeric
Integer.instance_method(:hash).owner # => Kernel
//} -
Integer
# pow(other , modulo) -> Integer (24010.0) -
算術演算子。冪(べき乗)を計算します。
算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
...