るりまサーチ (Ruby 3.1)

最速Rubyリファレンスマニュアル検索!
7件ヒット [1-7件を表示] (0.068秒)

別のキーワード

  1. _builtin complex
  2. complex rect
  3. complex polar
  4. kernel complex
  5. complex rectangular

ライブラリ

クラス

キーワード

検索結果

Complex#arg -> Float (72613.0)

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

...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 Numeric#arg...

Numeric#arg -> 0 | Math::PI (45379.0)

自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}

Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。

@see Complex#arg...

Complex#to_json(*args) -> String (27358.0)

自身を JSON 形式の文字列に変換して返します。

自身を JSON 形式の文字列に変換して返します。

内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。

@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json
に渡されます。

//emlist[例][ruby]{
require 'json/add/complex'
Complex(2, 3).to_json # => "{\"json_class\":\"Complex\"...

Complex#angle -> Float (27313.0)

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

...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 Numeric#arg...

Complex#phase -> Float (27313.0)

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

...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 Numeric#arg...

絞り込み条件を変える

Numeric#angle -> 0 | Math::PI (79.0)

自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}

Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。

@see Complex#arg...

Numeric#phase -> 0 | Math::PI (79.0)

自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}

Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。

@see Complex#arg...