1306件ヒット
[1-100件を表示]
(0.078秒)
別のキーワード
ライブラリ
- ビルトイン (1066)
- bigdecimal (48)
- matrix (48)
- optparse (144)
クラス
キーワード
- % (36)
- * (24)
- ** (12)
- + (12)
- +@ (12)
- - (12)
-
/ (35) - <=> (12)
- [] (24)
- abs (24)
- abs2 (24)
- angle (12)
- arg (12)
- ceil (24)
- clone (12)
- coerce (24)
- conj (12)
- conjugate (12)
- det (12)
- determinant (12)
- div (12)
- divmod (24)
- downto (24)
- eql? (12)
- fdiv (12)
- finite? (9)
- floor (36)
- imag (24)
- imaginary (24)
- infinite? (9)
- integer? (12)
- magnitude (24)
- modulo (36)
- negative? (10)
- nonzero? (12)
- on (144)
- phase (12)
- polar (24)
- positive? (10)
- pow (24)
- quo (36)
- real (24)
- real? (36)
- rect (24)
- rectangular (24)
- remainder (36)
- round (24)
- size (12)
- step (93)
- times (24)
-
to
_ c (12) -
to
_ i (12) -
to
_ int (12) - truncate (36)
- upto (24)
- zero? (12)
検索結果
先頭5件
-
Numeric
# i -> Complex (39156.0) -
Complex(0, self) を返します。
...Complex(0, self) を返します。
ただし、Complex オブジェクトでは利用できません。
//emlist[例][ruby]{
10.i # => (0+10i)
-10.i # => (0-10i)
(0.1).i # => (0+0.1i)
Rational(1, 2).i # => (0+(1/2)*i)
//}... -
Numeric
# infinite? -> nil (30213.0) -
常に nil を返します。 自身が Float かComplex、もしくはそのサブクラスのインスタンスの場合は、self の絶対値が負の無限大の場合に-1を、正の無限大の場合に1を、有限値の場合に nil を返します。
...il を返します。
自身が Float かComplex、もしくはそのサブクラスのインスタンスの場合は、self の絶対値が負の無限大の場合に-1を、正の無限大の場合に1を、有限値の場合に nil を返します。
//emlist[例][ruby]{
10.infinite? # => ni......l
(3r).infinite? # => nil
//}
@see Numeric#finite?、Float#infinite?、Complex#infinite?... -
Numeric
# divmod(other) -> [Numeric] (27232.0) -
self を other で割った商 q と余り r を、 [q, r] という 2 要素の配列にして返します。 商 q は常に整数ですが、余り r は整数であるとは限りません。
...数です。
divmod が返す商は Numeric#div と同じです。
また余りは、Numeric#modulo と同じです。
このメソッドは、メソッド / と % によって定義されています。
@param other 自身を割る数を指定します。
//emlist[例][ruby]{
11.divmod(3)......#=> [3, 2]
(11.5).divmod(3.5) #=> [3, 1.0]
11.divmod(-3) #=> [-4, -1]
11.divmod(3.5) #=> [3, 0.5]
(-11).divmod(3.5) #=> [-4, 3.0]
//}
@see Numeric#div, Numeric#modulo... -
Numeric
# to _ int -> Integer (27229.0) -
self.to_i と同じです。
...self.to_i と同じです。
//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//}... -
Numeric
# remainder(other) -> Numeric (27220.0) -
self を other で割った余り r を返します。
...other 自身を割る数を指定します。
//emlist[例][ruby]{
p 13.remainder(4) #=> 1
p (11.5).remainder(3.5) #=> 1.0
p 13.remainder(-4) #=> 1
p (-13).remainder(4) #=> -1
p (-13).remainder(-4) #=> -1
p (-11).remainder(3.5) #=> -0.5
//}
@see Numeric#divmod, Numeric#modulo... -
Numeric
# magnitude -> Numeric (27209.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
12.abs #=> 12
(-34.56).abs #=> 34.56
-34.56.abs #=> 34.56
//}... -
Numeric
# fdiv(other) -> Float | Complex (27131.0) -
self を other で割った商を 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
# ceil -> Integer (27125.0) -
自身と等しいかより大きな整数のうち最小のものを返します。
...自身と等しいかより大きな整数のうち最小のものを返します。
//emlist[例][ruby]{
1.ceil #=> 1
1.2.ceil #=> 2
(-1.2).ceil #=> -1
(-1.5).ceil #=> -1
//}
@see Numeric#floor, Numeric#round, Numeric#truncate... -
Numeric
# finite? -> bool (27119.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?...