Integer divide is a float?

Is this expected?

$ crystal eval "puts 3.0//4.0"
0.0 # a float?

Just wondering.

Yes

2 Likes

The motivation is that / is arithmetic division. And // is floor division. The latest when applied to integers is the only one leads always to integers, hence their type.