-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] Add isEven
, isOdd
, and isMultiple(of:)
to BinaryInteger
#891
[Proposal] Add isEven
, isOdd
, and isMultiple(of:)
to BinaryInteger
#891
Conversation
# Adding `isEven`, `isOdd`, `isMultiple` to `BinaryInteger` | ||
|
||
* Proposal: [SE-NNNN](NNNN-binaryinteger-iseven-isodd.md) | ||
* Authors: [Robert MacEachern](https://robmaceachern.com), [SiliconUnicorn](https://forums.swift.org/u/siliconunicorn/summary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To follow the pattern used on Swift Evolution, I would like to suggest you to use the GitHub profile url address to link the authors.
e.g:
* Authors: [Robert MacEachern](https://github.com/robmaceachern), [SiliconUnicorn](https://forums.swift.org/u/siliconunicorn/summary)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated mine and have reached out to the other user to get his contact info.
This review will be scheduled to start next Monday, August 20 |
This proposal adds
var isEven: Bool
,var isOdd: Bool
, andfunc isMultiple(of other: Self) -> Bool
to theBinaryInteger
protocol.isEven
andisOdd
are convenience properties for querying the parity of the integer andisMultiple
is a more general function to determine whether an integer is a multiple of another integer.Swift-evolution thread: Even and Odd Integers