るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.052秒)
トップページ > クラス:Numeric[x] > クエリ:_builtin[x] > クエリ:abs2[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

Numeric#abs2 -> Numeric (26126.0)

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

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


//emlist[例][ruby]{
2.abs2 # => 4
-2.abs2 # => 4
2.0.abs2 # => 4
-2.0.abs2 # => 4
//}

Numeric
のサブクラスは、このメソッドを適切に再定義しなければなりません。...