11件ヒット
[1-11件を表示]
(0.031秒)
別のキーワード
ライブラリ
- ビルトイン (11)
検索結果
先頭1件
-
Numeric (38196.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...スです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。
演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで......- - - -
Numeric Integer Fixnum Bignum Float Rational Complex
-------------------------------------------------------------------------------------------
gcdlcm | - 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 rounddown(d=0)
x = 10**d
if self < 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end......o -
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
gcd | - o - - -
gcdlcm | -...