Double
A double-precision, floating-point value type.
@frozen struct Double
A double-precision, floating-point value type.
@frozen struct Double
import Swift
protocol AdditiveArithmetic : Equatable
A type with values that support addition and subtraction.
protocol BinaryFloatingPoint : ExpressibleByFloatLiteral, FloatingPoint
A radix-2 (binary) floating-point type.
protocol BitwiseCopyable : ~Escapable
protocol CVarArg
A type whose instances can be encoded, and appropriately passed, as elements of a C va_list
.
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomReflectable
A type that explicitly supplies its own mirror.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol ExpressibleByFloatLiteral
A type that can be initialized with a floating-point literal.
protocol ExpressibleByIntegerLiteral
A type that can be initialized with an integer literal.
protocol FloatingPoint : Hashable, SignedNumeric, Strideable where Self == Self.Magnitude
A floating-point numeric type.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol LosslessStringConvertible : CustomStringConvertible
A type that can be represented as a string in a lossless, unambiguous way.
protocol Numeric : AdditiveArithmetic, ExpressibleByIntegerLiteral
A type with values that support multiplication.
protocol SIMDScalar : BitwiseCopyable
A type that can be used as an element in a SIMD vector.
protocol Sendable
A thread-safe type whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races. Values of the type may have no shared mutable state, or they may protect that state with a lock or by forcing it to only be accessed from a specific actor.
protocol SignedNumeric : Numeric
A numeric type with a negation operation.
protocol Strideable<Stride> : Comparable
A type representing continuous, one-dimensional values that can be offset and measured.
protocol TextOutputStreamable
A source of text-streaming operations.
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 distance(to other: 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.
init<Source>(_ value: Source) where Source : BinaryFloatingPoint
Creates a new instance from the given value, rounded to the closest possible representation.
init<Source>(_ value: Source) where Source : BinaryInteger
Creates a new value, rounded to the closest possible representation.
init?<Source>(exactly value: Source) where Source : BinaryFloatingPoint
Creates a new instance from the given value, if it can be represented exactly.
init?<Source>(exactly value: Source) where Source : BinaryInteger
Creates a new value, if the given integer can be represented exactly.
init(integerLiteral value: Self)
init(signOf: Self, magnitudeOf: Self)
static var radix: Int { get }
static var ulpOfOne: Self { get }
static var zero: Self { get }
static func maximum(_ x: Self, _ y: Self) -> Self
static func maximumMagnitude(_ x: Self, _ y: Self) -> Self
static func minimum(_ x: Self, _ y: Self) -> Self
static func minimumMagnitude(_ x: Self, _ y: Self) -> Self
static func random(in range: ClosedRange<Self>) -> Self
Returns a random value within the specified range.
static func random(in range: Range<Self>) -> Self
Returns a random value within the specified range.
static func random<T>(in range: ClosedRange<Self>, using generator: inout T) -> Self where T : RandomNumberGenerator
Returns a random value within the specified range, using the given generator as a source for randomness.
static func random<T>(in range: Range<Self>, using generator: inout T) -> Self where T : RandomNumberGenerator
Returns a random value within the specified range, using the given generator as a source for randomness.
var floatingPointClass: FloatingPointClassification { get }
var nextDown: Self { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
static func + (x: Self) -> Self
Returns the given number unchanged.
static func += (lhs: inout Self, rhs: Self)
static func - (operand: Self) -> Self
static func -= (lhs: inout Self, rhs: Self)
static func ... (minimum: Self) -> PartialRangeFrom<Self>
Returns a partial range extending upward from a lower bound.
static func ... (maximum: Self) -> PartialRangeThrough<Self>
Returns a partial range up to, and including, its upper bound.
static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self>
Returns a closed range that contains both of its bounds.
static func ..< (maximum: Self) -> PartialRangeUpTo<Self>
Returns a partial range up to, but not including, its upper bound.
static func ..< (minimum: Self, maximum: Self) -> Range<Self>
Returns a half-open range that contains its lower bound but not its upper bound.
static func < (lhs: Self, rhs: Self) -> Bool
static func < (x: Self, y: Self) -> Bool
static func <= (lhs: Self, rhs: Self) -> Bool
static func <= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func == (lhs: Self, rhs: Self) -> Bool
static func == (x: Self, y: Self) -> Bool
static func > (lhs: Self, rhs: Self) -> Bool
static func > (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func >= (lhs: Self, rhs: Self) -> Bool
static func >= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.
func addingProduct(_ lhs: Self, _ rhs: Self) -> Self
func isTotallyOrdered(belowOrEqualTo other: Self) -> Bool
mutating func negate()
func remainder(dividingBy other: Self) -> Self
mutating func round()
func rounded() -> Self
func rounded(_ rule: FloatingPointRoundingRule) -> Self
func squareRoot() -> Self
func truncatingRemainder(dividingBy other: Self) -> Self
import _Differentiation
protocol Differentiable
A type that mathematically represents a differentiable manifold whose tangent spaces are finite-dimensional.
mutating func move(by offset: Double.TangentVector)
typealias TangentVector = Double
mutating func move(by offset: Self.TangentVector)
import Foundation
init(_ value: CGFloat)
init?(exactly number: NSNumber)
init(truncating number: NSNumber)
init(_ number: NSNumber)
import ArgumentParser
Straightforward, type-safe argument parsing for Swift.
protocol ExpressibleByArgument : _SendableMetatype
A type that can be expressed as a command-line argument.
protocol _SendableMetatype
static var allValueDescriptions: [String : String] { get }
static var allValueStrings: [String] { get }
static var defaultCompletionKind: CompletionKind { get }
var defaultValueDescription: String { get }
import SwiftSyntaxBuilder
SwiftSyntaxBuilder is a tool for generating Swift code in a convenient way using result builders.
protocol ExpressibleByLiteralSyntax
A Swift type whose value can be represented directly in source code by a Swift literal.
func makeLiteralSyntax() -> ExprSyntax