るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

キーワード

検索結果

Float#abs -> Float (63649.0)

自身の絶対値を返します。

自身の絶対値を返します。

//emlist[例][ruby]{
34.56.abs # => 34.56
-34.56.abs # => 34.56
//}

Complex#abs -> Numeric (63385.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

RubyVM::InstructionSequence#absolute_path -> String | nil (36610.0)

self が表す命令シーケンスの絶対パスを返します。

self が表す命令シーケンスの絶対パスを返します。

self を文字列から作成していた場合は nil を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method....

Thread::Backtrace::Location#absolute_path -> String (36610.0)

self が表すフレームの絶対パスを返します。

self が表すフレームの絶対パスを返します。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end

# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}

@see...

Complex#abs2 -> Numeric (27385.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

絞り込み条件を変える

Float#magnitude -> Float (18349.0)

自身の絶対値を返します。

自身の絶対値を返します。

//emlist[例][ruby]{
34.56.abs # => 34.56
-34.56.abs # => 34.56
//}

Complex#magnitude -> Numeric (18085.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