るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

Complex (8007.0)

複素数を扱うクラスです。

...複素数を扱うクラスです。

Complex オブジェクトを作成するには、Kernel.#Complex、
Complex.rect、Complex.polar、Numeric#to_c、
String#to_c のいずれかを使用します。

//emlist[Complex オブジェクトの作り方][ruby]{
Complex(1) # => (1+0i)
Complex...

Numeric (8007.0)

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

...real? | o - - - - - o
rect
| o - - - - - o
rect
angular | o - - - - - o...
...d
//}

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

//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 roun...
...- o
rect
| o - - - o
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
rect
angular | o...