Closed jutaro closed 8 years ago
This has been raised a few times, but there are a few problems doing this:
(%)
intentionally operates on Numbers
, as it's the only way to get modulo behaviour for non-Int
s. You can already do this with mod
for Int
.Int
for the others restricts the acceptable values they can operate on to the range of Int32
, significantly smaller than the range of integers that Number
can safely represent.Also 0.5 % 0.7
does not produce an Int
, so the type isn't right for that either :smile:
We should probably document those functions to explain the types :)
Maybe these belong in -integers
?
Yeah, that would make sense.
We have floor
, ceil
, and round
with the types @jutaro wanted in integers
now, so I think this can be closed.
Seems obvious to me.