るりまサーチ

最速Rubyリファレンスマニュアル検索!
21件ヒット [1-21件を表示] (0.136秒)
トップページ > クエリ:t[x] > クエリ:param[x] > 種類:インスタンスメソッド[x] > クエリ:ruby[x] > クエリ:-[x] > クラス:Numeric[x] > クエリ:floor[x]

別のキーワード

  1. net/imap param
  2. win32ole win32ole_param
  3. win32ole_param to_s
  4. bodytypetext param
  5. bodytypebasic param

ライブラリ

検索結果

Numeric#floor(ndigits = 0) -> Integer (18357.0)

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

...@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。

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

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

Numeric#floor(ndigits = 0) -> Integer | Float (18357.0)

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

...す。

@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を...
...返します。
小数点位置から左に少なくとも n 個の 0 が並びます。

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

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

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

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

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

ここで、商 q と余り r は、それぞれ

* self == other * q + r

* other > 0 のとき: 0 <= r < other
* other < 0 のとき: other < r <= 0
* q は整数
をみたす数です。
商に対応する余りは Numeric#...
...メソッド / を呼びだし、floorを取ることで計算されます。

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

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

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