るりまサーチ

最速Rubyリファレンスマニュアル検索!
102件ヒット [1-100件を表示] (0.040秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

Kernel.#Complex(r, i = 0) -> Complex (18335.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...
...
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 (18335.0)

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

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

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

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

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

@param exception false を...
...発生します。

//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...
...
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(s) -> Complex (18335.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...
...
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(s, exception: true) -> Complex | nil (18335.0)

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

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

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

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

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

@param exception false を...
...発生します。

//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...
...
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...

CMath.#exp(z) -> Float | Complex (126.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.#log(z) -> Float | Complex (115.0)

z の対数を返します。

...aram b 底を指定します。省略した場合は自然対数を計算します。

@raise TypeError 引数のどちらかに数値以外を指定した場合に発生します。

//emlist[例][ruby]{
require "cmath"
CMath.log(Complex(0, 0)) # => -Infinity+0.0i
CMath.log(0) # => -Infinity
//}...

CMath.#log(z, b) -> Float | Complex (115.0)

z の対数を返します。

...aram b 底を指定します。省略した場合は自然対数を計算します。

@raise TypeError 引数のどちらかに数値以外を指定した場合に発生します。

//emlist[例][ruby]{
require "cmath"
CMath.log(Complex(0, 0)) # => -Infinity+0.0i
CMath.log(0) # => -Infinity
//}...

CMath.#cbrt(z) -> Float | Complex (114.0)

z の立方根の内、主値を返します。

...z の立方根の内、主値を返します。

@param z 数値

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

//emlist[例][ruby]{
require "cmath"
CMath.cbrt(-8)# => (1.0000000000000002+1.7320508075688772i)
//}


@see Complex#**...

CMath.#sqrt(z) -> Float | Complex (114.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)
//}...

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

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

...場合、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)
//}

引数に文字列を指定する場合、以下のいずれかの形式で指定します。...
...
ん。また、Kernel.#Integer とは違い "0x10" のような進数を表す接頭
辞を含めた指定は行えません。

//emlist[例][ruby]{
Rational("1/3") # => (1/3)
Rational("0.3") # => (3/10)
Rational('0.3E0') # => (3/10)
Rational('0.1E1/3') # => (1/3)
Rational...

絞り込み条件を変える

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

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

...場合、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)
//}

引数に文字列を指定する場合、以下のいずれかの形式で指定します。...
...
ん。また、Kernel.#Integer とは違い "0x10" のような進数を表す接頭
辞を含めた指定は行えません。

//emlist[例][ruby]{
Rational("1/3") # => (1/3)
Rational("0.3") # => (3/10)
Rational('0.3E0') # => (3/10)
Rational('0.1E1/3') # => (1/3)
Rational...

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

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

...つ、dest がディレクトリでない場合に発生します。

//emlist[][ruby]{
require 'fileutils'
FileUtils.cp 'eval.c', 'eval.c.org'
FileUtils.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 = {}) -> () (31.0)

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

...つ、dest がディレクトリでない場合に発生します。

//emlist[][ruby]{
require 'fileutils'
FileUtils.cp 'eval.c', 'eval.c.org'
FileUtils.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 (13.0)

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

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

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

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

puts BigMath::l...
<< 1 2 > >>