るりまサーチ

最速Rubyリファレンスマニュアル検索!
89件ヒット [1-89件を表示] (0.174秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クエリ:d[x] > クエリ:magnitude[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. bigdecimal to_r
  5. fileutils rm_r

ライブラリ

クラス

キーワード

検索結果

Vector#magnitude -> Float (27302.0)

ベクトルの大きさ(ノルム)を返します。

...ベクトルの大きさ(ノルム)を返します。

//emlist[例][ruby]{
r
equire 'matrix'
Vector[3, 4].norm # => 5.0
Vector[Complex(0, 1), 0].norm # => 1.0
//}

@see Vector#normalize...

Vector#r -> Float (24202.0)

ベクトルの大きさ(ノルム)を返します。

...ベクトルの大きさ(ノルム)を返します。

//emlist[例][ruby]{
r
equire 'matrix'
Vector[3, 4].norm # => 5.0
Vector[Complex(0, 1), 0].norm # => 1.0
//}

@see Vector#normalize...

Integer#magnitude -> Integer (21413.0)

self の絶対値を返します。

...self の絶対値を返します。

//emlist[][ruby]{
-
12345.abs # => 12345
12345.abs # => 12345
-
1234567890987654321.abs # => 1234567890987654321
//}...

Numeric#magnitude -> Numeric (21407.0)

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

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

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

Rational#magnitude -> Rational (21401.0)

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

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

//emlist[例][ruby]{
R
ational(1, 2).abs # => (1/2)
R
ational(-1, 2).abs # => (1/2)
//}...

絞り込み条件を変える

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

Vector#norm -> Float (12202.0)

ベクトルの大きさ(ノルム)を返します。

...ベクトルの大きさ(ノルム)を返します。

//emlist[例][ruby]{
r
equire 'matrix'
Vector[3, 4].norm # => 5.0
Vector[Complex(0, 1), 0].norm # => 1.0
//}

@see Vector#normalize...

Numeric (8226.0)

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

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

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは...
...o - - - - - o
Numeric Integer Fixnum Bignum Float Rational Complex
-
------------------------------------------------------------------------------------------
d
enominator |...
...ct | - - o o o o o
integer? | o o - - - - -
lcm | - o - - - - -
magnitude
|...
...=> ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
Numeric Integer Float Rational Complex
-
-------------------------------------------------------------------------------
% | o o o -...
...- - -
lcm | - o - - -
Numeric Integer Float Rational Complex
-
-------------------------------------------------------------------------------
magnitude
|...

NEWS for Ruby 3.0.0 (3312.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...NEWS for Ruby 3.0.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...様の変更

* Keyword arguments are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
r
esult in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplat...
...] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
d
ef method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matc...