77件ヒット
[1-77件を表示]
(0.064秒)
検索結果
先頭5件
-
Complex
# arg -> Float (36204.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).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 (33252.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 (21119.0) -
自身を JSON 形式の文字列に変換して返します。
...ら JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 使用しません。
//emlist[例][ruby]{
require 'json/add/complex'
Complex(2, 3).to_json # => "{\"json_class\":\"Complex\",\"r\":2,\"i\":3}"
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json......_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json
に渡されます。
//emlist[例][ruby]{
require 'json/add/complex'
Complex(2, 3).to_json # => "{\"json_class\":\"Complex\",\"r\":2,\"i\":3}"
//}
@see JSON::Generat... -
Complex
# angle -> Float (21104.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).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 (21104.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).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 (18152.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 (3052.0) -
自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#arg...