るりまサーチ (Ruby 2.4.0)

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

別のキーワード

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

検索結果

Numeric#truncate -> Integer (18310.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...