2件ヒット
[1-2件を表示]
(0.232秒)
別のキーワード
ライブラリ
- ビルトイン (2)
検索結果
-
Numeric
# floor(ndigits = 0) -> Integer | Float (54418.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... -
Numeric
# div(other) -> Integer (43.0) -
self を other で割った整数の商 q を返します。
...> 0 のとき: 0 <= r < other
* other < 0 のとき: other < r <= 0
* q は整数
をみたす数です。
商に対応する余りは Numeric#modulo で求められます。
div はメソッド / を呼びだし、floorを取ることで計算されます。
メソッド / の定義は...