Skip to content

ruby-units changes behavior of Fixnum calculations #153

@MartinKoerner

Description

@MartinKoerner

IRB session without ruby-unit in Gemfile:

irb(main):001:0>  4/3 # => 1
irb(main):002:0>  (4/3).class # => Fixnum

IRB session with ruby-unit in Gemfile:

irb(main):001:0>  4/3 # => (4/3)
irb(main):002:0>  (4/3).class # => Rational

Of course, I can just call (4/3).to_i to get the old result, but I think, introducing the gem to an existing project should not require changes to unrelated code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions