るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. _builtin float
  2. float to_d
  3. json float
  4. float rationalize
  5. fiddle type_float

ライブラリ

検索結果

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

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

...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...