るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.030秒)
トップページ > バージョン:2.6.0[x] > クエリ:Integer[x] > クエリ:*[x] > 種類:クラス[x]

別のキーワード

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

ライブラリ

キーワード

検索結果

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

Fiddle::CStruct (40.0)

C の構造体を表すクラスです。

C の構造体を表すクラスです。

このクラスは直接は使わず、Fiddle::Importer#struct を用いて
このクラスを継承したクラスを生成し、それを利用します。

Fiddle::Importer#struct が生成するクラスには
構造体の各メンバへのアクセサが定義されています。
このアクセサはシグネチャの型とメンバ名に従って定義されます。
例えば
require 'fiddle/import'
include Fiddle::Importer
S = struct(["long foo", "void* bar"])
とすると、 S#foo, S#foo= という...

Rational (40.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 オブジェク...