Structure

Int8

An 8-bit signed integer value type.

Topics

Initializers

init(Double)

Creates an integer from the given floating-point value, rounding toward zero.

init(Float80)

Creates an integer from the given floating-point value, rounding toward zero.

init(Float)

Creates an integer from the given floating-point value, rounding toward zero.

init(NSNumber)Deprecated
init?(String)

Creates a new integer value from the given string.

init?<S>(S, radix: Int)

Creates a new integer value from the given string and radix.

init(bitPattern: UInt8)

Creates a new instance with the same memory representation as the given value.

init<Other>(clamping: Other)

Creates a new instance with the representable value that’s closest to the given integer.

init?(exactly: Double)

Creates an integer from the given floating-point value, if it can be represented exactly.

init?(exactly: Float)

Creates an integer from the given floating-point value, if it can be represented exactly.

init?(exactly: Float80)

Creates an integer from the given floating-point value, if it can be represented exactly.

init?<T>(exactly: T)

Creates an integer from the given floating-point value, if it can be represented exactly.

init?<T>(exactly: T)

Creates a new instance from the given integer, if it can be represented exactly.

init<T>(truncatingIfNeeded: T)

Creates a new instance from the bit pattern of the given instance by sign-extending or truncating to fit this type.

Instance Properties

var bitWidth: Int

The number of bits in the binary representation of this value.

var byteSwapped: Int8

A representation of this integer with the byte order swapped.

var customMirror: Mirror

A mirror that reflects the Int8 instance.

var description: String

A textual representation of this value.

var hashValue: Int

The integer’s hash value.

var leadingZeroBitCount: Int

The number of leading zeros in this value’s binary representation.

var magnitude: UInt8

The magnitude of this value.

var nonzeroBitCount: Int

The number of bits equal to 1 in this value’s binary representation.

var trailingZeroBitCount: Int

The number of trailing zeros in this value’s binary representation.

var words: Int8.Words

A collection containing the words of this value’s binary representation, in order from the least significant to most significant.

Type Properties

static var bitWidth: Int

The number of bits used for the underlying binary representation of values of this type.

static var isSigned: Bool

A Boolean value indicating whether this type is a signed integer type.

static var max: Int8

The maximum representable integer in this type.

static var min: Int8

The minimum representable integer in this type.

Instance Methods

func addingReportingOverflow(Int8)

Returns the sum of this value and the given value along with a flag indicating whether overflow occurred in the operation.

func dividedReportingOverflow(by: Int8)

Returns the quotient of dividing this value by the given value along with a flag indicating whether overflow occurred in the operation.

func multipliedReportingOverflow(by: Int8)

Returns the product of this value and the given value along with a flag indicating whether overflow occurred in the operation.

func negate()

Replaces this value with its additive inverse.

func remainderReportingOverflow(dividingBy: Int8)

Returns the remainder of dividing this value by the given value along with a flag indicating whether overflow occurred in the operation.

func signum()

Returns -1 if this value is negative and 1 if it’s positive; otherwise, 0.

func subtractingReportingOverflow(Int8)

Returns the difference of this value and the given value along with a flag indicating whether overflow occurred in the operation.

func unsafeAdding(Int8)

Returns the sum of this value and the given value without checking for arithmetic overflow.

func unsafeDivided(by: Int8)

Returns the quotient of dividing this value by the given value without checking for arithmetic overflow.

func unsafeMultiplied(by: Int8)

Returns the product of this value and the given value without checking for arithmetic overflow.

func unsafeSubtracting(Int8)

Returns the difference of this value and the given value without checking for arithmetic overflow.

Operator Functions

static func !=(Int8, Int8)

Returns a Boolean value indicating whether two values are not equal.

static func !=<Other>(Int8, Other)

Returns a Boolean value indicating whether the two given values are not equal.

static func %(Int8, Int8)

Returns the remainder of dividing the first value by the second.

static func %=(inout Int8, Int8)

Divides the first value by the second and stores the remainder in the left-hand-side variable.

static func &(Int8, Int8)

Returns the result of performing a bitwise AND operation on the two given values.

