Double
A double-precision (64-bit), floating-point value type.
Declaration
@frozen struct DoubleTopics
Converting Integers
Converting Strings
Converting Floating-Point Values
init(_:)init(_:)init(_:)init(_:)init(_:)init(_:)init(sign:exponent:significand:)init(signOf:magnitudeOf:)init(_:)init(truncating:)
Converting with No Loss of Precision
init(exactly:)init(exactly:)init(exactly:)init(exactly:)init(exactly:)init(exactly:)init(exactly:)init(exactly:)
Creating a Random Value
Performing Calculations
Floating-Point Operators for DoubleaddingProduct(_:_:)addProduct(_:_:)squareRoot()formSquareRoot()remainder(dividingBy:)formRemainder(dividingBy:)truncatingRemainder(dividingBy:)formTruncatingRemainder(dividingBy:)negate()
Rounding Values
Comparing Values
Floating-Point Operators for DoubleisEqual(to:)isLess(than:)isLessThanOrEqualTo(_:)isTotallyOrdered(belowOrEqualTo:)minimum(_:_:)minimumMagnitude(_:_:)maximum(_:_:)maximumMagnitude(_:_:)
Finding the Sign and Magnitude
Querying a Double
Accessing Numeric Constants
piinfinitygreatestFiniteMagnitudenansignalingNaNulpOfOneleastNonzeroMagnitudeleastNormalMagnitudezero
Working with Binary Representation
bitPatternsignificandBitPatternsignificandWidthexponentBitPatternsignificandBitCountexponentBitCountradixinit(bitPattern:)init(sign:exponentBitPattern:significandBitPattern:)init(nan:signaling:)Double.ExponentDouble.RawSignificandDouble.RawExponent
Querying a Double’s State
Encoding and Decoding Values
Creating a Range
Describing a Double
Infrequently Used Functionality
init()init(floatLiteral:)init(integerLiteral:)init(integerLiteral:)Double.FloatLiteralTypeDouble.IntegerLiteralTypeadvanced(by:)distance(to:)Double.Stridewrite(to:)hashValue
SIMD-Supporting Types
Double.SIMDMaskScalarDouble.SIMD2StorageDouble.SIMD4StorageDouble.SIMD8StorageDouble.SIMD16StorageDouble.SIMD32StorageDouble.SIMD64Storage
Deprecated
Type Aliases
Type Properties
Default Implementations
AdditiveArithmetic ImplementationsAtomicRepresentable ImplementationsBinaryFloatingPoint ImplementationsComparable ImplementationsCustomDebugStringConvertible ImplementationsCustomReflectable ImplementationsCustomStringConvertible ImplementationsDecodable ImplementationsEncodable ImplementationsEquatable ImplementationsExpressibleByFloatLiteral ImplementationsExpressibleByIntegerLiteral ImplementationsFloatingPoint ImplementationsHashable ImplementationsLosslessStringConvertible ImplementationsNumeric ImplementationsSIMDScalar ImplementationsSignedNumeric ImplementationsStrideable ImplementationsTextOutputStreamable Implementations