distance(to:)
func distance(to other: Double) -> Double
func distance(to other: Double) -> Double
import Swift
@frozen struct Double
A double-precision, floating-point value type.
init()
init(_ other: Double)
Creates a new instance initialized to the given value.
init(_ other: Float)
Creates a new instance that approximates the given value.
init?(_ text: Substring)
init?<S>(_ text: S) where S : StringProtocol
Creates a new instance from the given string.
init(_ v: Int)
init(_ other: Float16)
Creates a new instance that approximates the given value.
init<Source>(_ value: Source) where Source : BinaryInteger
init(bitPattern: UInt64)
Creates a new value with the given bit pattern.
init?(exactly other: Double)
Creates a new instance initialized to the given value, if it can be represented without rounding.
init?(exactly other: Float)
Creates a new instance initialized to the given value, if it can be represented without rounding.
init?(exactly other: Float16)
Creates a new instance initialized to the given value, if it can be represented without rounding.
init?<Source>(exactly value: Source) where Source : BinaryInteger
init(floatLiteral value: Double)
init(from decoder: any Decoder) throws
init(integerLiteral value: Int64)
init(nan payload: Double.RawSignificand, signaling: Bool)
Creates a NaN (“not a number”) value with the specified payload.
init(sign: FloatingPointSign, exponent: Int, significand: Double)
init(sign: FloatingPointSign, exponentBitPattern: UInt, significandBitPattern: UInt64)
init(signOf sign: Double, magnitudeOf mag: Double)
static var exponentBitCount: Int { get }
static var greatestFiniteMagnitude: Double { get }
static var infinity: Double { get }
static var leastNonzeroMagnitude: Double { get }
static var leastNormalMagnitude: Double { get }
static var nan: Double { get }
static var pi: Double { get }
static var signalingNaN: Double { get }
static var significandBitCount: Int { get }
static var ulpOfOne: Double { get }
The unit in the last place of 1.0.
var binade: Double { get }
var bitPattern: UInt64 { get }
The bit pattern of the value’s encoding.
var customMirror: Mirror { get }
A mirror that reflects the Double
instance.
var debugDescription: String { get }
A textual representation of the value, suitable for debugging.
var description: String { get }
A textual representation of the value.
var exponent: Int { get }
var exponentBitPattern: UInt { get }
var isCanonical: Bool { get }
var isFinite: Bool { get }
var isInfinite: Bool { get }
var isNaN: Bool { get }
var isNormal: Bool { get }
var isSignalingNaN: Bool { get }
var isSubnormal: Bool { get }
var isZero: Bool { get }
var magnitude: Double { get }
var nextUp: Double { get }
var sign: FloatingPointSign { get }
var significand: Double { get }
var significandBitPattern: UInt64 { get }
var significandWidth: Int { get }
var ulp: Double { get }
static func * (lhs: Double, rhs: Double) -> Double
static func *= (lhs: inout Double, rhs: Double)
static func + (lhs: Double, rhs: Double) -> Double
static func += (lhs: inout Double, rhs: Double)
static func - (x: Double) -> Double
static func - (lhs: Double, rhs: Double) -> Double
static func -= (lhs: inout Double, rhs: Double)
static func / (lhs: Double, rhs: Double) -> Double
static func /= (lhs: inout Double, rhs: Double)
mutating func addProduct(_ lhs: Double, _ rhs: Double)
func advanced(by amount: Double) -> Double
func encode(to encoder: any Encoder) throws
Encodes this value into the given encoder.
mutating func formRemainder(dividingBy other: Double)
mutating func formSquareRoot()
mutating func formTruncatingRemainder(dividingBy other: Double)
func hash(into hasher: inout Hasher)
func isEqual(to other: Double) -> Bool
func isLess(than other: Double) -> Bool
func isLessThanOrEqualTo(_ other: Double) -> Bool
mutating func negate()
mutating func round(_ rule: FloatingPointRoundingRule)
func write<Target>(to target: inout Target) where Target : TextOutputStream
@frozen struct SIMD16Storage
Storage for a vector of 16 floating-point values.
@frozen struct SIMD2Storage
Storage for a vector of two floating-point values.
@frozen struct SIMD32Storage
Storage for a vector of 32 floating-point values.
@frozen struct SIMD4Storage
Storage for a vector of four floating-point values.
@frozen struct SIMD64Storage
Storage for a vector of 64 floating-point values.
@frozen struct SIMD8Storage
Storage for a vector of eight floating-point values.
typealias Exponent = Int
typealias Magnitude = Double
typealias RawSignificand = UInt64
typealias SIMDMaskScalar = Int64
var customPlaygroundQuickLook: _PlaygroundQuickLook { get }
A custom playground Quick Look for the Double
instance.