るりまサーチ (Ruby 3.0)

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. module >
  4. float >
  5. complex >

ライブラリ

検索結果

Numeric#to_int -> Integer (54661.0)

self.to_i と同じです。

self.to_i と同じです。

//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//}