Add floor divisions operator#6891
Conversation
|
Trying to format struct Int
def //
end
endgives a bug: I think |
|
Yes this is still WIP or blocked do to the formatted. I will check if that is enough. I’m not that familiar with the formatter still. Since parser and formatter use the lexer with its own control fow the state of the lexer evolves differently for the same input and is hard to keep them aligned i think. |
5d48f5e to
7eedaf0
Compare
|
Rebased on to master. Ready for another review (while waiting for CI) |
asterite
left a comment
There was a problem hiding this comment.
I think some tests are missing for floats that aren't exactly integers. For example 7.5 // 2.1 and such.
|
@asterite done |
|
Can we add a |
Adds semantics to the
//operator as integer division / floor division.a // bwill represent the mathematical value ⌊a ÷ b⌋ and be of the same type asa. This is consistent with other arithmetic operators (lhs operand type is preserved).Follow up of #6470 as part of #2968.
After next release
/will be able to be changed to float division for all types and use//where floor or integer division is needed.