RUBY-INTEGER
1 article tagged with "ruby-integer"
- Ruby 教學 6 - Ruby Integer Object, Ruby Float Object 介紹2022-05-28
在 Ruby 中,數字分為兩種 object:Integer 和 Float,分別代表整數和浮點數,兩個 Class 都是從 Numeric object 繼承而來: 1. 宣告 Ruby Integer, Float Object 1.1 Integer 誠如上面提到的,無法用 class.new 宣告新的 object instance,但可以直接在 Integer class 後面接要宣告