るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

検索結果

Numeric#polar -> [Numeric, Numeric] (18163.0)

自身の絶対値と偏角を配列にして返します。正の数なら [self, 0]、負の数な ら [-self, Math::PI] を返します。

...偏角を配列にして返します。正の数なら [self, 0]、負の数な
ら [-self, Math::PI] を返します。

//emlist[例][ruby]{
1.0.polar # => [1.0, 0]
2.0.polar # => [2.0, 0]
-1.0.polar # => [1.0, 3.141592653589793]
-2.0.polar # => [2.0, 3.141592653589793]
//}

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

@see Complex#polar...

Numeric (60.0)

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

...- - - -
phase | o - - - o - o
polar
| o - - - - - o
pred | - 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
//}...
...-----------------------------------------------------------
phase | o - o - o
polar
| o - - - o
positive? | o - o o -...