mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
9ead8781d4
Co-authored-by: Alex Martini <amartini@apple.com> Co-authored-by: Graham Lee <glee23@apple.com> Co-authored-by: Chris Adamson <cadamson@apple.com> Co-authored-by: Kirby Turner <kirby_turner@apple.com> Co-authored-by: Paris Pinkney <ppinkney@apple.com> Co-authored-by: Dave Spector <dspector@apple.com> Co-authored-by: Sofia Rodriguez Morales <sofia_rodriguez@apple.com> Co-authored-by: Ethan Kusters <ekusters@apple.com> Co-authored-by: Goli Mohammadi <g_mohammadi@apple.com> Co-authored-by: Adora Vaz <a_vaz@apple.com> Co-authored-by: David Rönnqvist <ronnqvist@apple.com> Co-authored-by: Nate Merseth Cook <natecook@apple.com> Co-authored-by: Susan Conant <susan_c@apple.com>
3.4 KiB
3.4 KiB
Swift/Int
Topics
Converting Integers
Swift/Int/init(_:)-4ekvlSwift/Int/init(exactly:)-b1dySwift/Int/init(clamping:)Swift/Int/init(truncatingIfNeeded:)Swift/Int/init(bitPattern:)-72037
Converting Floating-Point Values
Swift/Int/init(_:)-6gt9zSwift/Int/init(_:)-8vbwoSwift/Int/init(_:)-2oscbSwift/Int/init(_:)-3huv0Swift/Int/init(_:)-66i0w
Converting with No Loss of Precision
These initializers result in nil if the value passed can’t be represented without
any loss of precision.
Swift/Int/init(exactly:)-7yhn6Swift/Int/init(exactly:)-77kq8Swift/Int/init(exactly:)-7qdwfSwift/Int/init(exactly:)-5xh2sSwift/Int/init(exactly:)-5kot1
Converting Strings
Swift/Int/init(_:)-2hmiiSwift/Int/init(_:radix:)
Creating a Random Integer
Swift/Int/random(in:)-9mjpwSwift/Int/random(in:using:)-4lsb5Swift/Int/random(in:)-8zzqhSwift/Int/random(in:using:)-3dwv4
Performing Calculations
- doc:integer-operators
Swift/Int/negate()Swift/Int/quotientAndRemainder(dividingBy:)Swift/Int/isMultiple(of:)
Performing Calculations with Overflow
These methods return the result of an operation, and a flag indicating whether the operation overflowed the bounds of the type.
Swift/Int/addingReportingOverflow(_:)Swift/Int/subtractingReportingOverflow(_:)Swift/Int/multipliedReportingOverflow(by:)Swift/Int/dividedReportingOverflow(by:)Swift/Int/remainderReportingOverflow(dividingBy:)
Performing Double-Width Calculations
Swift/Int/multipliedFullWidth(by:)Swift/Int/dividingFullWidth(_:)
Finding the Sign and Magnitude
Swift/Int/magnitude-swift.propertySwift/Int/Magnitude-swift.typealiasSwift/abs(_:)Swift/Int/signum()
Accessing Numeric Constants
Swift/Int/zeroSwift/Int/minSwift/Int/maxSwift/Int/isSigned
Working with Byte Order
Swift/Int/byteSwappedSwift/Int/littleEndianSwift/Int/bigEndianSwift/Int/init(littleEndian:)Swift/Int/init(bigEndian:)
Working with Binary Representation
Swift/Int/bitWidth-swift.type.propertySwift/Int/bitWidth-swift.propertySwift/Int/nonzeroBitCountSwift/Int/leadingZeroBitCountSwift/Int/trailingZeroBitCountSwift/Int/words-swift.propertySwift/Int/Words-swift.struct
Working with Memory Addresses
These initializers create an integer with the bit pattern of the memory address of a pointer or class instance.
Swift/Int/init(bitPattern:)-2i0qySwift/Int/init(bitPattern:)-2o9coSwift/Int/init(bitPattern:)-5qm7a
Encoding and Decoding Values
Swift/Int/encode(to:)Swift/Int/init(from:)-5ru5
Describing an Integer
Swift/Int/descriptionSwift/Int/hash(into:)Swift/Int/customMirror
Infrequently Used Functionality
Swift/Int/init()Swift/Int/init(integerLiteral:)Swift/Int/IntegerLiteralTypeSwift/Int/distance(to:)Swift/Int/advanced(by:)
Deprecated
Swift/Int/customPlaygroundQuickLook
SIMD-Supporting Types
Swift/Int/SIMDMaskScalarSwift/Int/SIMD2StorageSwift/Int/SIMD4StorageSwift/Int/SIMD8StorageSwift/Int/SIMD16StorageSwift/Int/SIMD32StorageSwift/Int/SIMD64Storage