るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.017秒)
トップページ > クエリ:numeric[x] > クエリ:rectangular[x] > クエリ:rect[x] > 種類:クラス[x]

別のキーワード

  1. numeric step
  2. _builtin numeric
  3. numeric rectangular
  4. numeric conjugate
  5. numeric angle

ライブラリ

検索結果

Numeric (6203.0)

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

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

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで...
...real? | o - - - - - o
rect
| o - - - - - o
rectangular
| o - - - - - o...
...}

また、任意桁の切上げ、切捨て、四捨五入を行うメソッドは以下のように
定義できます。

//emlist[][ruby]{
class
Numeric
def roundup(d=0)
x = 10**d
if self > 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end

def rounddow...
...- o
rect
| o - - - o
Numeric
Integer Float Rational Complex
--------------------------------------------------------------------------------
rectangular
| o...