---
title: Double
framework: swift
role: symbol
role_heading: Structure
path: swift/double
---

# Double

A double-precision (64-bit), floating-point value type.

## Declaration

```swift
@frozen struct Double
```

## Topics

### Converting Integers

- [init(_:)](swift/double/init(_:)-5blrp.md)
- [init(_:)](swift/double/init(_:)-84ohu.md)

### Converting Strings

- [init(_:)](swift/double/init(_:)-5wmm8.md)
- [init(_:)](swift/double/init(_:)-15kej.md)

### Converting Floating-Point Values

- [init(_:)](swift/double/init(_:)-1488d.md)
- [init(_:)](swift/double/init(_:)-o1k9.md)
- [init(_:)](swift/double/init(_:)-5h7qh.md)
- [init(_:)](swift/double/init(_:)-aeox.md)
- [init(_:)](swift/double/init(_:)-9z7ob.md)
- [init(_:)](swift/double/init(_:)-7ag2w.md)
- [init(sign:exponent:significand:)](swift/double/init(sign:exponent:significand:).md)
- [init(signOf:magnitudeOf:)](swift/double/init(signof:magnitudeof:).md)
- [init(_:)](swift/double/init(_:)-1oh9r.md)
- [init(truncating:)](swift/double/init(truncating:).md)

### Converting with No Loss of Precision

- [init(exactly:)](swift/double/init(exactly:)-8esra.md)
- [init(exactly:)](swift/double/init(exactly:)-1h1oc.md)
- [init(exactly:)](swift/double/init(exactly:)-2uexo.md)
- [init(exactly:)](swift/double/init(exactly:)-2l6p1.md)
- [init(exactly:)](swift/double/init(exactly:)-7cl0t.md)
- [init(exactly:)](swift/double/init(exactly:)-50ofc.md)
- [init(exactly:)](swift/double/init(exactly:)-63925.md)
- [init(exactly:)](swift/double/init(exactly:)-8e00y.md)

### Creating a Random Value

- [random(in:)](swift/double/random(in:)-6idef.md)
- [random(in:using:)](swift/double/random(in:using:)-1m6gd.md)
- [random(in:)](swift/double/random(in:)-5o5ha.md)
- [random(in:using:)](swift/double/random(in:using:)-613hz.md)

### Performing Calculations

- [Floating-Point Operators for Double](swift/floating-point-operators-for-double.md)
- [addingProduct(_:_:)](swift/double/addingproduct(_:_:).md)
- [addProduct(_:_:)](swift/double/addproduct(_:_:).md)
- [squareRoot()](swift/double/squareroot().md)
- [formSquareRoot()](swift/double/formsquareroot().md)
- [remainder(dividingBy:)](swift/double/remainder(dividingby:).md)
- [formRemainder(dividingBy:)](swift/double/formremainder(dividingby:).md)
- [truncatingRemainder(dividingBy:)](swift/double/truncatingremainder(dividingby:).md)
- [formTruncatingRemainder(dividingBy:)](swift/double/formtruncatingremainder(dividingby:).md)
- [negate()](swift/double/negate().md)

### Rounding Values

- [rounded()](swift/double/rounded().md)
- [rounded(_:)](swift/double/rounded(_:).md)
- [round()](swift/double/round().md)
- [round(_:)](swift/double/round(_:).md)

### Comparing Values

- [Floating-Point Operators for Double](swift/floating-point-operators-for-double.md)
- [isEqual(to:)](swift/double/isequal(to:).md)
- [isLess(than:)](swift/double/isless(than:).md)
- [isLessThanOrEqualTo(_:)](swift/double/islessthanorequalto(_:).md)
- [isTotallyOrdered(belowOrEqualTo:)](swift/double/istotallyordered(beloworequalto:).md)
- [minimum(_:_:)](swift/double/minimum(_:_:).md)
- [minimumMagnitude(_:_:)](swift/double/minimummagnitude(_:_:).md)
- [maximum(_:_:)](swift/double/maximum(_:_:).md)
- [maximumMagnitude(_:_:)](swift/double/maximummagnitude(_:_:).md)

### Finding the Sign and Magnitude

- [magnitude](swift/double/magnitude-swift.property.md)
- [sign](swift/double/sign.md)
- [Double.Magnitude](swift/double/magnitude-swift.typealias.md)

### Querying a Double

- [ulp](swift/double/ulp.md)
- [significand](swift/double/significand.md)
- [exponent](swift/double/exponent-swift.property.md)
- [nextUp](swift/double/nextup.md)
- [nextDown](swift/double/nextdown.md)
- [binade](swift/double/binade.md)

### Accessing Numeric Constants

