struct
Int32
Inheritance |
BidirectionalIndexType, BitwiseOperationsType, CVarArgType, Comparable, CustomStringConvertible, Equatable, ForwardIndexType, Hashable, IntegerArithmeticType, IntegerLiteralConvertible, IntegerType, RandomAccessIndexType, SignedIntegerType, SignedNumberType, Strideable, _Incrementable, _IntegerArithmeticType, _IntegerType, _RandomAccessAmbiguity, _Reflectable, _SignedIntegerType
View Protocol Hierarchy →
|
---|---|
Associated Types |
A type that can represent the number of steps between pairs of values. |
Import |
|
Initializers
Create an instance initialized to zero.
Declaration
init
()
Declaration
init
(
_
v
:
Int
)
Declaration
init
(
_
v
:
Int8
)
Declaration
init
(
_
v
:
Int16
)
Declaration
init
(
_
v
:
Int64
)
Declaration
init
(
_
v
:
UInt
)
Declaration
init
(
_
v
:
UInt8
)
Declaration
init
(
_
v
:
UInt16
)
Declaration
init
(
_
v
:
UInt32
)
Declaration
init
(
_
v
:
UInt64
)
Declaration
init
(
_builtinIntegerLiteral
value
:
Builtin
.
Int2048
)
Creates an integer from its big-endian representation, changing the byte order if necessary.
Declaration
init
(
bigEndian
value
:
Int32
)
Construct a Int32
having the same memory representation as
the UInt32
bitPattern
. No range or overflow checking
occurs, and the resulting Int32
may not have the same numeric
value as bitPattern
--it is only guaranteed to use the same
pattern of bits.
Declaration
init
(
bitPattern
:
UInt32
)
Creates an integer from its little-endian representation, changing the byte order if necessary.
Declaration
init
(
littleEndian
value
:
Int32
)
Construct a Int32
having the same bitwise representation as
the least significant bits of the provided bit pattern.
No range or overflow checking occurs.
Declaration
init
(
truncatingBitPattern
:
Int
)
Construct a Int32
having the same bitwise representation as
the least significant bits of the provided bit pattern.
No range or overflow checking occurs.
Declaration
init
(
truncatingBitPattern
:
Int64
)
Construct a Int32
having the same bitwise representation as
the least significant bits of the provided bit pattern.
No range or overflow checking occurs.
Declaration
init
(
truncatingBitPattern
:
UInt
)
Construct a Int32
having the same bitwise representation as
the least significant bits of the provided bit pattern.
No range or overflow checking occurs.
Declaration
init
(
truncatingBitPattern
:
UInt64
)
Static Variables
Declaration
static
var
max
:
Int32
{
get
}
Declaration
static
var
min
:
Int32
{
get
}
Instance Variables
Returns the big-endian representation of the integer, changing the byte order if necessary.
Declaration
var
bigEndian
:
Int32
{
get
}
The hash value.
Axiom: x == y
implies x.hashValue == y.hashValue
.
Note: The hash value is not guaranteed to be stable across different invocations of the same program. Do not persist the hash value across program runs.
Declaration
var
hashValue
:
Int
{
get
}
Returns the little-endian representation of the integer, changing the byte order if necessary.
Declaration
var
littleEndian
:
Int32
{
get
}
Static Methods
Instance Methods
Declaration
func
advancedBy
(
n
:
Distance
) -
>
Int32
Declared In
Int32
, BidirectionalIndexType
, _RandomAccessAmbiguity
, ForwardIndexType
Declaration
func
distanceTo
(
other
:
Int32
) -
>
Distance
Declared In
Int32
, BidirectionalIndexType
, ForwardIndexType
Returns the previous consecutive value before self
.
Requires: The previous value is representable.
Declaration
func
predecessor
() -
>
Int32
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
:
Int32
,
by
stride
:
Int32
.
Stride
) -
>
StrideThrough
<
Int32
>
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
Declared In
Strideable
Returns the next consecutive value after self
.
Requires: The next value is representable.
Declaration
func
successor
() -
>
Int32
Represent this number using Swift's widest native signed integer type.
Declaration
func
toIntMax
() -
>
IntMax
3 inherited items hidden. (Show all)
A 32-bit signed integer value type.