295件ヒット
[1-100件を表示]
(0.127秒)
別のキーワード
ライブラリ
- ビルトイン (253)
- bigdecimal (12)
- pathname (12)
- set (18)
クラス
- BigDecimal (12)
- Complex (36)
- Float (24)
- Integer (24)
- Numeric (36)
- Object (36)
- Pathname (12)
- Rational (18)
-
RubyVM
:: AbstractSyntaxTree :: Node (49) -
RubyVM
:: InstructionSequence (12) - Set (24)
-
Thread
:: Backtrace :: Location (12)
キーワード
- abs2 (24)
- absolute? (12)
-
absolute
_ path (24) - children (7)
- divide (24)
-
first
_ column (7) -
first
_ lineno (7) - inspect (7)
-
last
_ column (7) -
last
_ lineno (7) - magnitude (57)
- method (12)
- send (24)
- type (7)
検索結果
先頭5件
-
Complex
# abs -> Numeric (18132.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... -
Integer
# abs -> Integer (18126.0) -
self の絶対値を返します。
...self の絶対値を返します。
//emlist[][ruby]{
-12345.abs # => 12345
12345.abs # => 12345
-1234567890987654321.abs # => 1234567890987654321
//}... -
Numeric
# abs -> Numeric (18126.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
12.abs #=> 12
(-34.56).abs #=> 34.56
-34.56.abs #=> 34.56
//}... -
BigDecimal
# abs -> BigDecimal (18120.0) -
self の絶対値を返します。
...self の絶対値を返します。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('5').abs.to_i # => 5
BigDecimal('-3').abs.to_i # => 3
//}... -
Float
# abs -> Float (18120.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
34.56.abs # => 34.56
-34.56.abs # => 34.56
//}... -
Rational
# abs -> Rational (18120.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
Rational(1, 2).abs # => (1/2)
Rational(-1, 2).abs # => (1/2)
//}... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (9101.0) -
self が表す命令シーケンスの絶対パスを返します。
...= RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = Ruby......VM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"
@see RubyVM::InstructionSequence#path... -
Complex
# abs2 -> Numeric (6132.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
# abs2 -> Numeric (6132.0) -
自身の絶対値の 2 乗を返します。
...自身の絶対値の 2 乗を返します。
//emlist[例][ruby]{
2.abs2 # => 4
-2.abs2 # => 4
2.0.abs2 # => 4
-2.0.abs2 # => 4
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。...