SignedInteger
An integer type that can represent both positive and negative values.
protocol SignedInteger : BinaryInteger, SignedNumeric
Browse conforming typesAn integer type that can represent both positive and negative values.
protocol SignedInteger : BinaryInteger, SignedNumeric
import Swift
protocol BinaryInteger : CustomStringConvertible, Hashable, Numeric, Strideable where Self.Magnitude : BinaryInteger, Self.Magnitude == Self.Magnitude.Magnitude
An integer type with a binary representation.
protocol SignedNumeric : Numeric
A numeric type with a negation operation.
protocol AdditiveArithmetic : Equatable
A type with values that support addition and subtraction.
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol ExpressibleByIntegerLiteral
A type that can be initialized with an integer literal.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Numeric : AdditiveArithmetic, ExpressibleByIntegerLiteral
A type with values that support multiplication.
protocol Strideable<Stride> : Comparable
A type representing continuous, one-dimensional values that can be offset and measured.
static var isSigned: Bool { get }
A Boolean value indicating whether this type is a signed integer type.
protocol FixedWidthInteger : BinaryInteger, LosslessStringConvertible where Self.Magnitude : FixedWidthInteger, Self.Magnitude : UnsignedInteger, Self.Stride : FixedWidthInteger, Self.Stride : SignedInteger
An integer type that uses a fixed size for every instance.
init<T>(_ source: T) where T : BinaryInteger
Creates a new instance from the given integer.
init?<T>(exactly source: T) where T : BinaryInteger
Creates a new instance from the given integer, if it can be represented exactly.
static var max: Self { get }
The maximum representable integer in this type.
static var min: Self { get }
The minimum representable integer in this type.
func dividingFullWidth(_ dividend: (high: Self, low: Self.Magnitude)) -> (quotient: Self, remainder: Self)
func isMultiple(of other: Self) -> Bool