81件ヒット
[1-81件を表示]
(0.021秒)
種類
- インスタンスメソッド (66)
- クラス (11)
- 文書 (4)
ライブラリ
- ビルトイン (77)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) - abs2 (22)
- magnitude (22)
検索結果
先頭5件
-
Numeric
# abs -> Numeric (39221.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
12.abs #=> 12
(-34.56).abs #=> 34.56
-34.56.abs #=> 34.56
//}... -
Numeric (38148.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...スです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。
演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで......提供されているメソッド
(+, -, *, /, %) を利用して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce......o - - -
Numeric Integer Fixnum Bignum Float Rational Complex
-------------------------------------------------------------------------------------------
abs | o - o......- -
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
abs | o o o o o
abs2 | o... -
Numeric
# abs2 -> Numeric (27232.0) -
自身の絶対値の 2 乗を返します。
...自身の絶対値の 2 乗を返します。
//emlist[例][ruby]{
2.abs2 # => 4
-2.abs2 # => 4
2.0.abs2 # => 4
-2.0.abs2 # => 4
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。... -
Numeric
# magnitude -> Numeric (24121.0) -
自身の絶対値を返します。
...自身の絶対値を返します。
//emlist[例][ruby]{
12.abs #=> 12
(-34.56).abs #=> 34.56
-34.56.abs #=> 34.56
//}... -
Complex
# abs -> Numeric (18227.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... -
Complex
# abs2 -> Numeric (6226.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... -
Complex
# magnitude -> Numeric (3127.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... -
NEWS for Ruby 3
. 0 . 0 (18.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modify Regexp.last_match. 17......low compilations.
* Memory view interface [EXPERIMENTAL]
* The memory view interface is a C-API set to exchange a raw memory area, such as a numeric array or a bitmap image, between extension libraries. The extension libraries can share also the metadata of the memory area that consists of the......and their subclasses.
* Method inlining support for some C methods
* `Kernel`: `#class`, `#frozen?`
* `Integer`: `#-@`, `#~`, `#abs`, `#bit_length`, `#even?`, `#integer?`, `#magnitude`, `#odd?`, `#ord`, `#to_i`, `#to_int`, `#zero?`
* `Struct`: reader methods for 10th or...