static func &(Int8, Int8)

Returns the result of performing a bitwise AND operation on the two given values.

static func &*(Int8, Int8)

Returns the product of the two given values, discarding any overflow.

static func &+(Int8, Int8)

Returns the sum of the two given values, discarding any overflow.

static func &-(Int8, Int8)

Returns the difference of the two given values, discarding any overflow.

static func &<<<Other>(Int8, Other)

Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width.

static func &<<(Int8, Int8)

Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width.

static func &<<(Int8, Int8)

Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width.

static func &<<=<Other>(inout Int8, Other)

Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width, and stores the result in the left-hand-side variable.

static func &<<=(inout Int8, Int8)

Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width, and stores the result in the left-hand-side variable.

static func &=(inout Int8, Int8)

Stores the result of performing a bitwise AND operation on the two given values in the left-hand-side variable.

static func &>>(Int8, Int8)

Returns the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width.

static func &>><Other>(Int8, Other)

Returns the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width.

static func &>>(Int8, Int8)

Returns the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width.

static func &>>=(inout Int8, Int8)

Calculates the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width, and stores the result in the left-hand-side variable.

static func &>>=<Other>(inout Int8, Other)

Calculates the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width, and stores the result in the left-hand-side variable.

static func *(Int8, Int8)

Multiplies two values and produces their product.

static func *=(inout Int8, Int8)

Multiplies two values and stores the result in the left-hand-side variable.

static func +(Int8)

Returns the given number unchanged.

static func +(Int8, Int8)

Adds two values and produces their sum.

static func +=(inout Int8, Int8)

Adds two values and stores the result in the left-hand-side variable.

static func -(Int8)

Returns the additive inverse of the specified value.

static func -(Int8, Int8)

Subtracts one value from another and produces their difference.

static func -=(inout Int8, Int8)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

static func ...(Int8)

Returns a partial range up to, and including, its upper bound.

static func ...(Int8)

Returns a partial range extending upward from a lower bound.

static func ...(Int8)

Returns a countable partial range extending upward from a lower bound.

static func ..<(Int8)

Returns a partial range up to, but not including, its upper bound.

static func /(Int8, Int8)

Returns the quotient of dividing the first value by the second.

static func /=(inout Int8, Int8)

Divides the first value by the second and stores the quotient in the left-hand-side variable.

static func <<Other>(Int8, Other)

Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.

static func <<<Other>(Int8, Other)

Returns the result of shifting a value’s binary representation the specified number of digits to the left.

static func <<<RHS>(Int8, RHS)

Returns the result of shifting a value’s binary representation the specified number of digits to the left.

static func <=<Other>(Int8, Other)

Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.

static func <=(Int8, Int8)

Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.

static func ==<Other>(Int8, Other)

Returns a Boolean value indicating whether the two given values are equal.

static func >(Int8, Int8)

Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.

static func ><Other>(Int8, Other)

Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.

static func >=(Int8, Int8)

Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.

static func >=<Other>(Int8, Other)

Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.

static func >><Other>(Int8, Other)

Returns the result of shifting a value’s binary representation the specified number of digits to the right.

static func >><RHS>(Int8, RHS)

Returns the result of shifting a value’s binary representation the specified number of digits to the right.

static func ^(Int8, Int8)

Returns the result of performing a bitwise XOR operation on the two given values.

static func ^(Int8, Int8)

Returns the result of performing a bitwise XOR operation on the two given values.

static func ^=(inout Int8, Int8)

Stores the result of performing a bitwise XOR operation on the two given values in the left-hand-side variable.

static func |(Int8, Int8)

Returns the result of performing a bitwise OR operation on the two given values.

static func |(Int8, Int8)

Returns the result of performing a bitwise OR operation on the two given values.

static func |=(inout Int8, Int8)

Stores the result of performing a bitwise OR operation on the two given values in the left-hand-side variable.

static func ~(Int8)

Returns the inverse of the bits set in the argument.

See Also

Signed Integers

struct Int16

A 16-bit signed integer value type.

struct Int32

A 32-bit signed integer value type.

struct Int64

A 64-bit signed integer value type.