# isMultiple(of:), isPower(of:), rounded(\_: toMultipleOf) and rounded(\_: toPowerOf)

**URL:** <https://forums.swift.org/t/ismultiple-of-ispower-of-rounded-tomultipleof-and-rounded-topowerof/32985>\
**Category:** Discussion\
**Created:** [January 24, 2020, 9:02am UTC](https://forums.swift.org/t/ismultiple-of-ispower-of-rounded-tomultipleof-and-rounded-topowerof/32985 "2020-01-24T09:02:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jens](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jens/32/12903_2.png) [@Jens](https://forums.swift.org/u/Jens)\
**Post date:** [January 24, 2020, 9:02am UTC](https://forums.swift.org/t/ismultiple-of-ispower-of-rounded-tomultipleof-and-rounded-topowerof/32985/1 "2020-01-24T09:02:51Z")

</div>

[SE-0225](https://forums.swift.org/t/se-0225-adding-iseven-isodd-ismultiple-to-binaryinteger/15382) added `isMultiple(of:)` to `BinaryInteger`. I'm wondering if this change could be made more complete by discussing eg the following.

- Should `isMultiple(of:)` also be added to `BinaryFloatingPoint`?

- Should `isPower(of:)` be added to `BinaryInteger` and `BinaryFloatingPoint`?  
([Related discussion](https://forums.swift.org/t/adding-ispowerof2-to-binaryinteger/24087))

- Should a family of methods like eg `x.rounded(.towardZero, toMultipleOf: 8)` and `x.rounded(.up, toPowerOf: 2)` be added to `BinaryInteger` and `BinaryFloatingPoint`?  
([Related discussion](https://forums.swift.org/t/rounding-numbers-up-down-to-nearest-multiple-and-power/15547/6))

---

<div class="post-metadata">

**Author:** ![sjavora](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sjavora/32/9323_2.png) [@sjavora](https://forums.swift.org/u/sjavora)\
**Post date:** [January 24, 2020, 10:34am UTC](https://forums.swift.org/t/ismultiple-of-ispower-of-rounded-tomultipleof-and-rounded-topowerof/32985/2 "2020-01-24T10:34:40Z")

</div>

Actually only `isMultiple(of:)` was added as per the announcement thread: [[Accepted with Modifications] SE-0225: Adding isMultiple to BinaryInteger](https://forums.swift.org/t/accepted-with-modifications-se-0225-adding-iseven-isodd-ismultiple-to-binaryinteger/15689)

---

<div class="post-metadata">

**Author:** ![Jens](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jens/32/12903_2.png) [@Jens](https://forums.swift.org/u/Jens)\
**Post date:** [January 24, 2020, 10:35am UTC](https://forums.swift.org/t/ismultiple-of-ispower-of-rounded-tomultipleof-and-rounded-topowerof/32985/3 "2020-01-24T10:35:39Z")

</div>

Oops, thanks! I've edited the original post (removed isEven, isOdd).
