るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Numeric#i -> Complex (18275.0)

Complex(0, self) を返します。

...Complex(0, self) を返します。

ただし、Complex オブジェクトでは利用できません。

//emlist[例][ruby]{
10.i # => (0+10i)
-
10.i # => (0-10i)
(0.1).i # => (0+0.1i)
Rational(1, 2).i # => (0+(1/2)*i)
//}...

Numeric#infinite? -> nil (9330.0)

常に nil を返します。 自身が Float かComplex、もしくはそのサブクラスのインスタンスの場合は、self の絶対値が負の無限大の場合に-1を、正の無限大の場合に1を、有限値の場合に nil を返します。

...il を返します。
自身が Float かComplex、もしくはそのサブクラスのインスタンスの場合は、self の絶対値が負の無限大の場合に-1を、正の無限大の場合に1を、有限値の場合に nil を返します。

//emlist[例][ruby]{
10.infinite? # => ni...
...l
(3r).infinite? # => nil
//}

@see Numeric#finite?、Float#infinite?、Complex#infinite?...

Numeric#to_int -> Integer (6336.0)

self.to_i と同じです。

...self.to_i と同じです。

//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//}...

Numeric#fdiv(other) -> Float | Complex (6232.0)

self を other で割った商を Float で返します。 ただし Complex が関わる場合は例外です。 その場合も成分は Float になります。

...

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

@param other 自身を割る数を指定します。

//emlist[例][ruby]{
1.fdiv(3) #=> 0.3333333333333333
Complex(1, 1).fdiv 1 #=> (1.0+1.0i)
1.fdiv Complex(1, 1) #=> (0.5-0.5i)
/...
.../}

@see Numeric#quo...

Numeric#remainder(other) -> Numeric (6232.0)

self を other で割った余り r を返します。

... -|other| < r <= 0
* q は整数

をみたす数です。r の符号は self と同じになります。
商 q を直接返すメソッドはありません。self.quo(other).truncate がそれに相当します。

@param other 自身を割る数を指定します。

//emlist[例][ruby]{
p 1...
...3.remainder(4) #=> 1
p (11.5).remainder(3.5) #=> 1.0
p 13.remainder(-4) #=> 1
p (-13).remainder(4) #=> -1
p (-13).remainder(-4) #=> -1
p (-11).remainder(3.5) #=> -0.5
//}

@see Numeric#divmod, Numeric#modulo...

絞り込み条件を変える

Numeric#ceil -> Integer (6226.0)

自身と等しいかより大きな整数のうち最小のものを返します。

...自身と等しいかより大きな整数のうち最小のものを返します。

//emlist[例][ruby]{
1.ceil #=> 1
1.2.ceil #=> 2
(-1.2).ceil #=> -1
(-1.5).ceil #=> -1
//}

@see Numeric#floor, Numeric#round, Numeric#truncate...

Numeric#div(other) -> Integer (6226.0)

self を other で割った整数の商 q を返します。

...りは Numeric#modulo で求められます。
div はメソッド / を呼びだし、floorを取ることで計算されます。

メソッド / の定義はサブクラスごとの定義を用います。

@param other 自身を割る数を指定します。

//emlist[例][ruby]{
p 3.div(2) # =>...
...1
p (-3).div(2) # => -2
p (-3.0).div(2) # => -2
//}...

Numeric#imag -> 0 (6226.0)

常に 0 を返します。

...常に 0 を返します。

//emlist[例][ruby]{
12.imag # => 0
-
12.imag # => 0
1.2.imag # => 0
-
1.2.imag # => 0
//}

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

@see Numeric#real、Complex#imag...

Numeric#imaginary -> 0 (6226.0)

常に 0 を返します。

...常に 0 を返します。

//emlist[例][ruby]{
12.imag # => 0
-
12.imag # => 0
1.2.imag # => 0
-
1.2.imag # => 0
//}

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

@see Numeric#real、Complex#imag...
<< 1 2 3 ... > >>