• KOBAYASHI Shuji's avatar
    Always add trailing `.0` in `Float#inspect`; ref #4225 · 8bd1bc47
    KOBAYASHI Shuji authored
    Trailing `.0` is removed from `Float#to_s` and `Float#inspect` at
    9d08025b. However, I think the more human-readable format is better
    for `Float#inspect`.
    
    For example, in the `Float#to_s` format, the failure message is not
    well understood when testing values including types by `eql?` (e.g.
    `Numeric#step` test).
    
      ```ruby
      assert "example" do
        exp = 1.0
        act = 1
        assert_operator(exp, :eql?, act)  #=> Expected 1 to be eql? 1.
      end
      ```
    8bd1bc47
float.rb 5.9 KB