るりまサーチ

最速Rubyリファレンスマニュアル検索!
2036件ヒット [201-300件を表示] (0.033秒)
トップページ > クエリ:numeric[x]

別のキーワード

  1. numeric step
  2. _builtin numeric
  3. numeric %
  4. numeric i
  5. numeric +@

ライブラリ

モジュール

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

Numeric#round -> Integer (9018.0)

自身ともっとも近い整数を返します。

...0.5, -0.5 はそれぞれ 1,-1 に切り上げされます。いわゆる四捨五入ですが、偶数丸めではありません。

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

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

Numeric#truncate -> Integer (9018.0)

0 から 自身までの整数で、自身にもっとも近い整数を返します。

...0 から 自身までの整数で、自身にもっとも近い整数を返します。

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

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

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

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

...割った商を 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#finite? -> bool (9012.0)

self の絶対値が有限値の場合に true を、そうでない場合に false を返します。

...値の場合に true を、そうでない場合に false を返します。

//emlist[例][ruby]{
10.finite? # => true
Rational(3).finite? # => true

Float::INFINITY.finite? # => false
Float::INFINITY.is_a?(Numeric) # => true
//}

@see Numeric#infinite?...

Numeric#imag -> 0 (9012.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 (9012.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#integer? -> bool (9012.0)

自身が Integer かそのサブクラスのインスタンスの場合にtrue を返し ます。そうでない場合に false を返します。

...スタンスの場合にtrue を返し
ます。そうでない場合に false を返します。

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

//emlist[例][ruby]{
(1.0).integer? #=> false
(1).integer? #=> true
//}

@see Numeric#real?...

Numeric#real? -> bool (9012.0)

常に true を返します。(Complex またはそのサブクラスではないことを意味します。)

...ます。)

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

//emlist[例][ruby]{
10.real? # => true
-10.real? # => true
0.1.real? # => true
Rational(2, 3).real? # => true
//}

@see Numeric#integer?、...

Numeric#<=>(other) -> -1 | 0 | 1 | nil (9006.0)

自身が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。 自身と other が比較できない場合には nil を返します。

...場合に 0 を、小さい場合には -1 をそれぞれ返します。
自身と other が比較できない場合には nil を返します。

Numeric
のサブクラスは、上の動作を満たすよう このメソッドを適切に再定義しなければなりません。

@param other...

Numeric#angle -> 0 | Math::PI (9006.0)

自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}

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

@see Complex#arg...

絞り込み条件を変える

<< < 1 2 3 4 5 ... > >>