527件ヒット
[1-100件を表示]
(0.074秒)
別のキーワード
種類
- インスタンスメソッド (483)
- 特異メソッド (33)
- 定数 (11)
キーワード
- * (11)
- ** (11)
- + (11)
- - (11)
- -@ (11)
-
/ (11) - < (11)
- <= (11)
- <=> (5)
- == (11)
- > (11)
- >= (11)
- I (11)
- abs (11)
- abs2 (11)
- angle (11)
- arg (11)
- between? (11)
- clamp (11)
- coerce (11)
- conj (11)
- conjugate (11)
- denominator (11)
- fdiv (11)
- finite? (8)
- imag (11)
- imaginary (11)
- infinite? (8)
- inspect (11)
- magnitude (11)
-
marshal
_ dump (11) - numerator (11)
- phase (11)
- polar (22)
- quo (11)
- rationalize (22)
- real (11)
- real? (11)
- rect (22)
- rectangular (22)
-
to
_ c (11) -
to
_ f (11) -
to
_ i (11) -
to
_ r (11) -
to
_ s (11)
検索結果
先頭5件
-
Complex
# clamp(range) -> object (6103.0) -
@undef
@undef -
Complex
# inspect -> String (6103.0) -
自身を人間が読みやすい形の文字列表現にして返します。
...t[例][ruby]{
Complex(2).inspect # => "(2+0i)"
Complex('-8/6').inspect # => "((-4/3)+0i)"
Complex('1/2i').inspect # => "(0+(1/2)*i)"
Complex(0, Float::INFINITY).inspect # => "(0+Infinity*i)"
Complex(Float::NAN, Float::NAN).inspect # => "(... -
Complex
# marshal _ dump -> Array (6103.0) -
Marshal.#load のためのメソッドです。 Complex::compatible#marshal_load で復元可能な配列を返します。
...#load のためのメソッドです。
Complex::compatible#marshal_load で復元可能な配列を返します。
2.0 以降では Marshal.#load で 1.8 系の Complex オブジェクト
を保存した文字列も復元できます。
[注意] Complex::compatible は通常の方法では参照... -
Complex
# phase -> Float (6103.0) -
自身の偏角を[-π,π]の範囲で返します。
...ruby]{
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
//emlist[例][ruby]{
Complex(-1, 0).arg #=> 3.141592653589793
Complex(-1, -......0).arg #=> 3.141592653589793
Complex(-1, -0.0).arg #=> -3.141592653589793
Complex(0, 0.0).arg #=> 0.0
Complex(0, -0.0).arg #=> -0.0
Complex(-0.0, 0).arg #=> 3.141592653589793
Complex(-0.0, -0.0).arg #=> -3.141592653589793
//}
@see... -
Complex
# polar -> [Numeric , Numeric] (6103.0) -
自身の絶対値と偏角を配列にして返します。
...自身の絶対値と偏角を配列にして返します。
//emlist[例][ruby]{
Complex.polar(1, 2).polar # => [1, 2]
//}
@see Numeric#polar... -
Complex
. polar(r , theta = 0) -> Complex (6103.0) -
絶対値が r、偏角が theta である Complex クラスのオブジェクトを生成します。
... Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の絶対値。
@param theta 生成する複素数の偏角。単位はラジアンです。省略した場合は 0 です。
//emlist[例][ruby]{
Complex.polar(2.0) # => (2.0+0.0i)
Complex.polar......(2.0, 0) # => (2.0+0.0i)
Complex.polar(2.0, Math::PI) # => (-2.0+2.4492127076447545e-16i)
//}... -
Complex
# coerce(other) -> [Complex , Complex] (3203.0) -
other を Complex に変換して [変換後の other, self] の配列を返します。
...other を Complex に変換して [変換後の other, self] の配列を返します。
@raise TypeError 変換できないオブジェクトを指定した場合に発生します。
//emlist[例][ruby]{
Complex(1).coerce(2) # => [(2+0i), (1+0i)]
//}... -
Complex
# *(other) -> Complex (3103.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 (3103.0) -
冪(べき)乗を計算します。
...冪(べき)乗を計算します。
@param other 自身を other 乗する数
//emlist[例][ruby]{
Complex('i') ** 2 # => (-1+0i)
//}... -
Complex
# +(other) -> Complex (3103.0) -
和を計算します。
...和を計算します。
@param other 自身に足す数
//emlist[例][ruby]{
Complex(1, 2) + Complex(2, 3) # => (3+5i)
//}...