るりまサーチ

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

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self=

ライブラリ

クラス

キーワード

検索結果

Numeric#rectangular -> [Numeric, Numeric] (15117.0)

[self, 0] を返します。

...[self, 0] を返します。

//emlist[例][ruby]{
1.rect # => [1, 0]
-1.rect # => [-1, 0]
1.0.rect # => [1.0, 0]
-1.0.rect # => [-1.0, 0]
//}

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

@see Complex#rect...

Numeric (60.0)

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

...- - - o
rect | o - - - - - o
rectangular
| o - - - - - o
remainder | o - -...
...**d
if self > 0
self
.quo(x).ceil * x
else
self
.quo(x).floor * x
end
end

def rounddown(d=0)
x = 10**d
if self < 0
self
.quo(x).ceil * x
else
self
.quo(x).floor * x
end
end

def roundoff(d=0)
x = 10**d
if self < 0
(self.quo(x) -...
...0.5).ceil * x
else
(self.quo(x) + 0.5).floor * x
end
end
end
//}


===[a:division] 除法と商・剰余

Numeric には除法(除算;割り算;division)に関するメソッドがいくつもありますが、
除法にはいくつか種類があるため、全貌が把握...
...Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
rectangular
| o - - - o
remainder | o o - - -...

Numeric#rect -> [Numeric, Numeric] (17.0)

[self, 0] を返します。

...[self, 0] を返します。

//emlist[例][ruby]{
1.rect # => [1, 0]
-1.rect # => [-1, 0]
1.0.rect # => [1.0, 0]
-1.0.rect # => [-1.0, 0]
//}

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

@see Complex#rect...