ライブラリ
- ビルトイン (208)
- bigdecimal (180)
-
irb
/ cmd / subirb (24) - matrix (36)
- nkf (12)
- socket (24)
クラス
- BigDecimal (180)
- Float (76)
-
IRB
:: ExtendCommand :: Foreground (12) - Integer (12)
- Matrix (36)
- Numeric (48)
- Rational (36)
- Socket (12)
- Time (24)
モジュール
-
Socket
:: Constants (12)
キーワード
- Foreground (12)
-
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) - NKF (12)
- Numeric (12)
- ROUNDS (7)
-
ROUND
_ CEILING (12) -
ROUND
_ DOWN (12) -
ROUND
_ FLOOR (12) -
ROUND
_ HALF _ DOWN (12) -
ROUND
_ HALF _ EVEN (12) -
ROUND
_ HALF _ UP (12) -
ROUND
_ MODE (12) -
ROUND
_ UP (12) -
SOPRI
_ BACKGROUND (24) - bigdecimal (12)
- ceil (42)
- eigen (12)
- eigensystem (12)
- execute (12)
- floor (42)
- limit (12)
- mode (24)
-
save
_ rounding _ mode (12) -
to
_ i (12) - truncate (24)
検索結果
先頭3件
-
Rational
# floor(precision = 0) -> Integer | Rational (6.0) -
自身と等しいかより小さな整数のうち最大のものを返します。
...onal を返します。
//emlist[例][ruby]{
Rational('-123.456').floor(+1) # => (-247/2)
Rational('-123.456').floor(+1).to_f # => -123.5
Rational('-123.456').floor(0) # => -124
Rational('-123.456').floor(-1) # => -130
//}
@see Rational#ceil, Rational#round, Rational#truncate... -
Time
# ceil(ndigits=0) -> Time (6.0) -
十進小数点数で指定した桁数の精度で切り上げをし、 その Time オブジェクトを返します。 (デフォルトは0、つまり小数点の所で切り上げます)。
...# => "2000-01-01T00:00:00.000Z"
(t + 1.4).ceil.iso8601(3) # => "2000-01-01T00:00:01.000Z"
(t + 1.9).ceil.iso8601(3) # => "2000-01-01T00:00:01.000Z"
t = Time.utc(1999,12,31, 23,59,59)
(t + 0.123456789).ceil(4).iso8601(6) # => "1999-12-31T23:59:59.123500Z"
//}
@see Time#floor, Time#round... -
Time
# floor(ndigits=0) -> Time (6.0) -
十進小数点数で指定した桁数の精度で切り捨てをし、 その Time オブジェクトを返します。 (デフォルトは0、つまり小数点の所で切り捨てます)。
...# => "1999-12-31T23:59:59.000Z"
(t + 1.4).floor.iso8601(3) # => "2000-01-01T00:00:00.000Z"
(t + 1.9).floor.iso8601(3) # => "2000-01-01T00:00:00.000Z"
t = Time.utc(1999,12,31, 23,59,59)
(t + 0.123456789).floor(4).iso8601(6) # => "1999-12-31T23:59:59.123400Z"
//}
@see Time#ceil, Time#round...