348件ヒット
[1-100件を表示]
(0.847秒)
ライブラリ
- ビルトイン (348)
キーワード
- * (8)
- ** (8)
- + (8)
- - (8)
- -@ (8)
-
/ (8) - < (8)
- <= (8)
- <=> (2)
- == (8)
- > (8)
- >= (8)
- abs (8)
- abs2 (8)
- angle (8)
- arg (8)
- between? (8)
- clamp (8)
- coerce (8)
- conj (8)
- conjugate (8)
- denominator (8)
- fdiv (8)
- finite? (5)
- imag (8)
- imaginary (8)
- infinite? (5)
- inspect (8)
- magnitude (8)
-
marshal
_ dump (8) - numerator (8)
- phase (8)
- polar (8)
- quo (8)
- rationalize (16)
- real (8)
- real? (8)
- rect (8)
- rectangular (8)
-
to
_ c (8) -
to
_ f (8) -
to
_ i (8) -
to
_ r (8) -
to
_ s (8)
検索結果
先頭5件
-
Complex
# *(other) -> Complex (8002.0) -
積を計算します。
...積を計算します。
@param other 自身に掛ける数
//emlist[例][ruby]{
Complex(1, 2) * 2 # => (2+4i)
Complex(1, 2) * Complex(2, 3) # => (-4+7i)
Complex(1, 2) * Rational(1, 2) # => ((1/2)+(1/1)*i)
//}... -
Complex
# **(other) -> Complex (8002.0) -
冪(べき)乗を計算します。
...冪(べき)乗を計算します。
@param other 自身を other 乗する数
//emlist[例][ruby]{
Complex('i') ** 2 # => (-1+0i)
//}... -
Complex
# +(other) -> Complex (8002.0) -
和を計算します。
...和を計算します。
@param other 自身に足す数
//emlist[例][ruby]{
Complex(1, 2) + Complex(2, 3) # => (3+5i)
//}... -
Complex
# -(other) -> Complex (8002.0) -
差を計算します。
...差を計算します。
@param other 自身から引く数
//emlist[例][ruby]{
Complex(1, 2) - Complex(2, 3) # => (-1-1i)
//}... -
Complex
# -@ -> Complex (8002.0) -
自身の符号を反転させたものを返します。
...自身の符号を反転させたものを返します。
//emlist[例][ruby]{
-Complex(1) # => (-1+0i)
-Complex(-1, 1) # => (1-1i)
//}... -
Complex
# / (other) -> Complex (8002.0) -
商を計算します。
...商を計算します。
@param other 自身を割る数
//emlist[例][ruby]{
Complex(10.0) / 3 # => (3.3333333333333335+(0/1)*i)
Complex(10) / 3 # => ((10/3)+(0/1)*i)
//}
@see Numeric#quo... -
Complex
# <(other) -> bool (8002.0) -
@undef
@undef -
Complex
# <=(other) -> bool (8002.0) -
@undef
@undef -
Complex
# <=>(other) -> -1 | 0 | 1 | nil (8002.0) -
self の虚部がゼロで other が実数の場合、 self の実部の <=> メソッドで other と比較した結果を返します。 other が Complex で虚部がゼロの場合も同様です。
...が Complex で虚部がゼロの場合も同様です。
その他の場合は nil を返します。
@param other 自身と比較する数値
//emlist[例][ruby]{
Complex(2, 3) <=> Complex(2, 3) #=> nil
Complex(2, 3) <=> 1 #=> nil
Complex(2) <=> 1 #=> 1
Complex(2)......<=> 2 #=> 0
Complex(2) <=> 3 #=> -1
//}... -
Complex
# ==(other) -> bool (8002.0) -
数値として等しいか判定します。
...値として等しいか判定します。
@param other 自身と比較する数値
//emlist[例][ruby]{
Complex(2, 1) == Complex(1) # => false
Complex(1, 0) == Complex(1) # => true
Complex(1, 0) == 1 # => true
//}... -
Complex
# >(other) -> bool (8002.0) -
@undef
@undef -
Complex
# >=(other) -> bool (8002.0) -
@undef
@undef -
Complex
# abs -> Numeric (8002.0) -
自身の絶対値を返します。
...す。
以下の計算の結果を Float オブジェクトで返します。
sqrt(self.real ** 2 + self.imag ** 2)
//emlist[例][ruby]{
Complex(1, 2).abs # => 2.23606797749979
Complex(3, 4).abs # => 5.0
Complex('1/2', '1/2').abs # => 0.7071067811865476
//}
@see Complex#abs2... -
Complex
# abs2 -> Numeric (8002.0) -
自身の絶対値の 2 乗を返します。
...算の結果を返します。
self.real ** 2 + self.imag ** 2
//emlist[例][ruby]{
Complex(1, 1).abs2 # => 2
Complex(1.0, 1.0).abs2 # => 2.0
Complex('1/2', '1/2').abs2 # => (1/2)
//}
@see Complex#abs...