るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.026秒)
トップページ > ライブラリ:ビルトイン[x] > クエリ:TRUNC[x] > バージョン:2.2.0[x] > クラス:Float[x]

別のキーワード

  1. socket msg_trunc
  2. fcntl o_trunc
  3. etc pc_no_trunc
  4. _builtin trunc
  5. constants trunc

検索結果

Float#truncate -> Integer (9310.0)

小数点以下を切り捨てて値を整数に変換します。

小数点以下を切り捨てて値を整数に変換します。


//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
//}

@see Numeric#round, Numeric#ceil, Numeric#floor