るりまサーチ

最速Rubyリファレンスマニュアル検索!
312件ヒット [1-100件を表示] (0.074秒)
トップページ > クエリ:a[x] > クラス:Complex[x]

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Complex#marshal_dump -> Array (6201.0)

Marshal.#load のためのメソッドです。 Complex::compatible#marshal_load で復元可能な配列を返します。

...Marshal.#load のためのメソッドです。
Complex
::compatible#marshal_load で復元可能な配列を返します。

2.0 以降では Marshal.#load で 1.8 系の Complex オブジェクト
を保存した文字列も復元できます。

[注意] Complex::compatible は通常の方法で...

Complex#rationalize -> Rational (6201.0)

自身を Rational に変換します。

...自身を Rational に変換します。

@param eps 許容する誤差。常に無視されます。

@raise RangeError 虚部が実数か、0 ではない場合に発生します。

//emlist[例][ruby]{
Complex
(3).to_r # => (3/1)
Complex
(3, 2).to_r # => RangeError
//}...

Complex#rationalize(eps) -> Rational (6201.0)

自身を Rational に変換します。

...自身を Rational に変換します。

@param eps 許容する誤差。常に無視されます。

@raise RangeError 虚部が実数か、0 ではない場合に発生します。

//emlist[例][ruby]{
Complex
(3).to_r # => (3/1)
Complex
(3, 2).to_r # => RangeError
//}...

Complex#real? -> false (6201.0)

常に false を返します。

...常に false を返します。

//emlist[例][ruby]{
(2+3i).real? # => false
(2+0i).real? # => false
//}

@see Numeric#real?...

Complex#abs -> Numeric (6101.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 (6101.0)

自身の絶対値の 2 乗を返します。

...自身の絶対値の 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...

Complex#angle -> Float (6101.0)

自身の偏角を[-π,π]の範囲で返します。

...{
Complex
.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}

非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。

//emlist[例][ruby]{
Complex
(-1, 0).arg #=> 3.141592653589793
Complex
(-1, -0).ar...
...#=> 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 Numeric#arg...

Complex#arg -> Float (6101.0)

自身の偏角を[-π,π]の範囲で返します。

...{
Complex
.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}

非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。

//emlist[例][ruby]{
Complex
(-1, 0).arg #=> 3.141592653589793
Complex
(-1, -0).ar...
...#=> 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 Numeric#arg...

Complex#clamp(range) -> object (6101.0)

@undef

@undef
<< 1 2 3 ... > >>