483件ヒット
[1-100件を表示]
(0.260秒)
ライブラリ
- ビルトイン (483)
キーワード
- * (11)
- ** (11)
- + (11)
- -@ (11)
-
/ (11) - < (11)
- <= (11)
- <=> (5)
- == (11)
- > (11)
- >= (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 (11)
- quo (11)
- rationalize (22)
- real (11)
- real? (11)
- rect (11)
- rectangular (11)
-
to
_ c (11) -
to
_ f (11) -
to
_ i (11) -
to
_ r (11) -
to
_ s (11)
検索結果
先頭5件
-
Complex
# -(other) -> Complex (26114.0) -
差を計算します。
...差を計算します。
@param other 自身から引く数
//emlist[例][ruby]{
Complex(1, 2) - Complex(2, 3) # => (-1-1i)
//}... -
Complex
# -@ -> Complex (14120.0) -
自身の符号を反転させたものを返します。
...自身の符号を反転させたものを返します。
//emlist[例][ruby]{
-Complex(1) # => (-1+0i)
-Complex(-1, 1) # => (1-1i)
//}... -
Complex
# angle -> Float (8150.0) -
自身の偏角を[-π,π]の範囲で返します。
...を[-π,π]の範囲で返します。
//emlist[例][ruby]{
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
//emlist[例][ruby]{
Complex(-1, 0)......3589793
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.14159... -
Complex
# arg -> Float (8150.0) -
自身の偏角を[-π,π]の範囲で返します。
...を[-π,π]の範囲で返します。
//emlist[例][ruby]{
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
//emlist[例][ruby]{
Complex(-1, 0)......3589793
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.14159... -
Complex
# phase -> Float (8150.0) -
自身の偏角を[-π,π]の範囲で返します。
...を[-π,π]の範囲で返します。
//emlist[例][ruby]{
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
//emlist[例][ruby]{
Complex(-1, 0)......3589793
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.14159... -
Complex
# denominator -> Integer (8114.0) -
分母を返します。
...と虚部の分母の最小公倍数を整数で返します。
1 2 3+4i <- numerator(分子)
- + -i -> ----
2 3 6 <- denominator(分母)
//emlist[例][ruby]{
Complex('1/2+2/3i').denominator # => 6
Complex(3).numerator # => 1
//}
@see Complex#numerator... -
Complex
# <=>(other) -> -1 | 0 | 1 | nil (8109.0) -
self の虚部がゼロで other が実数の場合、 self の実部の <=> メソッドで other と比較した結果を返します。 other が Complex で虚部がゼロの場合も同様です。
...が Complex で虚部がゼロの場合も同様です。
その他の場合は nil を返します。
@param other 自身と比較する数値
//emlist[例][ruby]{
Complex(2, 3) <=> Complex(2, 3) #=> nil
Complex(2, 3) <=> 1 #=> nil
Complex(2) <=> 1 #=> 1
Complex(2)......<=> 2 #=> 0
Complex(2) <=> 3 #=> -1
//}... -
Complex
# conj -> Complex (8108.0) -
自身の共役複素数を返します。
...自身の共役複素数を返します。
//emlist[例][ruby]{
Complex(1, 2).conj # => (1-2i)
//}... -
Complex
# conjugate -> Complex (8108.0) -
自身の共役複素数を返します。
...自身の共役複素数を返します。
//emlist[例][ruby]{
Complex(1, 2).conj # => (1-2i)
//}... -
Complex
# *(other) -> Complex (8102.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)
//}...