Bit

enum Bit

A RandomAccessIndexType that has two possible values. Used as the Index type for CollectionOfOne<T>.

Deprecated: Bit is deprecated as of Swift 3. Use Int instead..

Inheritance BidirectionalIndexType, Comparable, Equatable, ForwardIndexType, Int, IntegerArithmeticType, RandomAccessIndexType, Strideable, _Incrementable, _IntegerArithmeticType, _RandomAccessAmbiguity, _Reflectable View Protocol Hierarchy →
Associated Types
Distance = Int
Import import Swift

Cases

Static Methods

static func addWithOverflow(_:_:)

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)
static func divideWithOverflow(_:_:)

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)
static func multiplyWithOverflow(_:_:)

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)
static func remainderWithOverflow(_:_:)

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)
static func subtractWithOverflow(_:_:)

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

func advancedBy(_:)

Declaration

func advancedBy(n: Distance) -> Bit

Declared In

Bit, BidirectionalIndexType, _RandomAccessAmbiguity, ForwardIndexType
func advancedBy(_:limit:)

Declaration

func advancedBy(n: Bit.Distance, limit: Bit) -> Bit

Declared In

RandomAccessIndexType, BidirectionalIndexType, ForwardIndexType
func distanceTo(_:)

Declaration

func distanceTo(other: Bit) -> Int

Declared In

Bit, BidirectionalIndexType, ForwardIndexType
func predecessor()

Returns the previous consecutive value before self.

Requires: self != .Zero.

Declaration

func predecessor() -> Bit
func stride(through:by:)

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
func stride(to:by:)

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
func successor()

Returns the next consecutive value after self.

Requires: self == .Zero.

Declaration

func successor() -> Bit
func toIntMax()

Represent this number using Swift's widest native signed integer type.

Declaration

func toIntMax() -> IntMax