enum Bit
Inheritance |
BidirectionalIndexType, Comparable, Equatable, ForwardIndexType, Int, IntegerArithmeticType, RandomAccessIndexType, Strideable, _Incrementable, _IntegerArithmeticType, _RandomAccessAmbiguity, _Reflectable
View Protocol Hierarchy →
|
---|---|
Associated Types | |
Import | import Swift |
Cases
Static Methods
Add lhs
and rhs
, returning a result and a Bool
that is
true
iff the operation caused an arithmetic overflow.
Declaration
static func addWithOverflow(lhs: Bit, _ rhs: Bit) -> (Bit, overflow: Bool)
Divide lhs
and rhs
, returning a result and a Bool
that is
true
iff the operation caused an arithmetic overflow.
Declaration
static func divideWithOverflow(lhs: Bit, _ rhs: Bit) -> (Bit, overflow: Bool)
Multiply lhs
and rhs
, returning a result and a Bool
that is
true
iff the operation caused an arithmetic overflow.
Declaration
static func multiplyWithOverflow(lhs: Bit, _ rhs: Bit) -> (Bit, overflow: Bool)
Divide lhs
and rhs
, returning the remainder and a Bool
that is
true
iff the operation caused an arithmetic overflow.
Declaration
static func remainderWithOverflow(lhs: Bit, _ rhs: Bit) -> (Bit, overflow: Bool)
Subtract lhs
and rhs
, returning a result and a Bool
that is
true
iff the operation caused an arithmetic overflow.
Declaration
static func subtractWithOverflow(lhs: Bit, _ rhs: Bit) -> (Bit, overflow: Bool)
Instance Methods
Declaration
func advancedBy(n: Distance) -> Bit
Declared In
Bit
, BidirectionalIndexType
, _RandomAccessAmbiguity
, ForwardIndexType
Declaration
func advancedBy(n: Bit.Distance, limit: Bit) -> Bit
Declared In
RandomAccessIndexType
, BidirectionalIndexType
, ForwardIndexType
Declaration
func distanceTo(other: Bit) -> Int
Declared In
Bit
, BidirectionalIndexType
, ForwardIndexType
Returns the previous consecutive value before self
.
Requires: self != .Zero
.
Declaration
func predecessor() -> Bit
Returns the sequence of values (self
, self + stride
, self +
stride + stride
, ... last) where last is the last value in
the progression less than or equal to end
.
Note: There is no guarantee that end
is an element of the sequence.
Declaration
func stride(through end: Bit, by stride: Bit.Stride) -> StrideThrough<Bit>
Declared In
Strideable
Returns the sequence of values (self
, self + stride
, self +
stride + stride
, ... last) where last is the last value in
the progression that is less than end
.
Declaration
func stride(to end: Bit, by stride: Bit.Stride) -> StrideTo<Bit>
Declared In
Strideable
Returns the next consecutive value after self
.
Requires: self == .Zero
.
Declaration
func successor() -> Bit
Represent this number using Swift's widest native signed integer type.
Declaration
func toIntMax() -> IntMax
A
RandomAccessIndexType
that has two possible values. Used as theIndex
type forCollectionOfOne<T>
.Deprecated: Bit is deprecated as of Swift 3. Use Int instead..