I like isMultiple(of:)
.
(Should it be available for both integer and floating point types btw?)
If it's added to the std lib, then perhaps we would also want
isPower(of:)
And, as it says in this Wikipedia article:
it is common in computing to need to round a number to a whole power of 2
So we might also want
rounded(.up/.down/…, toNearesMultipleOf:)
and
rounded(.up/.down/…, toNearestPowerOf:)
etc
Sorry for getting a bit off-topic, but would it make sense to treat a set of related methods like these (for multiples and powers) together as a single proposal?