2件ヒット
[1-2件を表示]
(0.040秒)
キーワード
- ConditionVariable (1)
- Numeric (1)
検索結果
-
Thread
:: ConditionVariable (118.0) -
スレッドの同期機構の一つである状態変数を実現するクラスです。
...が空になった場合、
あるいは満タンになった場合に Condition Variable を使って wait しています。
require 'thread'
class TinyQueue
def initialize(max=2)
@max = max
@full = ConditionVariable.new
@empty = ConditionVariable.new
@mutex = Mut... -
Numeric (46.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...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...