- [pi](swift/double/pi.md)
- [infinity](swift/double/infinity.md)
- [greatestFiniteMagnitude](swift/double/greatestfinitemagnitude.md)
- [nan](swift/double/nan.md)
- [signalingNaN](swift/double/signalingnan.md)
- [ulpOfOne](swift/double/ulpofone.md)
- [leastNonzeroMagnitude](swift/double/leastnonzeromagnitude.md)
- [leastNormalMagnitude](swift/double/leastnormalmagnitude.md)
- [zero](swift/double/zero.md)

### Working with Binary Representation

- [bitPattern](swift/double/bitpattern.md)
- [significandBitPattern](swift/double/significandbitpattern.md)
- [significandWidth](swift/double/significandwidth.md)
- [exponentBitPattern](swift/double/exponentbitpattern.md)
- [significandBitCount](swift/double/significandbitcount.md)
- [exponentBitCount](swift/double/exponentbitcount.md)
- [radix](swift/double/radix.md)
- [init(bitPattern:)](swift/double/init(bitpattern:).md)
- [init(sign:exponentBitPattern:significandBitPattern:)](swift/double/init(sign:exponentbitpattern:significandbitpattern:).md)
- [init(nan:signaling:)](swift/double/init(nan:signaling:).md)
- [Double.Exponent](swift/double/exponent-swift.typealias.md)
- [Double.RawSignificand](swift/double/rawsignificand.md)
- [Double.RawExponent](swift/double/rawexponent.md)

### Querying a Double’s State

- [isZero](swift/double/iszero.md)
- [isFinite](swift/double/isfinite.md)
- [isInfinite](swift/double/isinfinite.md)
- [isNaN](swift/double/isnan.md)
- [isSignalingNaN](swift/double/issignalingnan.md)
- [isNormal](swift/double/isnormal.md)
- [isSubnormal](swift/double/issubnormal.md)
- [isCanonical](swift/double/iscanonical.md)
- [floatingPointClass](swift/double/floatingpointclass.md)

### Encoding and Decoding Values

- [encode(to:)](swift/double/encode(to:).md)
- [init(from:)](swift/double/init(from:).md)

### Creating a Range

