るりまサーチ

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

関連するキーワード

  1. rational
  2. _builtin
  3. bigdecimal

ライブラリ

キーワード

検索結果

Complex#quo(other) -> Complex (18114)

複素数otherでの除算結果を返します。

...Complexクラスのオブジェクトを返します。

===== 注意

Complex
#/ との違いは実部と虚部が全て整数だった場合に分数(Rationalクラスのオブジェクト)として計算されます。

例:

z1 = Complex.new(6, 4)
z2 = Complex.new(2, 2)

p z1.quo(2...
...) #=> Complex(Rational(3, 1), Rational(2, 1))
p z1.quo(z2) #=> Complex(Rational(5, 2), Rational(-1, 2))...
...商を計算します。

@param other 自身を割る数

例:

Complex
(10.0) / 3 # => (3.3333333333333335+(0/1)*i)
Complex
(10) / 3 # => ((10/3)+(0/1)*i)...

Complex#fdiv(other) -> Complex (13)

自身の実部と虚部をそれぞれ実数として other で割った商を返します。

...other で割った商を返します。

@param other 自身を割る数

例:

Complex
(11, 22).fdiv(3) # => (3.6666666666666665+7.333333333333333i)
Complex
(11, 22).quo(3) # => ((11/3)+(22/3)*i)

@see Complex#quo...

Complex#/(other) -> Complex (2)

商を計算します。

...商を計算します。

@param other 自身を割る数

例:

Complex
(10.0) / 3 # => (3.3333333333333335+(0/1)*i)
Complex
(10) / 3 # => ((10/3)+(0/1)*i)...