るりまサーチ

最速Rubyリファレンスマニュアル検索!
128件ヒット [1-100件を表示] (0.053秒)
トップページ > クエリ:Complex[x] > クエリ:i[x] > 種類:モジュール関数[x]

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

Kernel.#Complex(r, i = 0) -> Complex (18530.0)

実部が r、虚部が i である Complex クラスのオブジェクトを生成します。

...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。

@param r 生成する複素数の実部。

@param i 生成する複素数の虚部。省略した場合は 0 です。

@param s 生成する複素数を表す文字列。


@raise ArgumentError 変換...
...//emlist[例][ruby]{
Complex
(1) # => (1+0i)
Complex
(1, 2) # => (1+2i)
Complex
('1+1i') # => (1+1i)
Complex
('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex
('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex
('_') # => ArgumentError
//}

r にも i にも複...
...
Complex
(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。

//emlist[例][ruby]{
Complex
('1+1i', '2+3i') # => (-2+3i)
Complex
('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}

@see Complex.rect、Complex.rectangular

[注意] Complex...

Kernel.#Complex(r, i = 0, exception: true) -> Complex | nil (18530.0)

実部が r、虚部が i である Complex クラスのオブジェクトを生成します。

...が r、虚部が i である Complex クラスのオブジェクトを生成します。

@param r 生成する複素数の実部。

@param i 生成する複素数の虚部。省略した場合は 0 です。

@param s 生成する複素数を表す文字列。

@param exception false を指定す...
...代わりに nil を返します。

@raise ArgumentError 変換できないオブジェクトを指定した場合に発生します。

//emlist[例][ruby]{
Complex
(1) # => (1+0i)
Complex
(1, 2) # => (1+2i)
Complex
('1+1i') # => (1+1i)
Complex
('1+1j') # => (1+1i)
# Complex.polar(10, 10)...
...440211108893697i)
Complex
('_') # => ArgumentError
//}

r にも i にも複素数と解釈されるオブジェクトを指定した場合には、
Complex
(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。

//emlist[例][ruby]{
Complex
('1+1i', '2+3i')...

Kernel.#Complex(s, exception: true) -> Complex | nil (18530.0)

実部が r、虚部が i である Complex クラスのオブジェクトを生成します。

...が r、虚部が i である Complex クラスのオブジェクトを生成します。

@param r 生成する複素数の実部。

@param i 生成する複素数の虚部。省略した場合は 0 です。

@param s 生成する複素数を表す文字列。

@param exception false を指定す...
...代わりに nil を返します。

@raise ArgumentError 変換できないオブジェクトを指定した場合に発生します。

//emlist[例][ruby]{
Complex
(1) # => (1+0i)
Complex
(1, 2) # => (1+2i)
Complex
('1+1i') # => (1+1i)
Complex
('1+1j') # => (1+1i)
# Complex.polar(10, 10)...
...440211108893697i)
Complex
('_') # => ArgumentError
//}

r にも i にも複素数と解釈されるオブジェクトを指定した場合には、
Complex
(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。

//emlist[例][ruby]{
Complex
('1+1i', '2+3i')...

Kernel.#Complex(s) -> Complex (18430.0)

実部が r、虚部が i である Complex クラスのオブジェクトを生成します。

...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。

@param r 生成する複素数の実部。

@param i 生成する複素数の虚部。省略した場合は 0 です。

@param s 生成する複素数を表す文字列。


@raise ArgumentError 変換...
...//emlist[例][ruby]{
Complex
(1) # => (1+0i)
Complex
(1, 2) # => (1+2i)
Complex
('1+1i') # => (1+1i)
Complex
('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex
('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex
('_') # => ArgumentError
//}

r にも i にも複...
...
Complex
(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。

//emlist[例][ruby]{
Complex
('1+1i', '2+3i') # => (-2+3i)
Complex
('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}

@see Complex.rect、Complex.rectangular

[注意] Complex...

Kernel.#Rational(x, y = 1, exception: true) -> Rational | nil (6313.0)

引数を有理数(Rational)に変換した結果を返します。

...を有理数(Rational)に変換した結果を返します。

@param x 変換対象のオブジェクトです。

@param y 変換対象のオブジェクトです。省略した場合は x だけを用いて
Rational オブジェクトを作成します。

@param exception false を指...
...に nil を返します。

@raise ArgumentError 変換できないオブジェクトを指定した場合に発生します。

引数 x、y の両方を指定した場合、x/y した Rational オブジェクトを
返します。

//emlist[例][ruby]{
Rational("1/3") # => (1/3)
Rational...
...# => (1/3)
Rational("0.1", "0.3") # => (1/3)
Rational(Complex(1,2), 2) # => ((1/2)+(1/1)*i)
//}

ただし、1.8系とは異なり、Rational オブジェクトは常に既約(それ以上
約分できない状態)である事に注意してください。

//emlist[例][ruby]{
Rational(2, 6)...

絞り込み条件を変える

Kernel.#Rational(x, y = 1) -> Rational (6213.0)

引数を有理数(Rational)に変換した結果を返します。

...数を有理数(Rational)に変換した結果を返します。

@param x 変換対象のオブジェクトです。

@param y 変換対象のオブジェクトです。省略した場合は x だけを用いて
Rational オブジェクトを作成します。


@raise ArgumentError 変換...
...x/y した Rational オブジェクトを
返します。

//emlist[例][ruby]{
Rational("1/3") # => (1/3)
Rational(1, 3) # => (1/3)
Rational("0.1", "0.3") # => (1/3)
Rational(Complex(1,2), 2) # => ((1/2)+(1/1)*i)
//}

ただし、1.8系とは異なり、Rational オブジェ...
...クトは常に既約(それ以上
約分できない状態)である事に注意してください。

//emlist[例][ruby]{
Rational(2, 6) # => (1/3)
Rational(1, 3) * 3 # => (1/1)
//}

引数に文字列を指定する場合、以下のいずれかの形式で指定します。

* "1/3...

CMath.#asin(z) -> Float | Complex (6202.0)

z の逆正弦関数の値をラジアンで返します。

...z の逆正弦関数の値をラジアンで返します。

@param z 数値

@raise TypeError z に数値以外を指定した場合に発生します。...

CMath.#asinh(z) -> Float | Complex (6202.0)

z の逆双曲線正弦関数の値を返します。

...z の逆双曲線正弦関数の値を返します。

@param z 数値

@raise TypeError z に数値以外を指定した場合に発生します。...

CMath.#sin(z) -> Float | Complex (6202.0)

z の正弦関数の値を返します。

...z の正弦関数の値を返します。

@param z 数値(ラジアンで与えます)

@raise TypeError z に数値以外を指定した場合に発生します。...

CMath.#sinh(z) -> Float | Complex (6202.0)

z の双曲線正弦関数の値を返します。

...z の双曲線正弦関数の値を返します。

@param z 数値

@raise TypeError z に数値以外を指定した場合に発生します。...

絞り込み条件を変える

FileUtils.#copy(src, dest, options = {}) -> () (6113.0)

ファイル src を dest にコピーします。

...れた場合、
file1 を dest/file1 にコピー、file2 を dest/file2 にコピー、
というように、ディレクトリ dest の中にファイル file1、file2、 …を
同じ名前でコピーします。dest がディレクトリでない場合は例外
Errno::ENOTDIR が発生します...
...ptions :preserve, :noop, :verbose が指定できます。
c:FileUtils#options

@raise Errno::ENOTDIR src が複数のファイルかつ、dest がディレクトリでない場合に発生します。

//emlist[][ruby]{
require 'fileutils'
FileUtils.cp 'eval.c', 'eval.c.org'
FileUtil...
...s.cp(['cgi.rb', 'complex.rb', 'date.rb'], '/usr/lib/ruby/1.8')
FileUtils.cp(%w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.8', verbose: true)
//}...

FileUtils.#cp(src, dest, options = {}) -> () (6113.0)

ファイル src を dest にコピーします。

...れた場合、
file1 を dest/file1 にコピー、file2 を dest/file2 にコピー、
というように、ディレクトリ dest の中にファイル file1、file2、 …を
同じ名前でコピーします。dest がディレクトリでない場合は例外
Errno::ENOTDIR が発生します...
...ptions :preserve, :noop, :verbose が指定できます。
c:FileUtils#options

@raise Errno::ENOTDIR src が複数のファイルかつ、dest がディレクトリでない場合に発生します。

//emlist[][ruby]{
require 'fileutils'
FileUtils.cp 'eval.c', 'eval.c.org'
FileUtil...
...s.cp(['cgi.rb', 'complex.rb', 'date.rb'], '/usr/lib/ruby/1.8')
FileUtils.cp(%w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.8', verbose: true)
//}...

BigMath.#log(x, prec) -> BigDecimal (3107.0)

x の自然対数を prec で指定した精度で計算します。

...@param x 計算対象の数値を Integer、Float、
Rational、BigDecimal オブジェクトのいずれかで指定
します。

@param prec 計算結果の精度を指定します。

@raise Math::DomainError x に 0 以下の数値か Complex オブジェクト...
...が指定された場合に発生します。

@raise ArgumentError prec に 0 以下の数値が指定された場合に発生します。

//emlist[][ruby]{
require "bigdecimal/math"

puts BigMath::log(BigDecimal('2'), 10) #=> 0.693147180559945309417232112588603776354688e0
//}...

CMath.#exp(z) -> Float | Complex (138.0)

z の指数関数(Math::E の z 乗)の値を返します。

...@raise TypeError z に数値以外を指定した場合に発生します。

//emlist[例][ruby]{
require "cmath"
CMath.exp(Complex(0, 0))# => (1.0+0.0i)
CMath.exp(Complex(0, Math::PI)) # => (-1.0+1.2246063538223773e-16i)
CMath.exp(Complex(0, Math::PI / 2.0)) # => (6.123031769111886e-17+1.0i)
//}...

CMath.#sqrt(z) -> Float | Complex (120.0)

z の平方根を返します。

...z の平方根を返します。

@param z 数値

@raise TypeError z に数値以外を指定した場合に発生します。

//emlist[例][ruby]{
require "cmath"
CMath.sqrt(-1) # => (0+1.0i)
CMath.sqrt(1)# => 1.0
CMath.sqrt(Complex(0, 8))# => (2.0+2.0i)
//}...

絞り込み条件を変える

<< 1 2 > >>