547件ヒット
[201-300件を表示]
(0.026秒)
ライブラリ
- ビルトイン (547)
キーワード
- % (11)
- +@ (11)
- -@ (11)
- <=> (11)
- abs (11)
- abs2 (11)
- angle (11)
- arg (11)
- ceil (11)
- coerce (11)
- conj (11)
- conjugate (11)
- denominator (11)
- div (11)
- divmod (11)
- eql? (11)
- fdiv (11)
- finite? (8)
- floor (11)
- i (11)
- imag (11)
- imaginary (11)
- infinite? (8)
- integer? (11)
- magnitude (11)
- modulo (11)
- negative? (9)
- nonzero? (11)
- numerator (11)
- phase (11)
- polar (11)
- positive? (9)
- quo (11)
- real (11)
- real? (11)
- rect (11)
- rectangular (11)
- remainder (11)
- round (11)
- step (84)
-
to
_ c (11) -
to
_ int (11) - truncate (11)
- zero? (11)
検索結果
先頭5件
-
Numeric
# round -> Integer (9020.0) -
自身ともっとも近い整数を返します。
...0.5, -0.5 はそれぞれ 1,-1 に切り上げされます。いわゆる四捨五入ですが、偶数丸めではありません。
//emlist[例][ruby]{
1.round #=> 1
1.2.round #=> 1
(-1.2).round #=> -1
(-1.5).round #=> -2
//}
@see Numeric#ceil, Numeric#floor, Numeric#truncate... -
Numeric
# truncate -> Integer (9020.0) -
0 から 自身までの整数で、自身にもっとも近い整数を返します。
...0 から 自身までの整数で、自身にもっとも近い整数を返します。
//emlist[例][ruby]{
1.truncate #=> 1
1.2.truncate #=> 1
(-1.2).truncate #=> -1
(-1.5).truncate #=> -1
//}
@see Numeric#ceil, Numeric#floor, Numeric#round... -
Numeric
# fdiv(other) -> Float | Complex (9014.0) -
self を other で割った商を Float で返します。 ただし Complex が関わる場合は例外です。 その場合も成分は Float になります。
...割った商を Float で返します。
ただし Complex が関わる場合は例外です。
その場合も成分は Float になります。
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@param other 自身を割る数を指定しま......す。
//emlist[例][ruby]{
1.fdiv(3) #=> 0.3333333333333333
Complex(1, 1).fdiv 1 #=> (1.0+1.0i)
1.fdiv Complex(1, 1) #=> (0.5-0.5i)
//}
@see Numeric#quo... -
Numeric
# finite? -> bool (9014.0) -
self の絶対値が有限値の場合に true を、そうでない場合に false を返します。
...値の場合に true を、そうでない場合に false を返します。
//emlist[例][ruby]{
10.finite? # => true
Rational(3).finite? # => true
Float::INFINITY.finite? # => false
Float::INFINITY.is_a?(Numeric) # => true
//}
@see Numeric#infinite?... -
Numeric
# imag -> 0 (9014.0) -
常に 0 を返します。
...常に 0 を返します。
//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Numeric#real、Complex#imag... -
Numeric
# imaginary -> 0 (9014.0) -
常に 0 を返します。
...常に 0 を返します。
//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Numeric#real、Complex#imag... -
Numeric
# integer? -> bool (9014.0) -
自身が Integer かそのサブクラスのインスタンスの場合にtrue を返し ます。そうでない場合に false を返します。
...スタンスの場合にtrue を返し
ます。そうでない場合に false を返します。
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
//emlist[例][ruby]{
(1.0).integer? #=> false
(1).integer? #=> true
//}
@see Numeric#real?... -
Numeric
# real? -> bool (9014.0) -
常に true を返します。(Complex またはそのサブクラスではないことを意味します。)
...ます。)
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
//emlist[例][ruby]{
10.real? # => true
-10.real? # => true
0.1.real? # => true
Rational(2, 3).real? # => true
//}
@see Numeric#integer?、... -
Numeric
# <=>(other) -> -1 | 0 | 1 | nil (9008.0) -
自身が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。 自身と other が比較できない場合には nil を返します。
...場合に 0 を、小さい場合には -1 をそれぞれ返します。
自身と other が比較できない場合には nil を返します。
Numeric のサブクラスは、上の動作を満たすよう このメソッドを適切に再定義しなければなりません。
@param other... -
Numeric
# angle -> 0 | Math :: PI (9008.0) -
自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#arg...