るりまサーチ

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.122秒)
トップページ > クエリ:float[x] > クエリ:E[x] > クエリ:truncate[x] > クエリ:ceil[x] > クラス:Numeric[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. open3 capture2e
  4. matrix rank_e
  5. matrix det_e

ライブラリ

検索結果

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

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

...指定した場合、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...