るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

Numeric#real -> Numeric (39250.0)

自身を返します。

...す。

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

//emlist[例][ruby]{
10.real # => 10
-10.real # => -10
0.1.real # => 0.1
Rational(2, 3).real # => (2/3)
//}

@see Numeric#imag、Complex#real...

Complex#real -> Numeric (39214.0)

自身の実部を返します。

...自身の実部を返します。

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

Numeric (38202.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...スです。Integer や Float などの数値クラス
Numeric のサブクラスとして実装されています。

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで...
...ラスを参照してください。


=> ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
Numeric
Integer Fixnum Bignum Float Rational Complex
----------------------------------------------------------------------------------------...
...rationalize | - o - - o o o
real
| o - - - - - o
real
? | o - - - - - o...
...のクラスを参照してください。


=> ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
Numeric
Integer Float Rational Complex
--------------------------------------------------------------------------------
%...
...o o
real
| o - - - o
real
? | o - - - o
rect | o - - - o
Numeric
Integer...

Numeric#real? -> bool (27165.0)

常に true を返します。(Complex またはそのサブクラスではないことを意味します。)

...ます。(Complex またはそのサブクラスではないことを意味します。)

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

//emlist[例][ruby]{
10.real? # => true
-10.real? # => true
0.1.real?...
...# => true
Rational(2, 3).real? # => true
//}

@see Numeric#integer?、Complex#real?...

Complex#real? -> false (27125.0)

常に false を返します。

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

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

@see Numeric#real?...

絞り込み条件を変える

Complex#abs -> Numeric (21132.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#magnitude -> Numeric (21132.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 (21131.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...

Numeric#imag -> 0 (21024.0)

常に 0 を返します。

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

//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}

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

@see Numeric#realComplex#imag...

Numeric#imaginary -> 0 (21024.0)

常に 0 を返します。

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

//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}

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

@see Numeric#realComplex#imag...

絞り込み条件を変える

<< 1 2 > >>