600件ヒット
[1-100件を表示]
(0.054秒)
別のキーワード
種類
- インスタンスメソッド (540)
- 特異メソッド (48)
- 定数 (12)
ライブラリ
- ビルトイン (576)
-
json
/ add / complex (24)
キーワード
- * (12)
- ** (12)
- + (12)
- - (12)
- -@ (12)
-
/ (12) - < (12)
- <= (12)
- <=> (6)
- == (12)
- > (12)
- >= (12)
- I (12)
- abs (12)
- abs2 (12)
- angle (12)
- arg (12)
- between? (12)
- clamp (12)
- coerce (12)
- conj (12)
- conjugate (12)
- denominator (12)
- fdiv (12)
- finite? (9)
- imag (12)
- imaginary (12)
- infinite? (9)
- inspect (12)
-
json
_ create (12) - magnitude (12)
-
marshal
_ dump (12) - numerator (12)
- phase (12)
- polar (24)
- quo (12)
- rationalize (24)
- real (12)
- real? (12)
- rect (24)
- rectangular (24)
-
to
_ c (12) -
to
_ f (12) -
to
_ i (12) -
to
_ json (12) -
to
_ r (12) -
to
_ s (12)
検索結果
先頭5件
-
Complex
# clamp(range) -> object (6101.0) -
@undef
@undef -
Complex
# inspect -> String (6101.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 (6101.0) -
Marshal.#load のためのメソッドです。 Complex::compatible#marshal_load で復元可能な配列を返します。
...#load のためのメソッドです。
Complex::compatible#marshal_load で復元可能な配列を返します。
2.0 以降では Marshal.#load で 1.8 系の Complex オブジェクト
を保存した文字列も復元できます。
[注意] Complex::compatible は通常の方法では参照... -
Complex
# phase -> Float (6101.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] (6101.0) -
自身の絶対値と偏角を配列にして返します。
...自身の絶対値と偏角を配列にして返します。
//emlist[例][ruby]{
Complex.polar(1, 2).polar # => [1, 2]
//}
@see Numeric#polar... -
Complex
. polar(r , theta = 0) -> Complex (6101.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] (3201.0) -
other を Complex に変換して [変換後の other, self] の配列を返します。
...other を Complex に変換して [変換後の other, self] の配列を返します。
@raise TypeError 変換できないオブジェクトを指定した場合に発生します。
//emlist[例][ruby]{
Complex(1).coerce(2) # => [(2+0i), (1+0i)]
//}... -
Complex
# *(other) -> Complex (3101.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 (3101.0) -
冪(べき)乗を計算します。
...冪(べき)乗を計算します。
@param other 自身を other 乗する数
//emlist[例][ruby]{
Complex('i') ** 2 # => (-1+0i)
//}...