55件ヒット
[1-55件を表示]
(0.063秒)
種類
- インスタンスメソッド (44)
- 定数 (11)
モジュール
-
File
:: Constants (11)
検索結果
先頭5件
-
Integer
# truncate(ndigits = 0) -> Integer | Float (35209.0) -
0 から self までの整数で、自身にもっとも近い整数を返します。
...定した場合、Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1.0
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}
@see Numeric#truncate... -
Integer
# truncate(ndigits = 0) -> Integer (35203.0) -
0 から self までの整数で、自身にもっとも近い整数を返します。
...します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}
@see Numeric#truncate... -
File
:: Constants :: TRUNC -> Integer (26204.0) -
もしファイルが存在するなら、中身を抹消してサイズをゼロにします。 File.openで使用します。
もしファイルが存在するなら、中身を抹消してサイズをゼロにします。
File.openで使用します。 -
Numeric
# truncate -> Integer (14203.0) -
0 から 自身までの整数で、自身にもっとも近い整数を返します。
...0 から 自身までの整数で、自身にもっとも近い整数を返します。
//emlist[例][ruby]{
1.truncate #=> 1
1.2.truncate #=> 1
(-1.2).truncate #=> -1
(-1.5).truncate #=> -1
//}
@see Numeric#ceil, Numeric#floor, Numeric#round... -
Float
# truncate(ndigits = 0) -> Integer | Float (11210.0) -
小数点以下を切り捨てて値を整数に変換します。
...数を指定した場合、Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
1.234567.truncate(2) # => 1.23
34567.89.truncate(-2) # => 34500
//}
@se... -
Float
# truncate -> Integer (11204.0) -
小数点以下を切り捨てて値を整数に変換します。
...小数点以下を切り捨てて値を整数に変換します。
//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
//}
@see Numeric#round, Numeric#ceil, Numeric#floor... -
Rational
# truncate(precision = 0) -> Rational | Integer (11204.0) -
小数点以下を切り捨てて値を整数に変換します。
...Rational を返します。
//emlist[例][ruby]{
Rational('-123.456').truncate(+1) # => (-617/5)
Rational('-123.456').truncate(+1).to_f # => -123.4
Rational('-123.456').truncate(0) # => -123
Rational('-123.456').truncate(-1) # => -120
//}
@see Rational#ceil, Rational#floor...