るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

キーワード

検索結果

<< < ... 4 5 6 7 8 > >>

Integer#numerator -> Integer (8002.0)

分子(常に自身)を返します。

...分子(常に自身)を返します。

@return 分子を返します。

//emlist[][ruby]{
10.numerator # => 10
-10.numerator # => -10
//}

@see Integer#denominator...

Integer#odd? -> bool (8002.0)

自身が奇数であれば真を返します。 そうでない場合は偽を返します。

自身が奇数であれば真を返します。
そうでない場合は偽を返します。

//emlist[][ruby]{
5.odd? # => true
10.odd? # => false
//}

Integer#ord -> Integer (8002.0)

自身を返します。

自身を返します。

//emlist[][ruby]{
10.ord #=> 10
# String#ord
?a.ord #=> 97
//}

@see String#ord

Integer#pow(other) -> Numeric (8002.0)

算術演算子。冪(べき乗)を計算します。

...に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//...

Integer#pow(other, modulo) -> Integer (8002.0)

算術演算子。冪(べき乗)を計算します。

...に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//...

絞り込み条件を変える

Integer#pred -> Integer (8002.0)

self から -1 した値を返します。

...self から -1 した値を返します。

//emlist[][ruby]{
1.pred #=> 0
(-1).pred #=> -2
//}

@see Integer#next...

Integer#rationalize -> Rational (8002.0)

自身を Rational に変換します。

自身を Rational に変換します。

@param eps 許容する誤差

引数 eps は常に無視されます。

//emlist[][ruby]{
2.rationalize # => (2/1)
2.rationalize(100) # => (2/1)
2.rationalize(0.1) # => (2/1)
//}

Integer#rationalize(eps) -> Rational (8002.0)

自身を Rational に変換します。

自身を Rational に変換します。

@param eps 許容する誤差

引数 eps は常に無視されます。

//emlist[][ruby]{
2.rationalize # => (2/1)
2.rationalize(100) # => (2/1)
2.rationalize(0.1) # => (2/1)
//}

Integer#remainder(other) -> Numeric (8002.0)

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

.../emlist[][ruby]{
5.remainder(3) # => 2
-5.remainder(3) # => -2
5.remainder(-3) # => 2
-5.remainder(-3) # => -2

-1234567890987654321.remainder(13731) # => -6966
-1234567890987654321.remainder(13731.24) # => -9906.22531493148
//}

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

Integer#round(ndigits = 0, half: :up) -> Integer (8002.0)

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

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

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。
@param half ちょうど半分の値の丸め方を指定します。
サポートされている値は以下の通りです。

* :up or nil: 0から遠い方に丸められます。
* :even: もっとも近い偶数に丸められます。
* :down: 0に近い方に丸められます。

//emlist[][ruby]{
1.round # =...

絞り込み条件を変える

<< < ... 4 5 6 7 8 > >>