BinaryInteger
protocol BinaryInteger : CustomStringConvertible, Hashable, Numeric, Strideable where Self.Magnitude : BinaryInteger, Self.Magnitude == Self.Magnitude.Magnitude
-
Mechanica
Determine if self is even (equivalent to
self % 2 == 0or toisMultiple(of: 2)).Declaration
Swift
public var isEven: Bool { get } -
Mechanica
Determine if self is odd (equivalent to
self % 2 != 0or toisMultiple(of: 2)negated).Declaration
Swift
public var isOdd: Bool { get }
BinaryInteger Extension Reference