- [...(_:_:)](swift/double/'...(_:_:).md)

### Describing a Double

- [description](swift/double/description.md)
- [debugDescription](swift/double/debugdescription.md)
- [customMirror](swift/double/custommirror.md)
- [hash(into:)](swift/double/hash(into:).md)

### Infrequently Used Functionality

- [init()](swift/double/init().md)
- [init(floatLiteral:)](swift/double/init(floatliteral:).md)
- [init(integerLiteral:)](swift/double/init(integerliteral:).md)
- [init(integerLiteral:)](swift/double/init(integerliteral:)-6hc7j.md)
- [Double.FloatLiteralType](swift/double/floatliteraltype.md)
- [Double.IntegerLiteralType](swift/double/integerliteraltype.md)
- [advanced(by:)](swift/double/advanced(by:).md)
- [distance(to:)](swift/double/distance(to:).md)
- [Double.Stride](swift/double/stride.md)
- [write(to:)](swift/double/write(to:).md)
- [hashValue](swift/double/hashvalue.md)

### SIMD-Supporting Types

- [Double.SIMDMaskScalar](swift/double/simdmaskscalar.md)
- [Double.SIMD2Storage](swift/double/simd2storage.md)
- [Double.SIMD4Storage](swift/double/simd4storage.md)
- [Double.SIMD8Storage](swift/double/simd8storage.md)
- [Double.SIMD16Storage](swift/double/simd16storage.md)
- [Double.SIMD32Storage](swift/double/simd32storage.md)
- [Double.SIMD64Storage](swift/double/simd64storage.md)

### Deprecated

- [customPlaygroundQuickLook](swift/double/customplaygroundquicklook.md)
- [init(_:)](swift/double/init(_:)-8kme5.md)

### Type Aliases

- [Double.Specification](swift/double/specification.md)
- [Double.UnwrappedType](swift/double/unwrappedtype.md)
- [Double.ValueType](swift/double/valuetype.md)

### Type Properties

- [defaultResolverSpecification](swift/double/defaultresolverspecification.md)
- [mlMultiArrayDataType](swift/double/mlmultiarraydatatype.md)

### Default Implementations

- [AdditiveArithmetic Implementations](swift/double/additivearithmetic-implementations.md)
- [AtomicRepresentable Implementations](swift/double/atomicrepresentable-implementations.md)
- [BinaryFloatingPoint Implementations](swift/double/binaryfloatingpoint-implementations.md)
- [Comparable Implementations](swift/double/comparable-implementations.md)
- [CustomDebugStringConvertible Implementations](swift/double/customdebugstringconvertible-implementations.md)
- [CustomReflectable Implementations](swift/double/customreflectable-implementations.md)
- [CustomStringConvertible Implementations](swift/double/customstringconvertible-implementations.md)
- [Decodable Implementations](swift/double/decodable-implementations.md)
- [Encodable Implementations](swift/double/encodable-implementations.md)
- [Equatable Implementations](swift/double/equatable-implementations.md)
- [ExpressibleByFloatLiteral Implementations](swift/double/expressiblebyfloatliteral-implementations.md)
- [ExpressibleByIntegerLiteral Implementations](swift/double/expressiblebyintegerliteral-implementations.md)
- [FloatingPoint Implementations](swift/double/floatingpoint-implementations.md)
- [Hashable Implementations](swift/double/hashable-implementations.md)
- [LosslessStringConvertible Implementations](swift/double/losslessstringconvertible-implementations.md)
- [Numeric Implementations](swift/double/numeric-implementations.md)
- [SIMDScalar Implementations](swift/double/simdscalar-implementations.md)
- [SignedNumeric Implementations](swift/double/signednumeric-implementations.md)
- [Strideable Implementations](swift/double/strideable-implementations.md)
- [TextOutputStreamable Implementations](swift/double/textoutputstreamable-implementations.md)

## Relationships

### Conforms To

- [AdditiveArithmetic](swift/additivearithmetic.md)
- [Animatable](swiftui/animatable.md)
- [AnimatableData](realitykit/animatabledata.md)
- [AtomicRepresentable](synchronization/atomicrepresentable.md)
- [BinaryFloatingPoint](swift/binaryfloatingpoint.md)
- [BindableData](realitykit/bindabledata.md)
- [BitwiseCopyable](swift/bitwisecopyable.md)
- [CKRecordValueProtocol](cloudkit/ckrecordvalueprotocol.md)
- [CVAttachmentValueRepresentable](corevideo/cvattachmentvaluerepresentable.md)
- [CVarArg](swift/cvararg.md)
- [Comparable](swift/comparable.md)
- [ConvertibleFromGeneratedContent](foundationmodels/convertiblefromgeneratedcontent.md)
- [ConvertibleToGeneratedContent](foundationmodels/convertibletogeneratedcontent.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [ExpressibleByFloatLiteral](swift/expressiblebyfloatliteral.md)
- [ExpressibleByIntegerLiteral](swift/expressiblebyintegerliteral.md)
- [FloatingPoint](swift/floatingpoint.md)
- [Generable](foundationmodels/generable.md)
- [Hashable](swift/hashable.md)
- [InstructionsRepresentable](foundationmodels/instructionsrepresentable.md)
- [IntentValueConvertible](appintents/intentvalueconvertible.md)
- [IntentValueExpressing](appintents/intentvalueexpressing.md)
- [LosslessStringConvertible](swift/losslessstringconvertible.md)
- [MLDataValueConvertible](createml/mldatavalueconvertible.md)
- [MLShapedArrayScalar](coreml/mlshapedarrayscalar.md)
- [Numeric](swift/numeric.md)
- [Plottable](charts/plottable.md)
- [PrimitivePlottableProtocol](charts/primitiveplottableprotocol.md)
- [PromptRepresentable](foundationmodels/promptrepresentable.md)
- [RangeComparableProperty](appintents/rangecomparableproperty.md)
- [SIMDScalar](swift/simdscalar.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SignedNumeric](swift/signednumeric.md)
- [Strideable](swift/strideable.md)
- [TextOutputStreamable](swift/textoutputstreamable.md)
- [USDPrim.Attribute.MetadataValue](usdkit/usdprim/attribute/metadatavalue.md)
- [USDPrim.Attribute.Value](usdkit/usdprim/attribute/value.md)
- [USDValueProtocol](usdkit/usdvalueprotocol.md)
- [VectorArithmetic](swiftui/vectorarithmetic.md)
- [vDSP_DiscreteFourierTransformable](accelerate/vdsp_discretefouriertransformable.md)
- [vDSP_FloatingPointBiquadFilterable](accelerate/vdsp_floatingpointbiquadfilterable.md)
- [vDSP_FloatingPointConvertable](accelerate/vdsp_floatingpointconvertable.md)
- [vDSP_FloatingPointDiscreteFourierTransformable](accelerate/vdsp_floatingpointdiscretefouriertransformable.md)
- [vDSP_FloatingPointGeneratable](accelerate/vdsp_floatingpointgeneratable.md)

## See Also

### Standard Library

- [Int](swift/int.md)
- [String](swift/string.md)
- [Array](swift/array.md)
- [Dictionary](swift/dictionary.md)
- [Swift Standard Library](swift/swift-standard-library.md)
