From: se8.and@... Date: 2018-07-21T12:49:23+00:00 Subject: [ruby-core:88041] [Ruby trunk Feature#14924] // floor division operator Issue #14924 has been updated by deneb (S��bastien Durand). ~~~ text I think it may be subjective, 99 % of the time I do want integer ~~~ Out of curiosity what are you doing that needs integer division? :) Still I think that 99% of people expect that when you divide 3 / 2 you get 1.5 (it's like that in every calculators in the world). 3 / 2 == 1 is against the principle of least surprise, but hey I understand that we can't change that anymore in Ruby. :) ---------------------------------------- Feature #14924: // floor division operator https://bugs.ruby-lang.org/issues/14924#change-73057 * Author: deneb (S��bastien Durand) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Hello! In my job, I have to do many math operations. And it's kind of a pain because of integer division (3 / 2 == 1). I have to constantly cast integers to floats. Would it be a good idea to always return a float when you divide two numbers? I mean, 99% of the time you just want that. (The principle of least surprise.) Python is doing that just right: ~~~ python 3 / 2 == 1.5 3 // 2 == 1 ~~~ http://python-reference.readthedocs.io/en/latest/docs/operators/floor_division.html I don't know if it's too much of a breaking change though? Maybe for Ruby3x3? Thanks. -- https://bugs.ruby-lang.org/ Unsubscribe: