るりまサーチ (Ruby 2.3.0)

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

別のキーワード

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

検索結果

Numeric#abs2 -> Numeric (105706.0)

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

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


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

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