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

SE-0225 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)

  • 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)

3 Likes

Actually only isMultiple(of:) was added as per the announcement thread: [Accepted with Modifications] SE-0225: Adding isMultiple to BinaryInteger

1 Like

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

Terms of Service

Privacy Policy

Cookie Policy