るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.060秒)

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer chr
  5. integer new

キーワード

検索結果

Integer (114046.0)

整数クラスです。

整数クラスです。

整数オブジェクトに特異メソッドを追加する事はできません。追加した場合、
TypeError が発生します。

2.4.0 から Fixnum, Bignum は Integerに統合されました。
2.4.0 からはどちらも Integer クラスのエイリアスとなっています。

Numeric (238.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...

Bignum (58.0)

Alias of Integer

Alias of Integer

Fixnum (58.0)

Alias of Integer

Alias of Integer

Rational (28.0)

有理数を扱うクラスです。

有理数を扱うクラスです。

「1/3」のような有理数を扱う事ができます。Integer や Float
と同様に Rational.new ではなく、 Kernel.#Rational を使用して
Rational オブジェクトを作成します。

//emlist[例][ruby]{
Rational(1, 3) # => (1/3)
Rational('1/3') # => (1/3)
Rational('0.33') # => (33/100)
Rational.new(1, 3) # => NoMethodError
//}

Rational オブジェク...

絞り込み条件を変える