Structureswift 6.0.1Swift
Double
A double-precision, floating-point value type.
@frozen struct Double
Citizens in Swift
Conformances
protocol AdditiveArithmetic
A type with values that support addition and subtraction.
protocol BinaryFloatingPoint
A radix-2 (binary) floating-point type.
protocol BitwiseCopyable
protocol CVarArg
A type whose instances can be encoded, and appropriately passed, as elements of a C
va_list
.protocol Comparable
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
A floating-point numeric type.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol LosslessStringConvertible
A type that can be represented as a string in a lossless, unambiguous way.
protocol Numeric
A type with values that support multiplication.
protocol SIMDScalar
A type that can be used as an element in a SIMD vector.
protocol Sendable
protocol SignedNumeric
A numeric type with a negation operation.
protocol Strideable<Stride>
A type representing continuous, one-dimensional values that can be offset and measured.
protocol TextOutputStreamable
A source of text-streaming operations.
Types
struct SIMD16Storage
Storage for a vector of 16 floating-point values.
struct SIMD2Storage
Storage for a vector of two floating-point values.
struct SIMD32Storage
Storage for a vector of 32 floating-point values.
struct SIMD4Storage
Storage for a vector of four floating-point values.
struct SIMD64Storage
Storage for a vector of 64 floating-point values.
struct SIMD8Storage
Storage for a vector of eight floating-point values.
Typealiases
Type members
init(
) init(Double
) Creates a new instance initialized to the given value.
init(Float
) Creates a new instance that approximates the given value.
init?(Substring
) init?<S>(S
) Creates a new instance from the given string.
init(Int
) init(Float16
) Creates a new instance that approximates the given value.
init<Source>(Source
) init(bitPattern: UInt64
) Creates a new value with the given bit pattern.
init?(exactly: Double
) Creates a new instance initialized to the given value, if it can be represented without rounding.
init?(exactly: Float
) Creates a new instance initialized to the given value, if it can be represented without rounding.
init?(exactly: Float16
) Creates a new instance initialized to the given value, if it can be represented without rounding.
init?<Source>(exactly: Source
) init(floatLiteral: Double
) init(from: any Decoder
) throws init(integerLiteral: Int64
) init(nan: 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: Double, magnitudeOf: Double
) static var exponentBitCount: Int
static var greatestFiniteMagnitude: Double
static var infinity: Double
static var leastNonzeroMagnitude: Double
static var leastNormalMagnitude: Double
static var nan: Double
static var pi: Double
static var signalingNaN: Double
static var significandBitCount: Int
static var ulpOfOne: Double
The unit in the last place of 1.0.
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
)
Instance members
var binade: Double
var bitPattern: UInt64
The bit pattern of the value’s encoding.
var customMirror: Mirror
A mirror that reflects the
Double
instance.var debugDescription: String
A textual representation of the value, suitable for debugging.
var description: String
A textual representation of the value.
var exponent: Int
var exponentBitPattern: UInt
var isCanonical: Bool
var isFinite: Bool
var isInfinite: Bool
var isNaN: Bool
var isNormal: Bool
var isSignalingNaN: Bool
var isSubnormal: Bool
var isZero: Bool
var magnitude: Double
var nextUp: Double
var sign: FloatingPointSign
var significand: Double
var significandBitPattern: UInt64
var significandWidth: Int
var ulp: Double
func addProduct(Double, Double
) func advanced(by: Double
) -> Double func distance(to: Double
) -> Double func encode(to: any Encoder
) throws Encodes this value into the given encoder.
func formRemainder(dividingBy: Double
) func formSquareRoot(
) func formTruncatingRemainder(dividingBy: Double
) func hash(into: inout Hasher
) func isEqual(to: Double
) -> Bool func isLess(than: Double
) -> Bool func isLessThanOrEqualTo(Double
) -> Bool func negate(
) func round(FloatingPointRoundingRule
) func write<Target>(to: inout Target
)
Show obsolete interfaces (1)
Hide obsolete interfaces
var customPlaygroundQuickLook: _PlaygroundQuickLook
A custom playground Quick Look for the
Double
instance.
Type features
init<Source>(Source
) Creates a new instance from the given value, rounded to the closest possible representation.
init<Source>(Source
) Creates a new value, rounded to the closest possible representation.
init?<Source>(exactly: Source
) Creates a new instance from the given value, if it can be represented exactly.
init?<Source>(exactly: Source
) Creates a new value, if the given integer can be represented exactly.
init(integerLiteral: Self
) init(signOf: Self, magnitudeOf: Self
) static var radix: Int
static var ulpOfOne: Self
static var zero: Self
The zero value.
static func maximum(Self, Self
) -> Self static func maximumMagnitude(Self, Self
) -> Self static func minimum(Self, Self
) -> Self static func minimumMagnitude(Self, Self
) -> Self static func random(in: ClosedRange<Self>
) -> Self Returns a random value within the specified range.
static func random(in: Range<Self>
) -> Self Returns a random value within the specified range.
static func random<T>(in: ClosedRange<Self>, using: inout T
) -> Self Returns a random value within the specified range, using the given generator as a source for randomness.
static func random<T>(in: Range<Self>, using: inout T
) -> Self Returns a random value within the specified range, using the given generator as a source for randomness.
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 Returns the additive inverse of the specified value.
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.
Instance features
var floatingPointClass: FloatingPointClassification
var nextDown: Self
func addingProduct(Self, Self
) -> Self func isTotallyOrdered(belowOrEqualTo: Self
) -> Bool func negate(
) Replaces this value with its additive inverse.
func remainder(dividingBy: Self
) -> Self func round(
) func rounded(
) -> Self func rounded(FloatingPointRoundingRule
) -> Self func squareRoot(
) -> Self func truncatingRemainder(dividingBy: Self
) -> Self
Available in _Differentiation
Conformances
protocol Differentiable
A type that mathematically represents a differentiable manifold whose tangent spaces are finite-dimensional.
Typealiases
Instance members
Instance features
Available in Synchronization
Conformances
protocol AtomicRepresentable
A type that supports atomic operations through a separate atomic storage representation.
Typealiases
Type members
Available in Foundation
Type members
Show obsolete interfaces (1)
Hide obsolete interfaces
Extension in RealModule
Conformances
protocol AlgebraicField
A type modeling an algebraic field. Refines the
SignedNumeric
protocol, adding division.protocol ElementaryFunctions
A type that has elementary functions available.
protocol Real
A type that models the real numbers.
protocol RealFunctions
Type members
static func acos(Double
) -> Double static func acosh(Double
) -> Double static func asin(Double
) -> Double static func asinh(Double
) -> Double static func atan(Double
) -> Double static func atan2(y: Double, x: Double
) -> Double static func atanh(Double
) -> Double static func cos(Double
) -> Double static func cosh(Double
) -> Double static func erf(Double
) -> Double static func erfc(Double
) -> Double static func exp(Double
) -> Double static func exp2(Double
) -> Double static func expMinusOne(Double
) -> Double static func gamma(Double
) -> Double static func hypot(Double, Double
) -> Double static func log(Double
) -> Double static func log(onePlus: Double
) -> Double static func log10(Double
) -> Double static func log2(Double
) -> Double static func logGamma(Double
) -> Double static func pow(Double, Double
) -> Double static func pow(Double, Int
) -> Double static func root(Double, Int
) -> Double static func sin(Double
) -> Double static func sinh(Double
) -> Double static func tan(Double
) -> Double static func tanh(Double
) -> Double
Show implementation details (1)
Hide implementation details
Type features
static func cosMinusOne(Self
) -> Self cos(x) - 1, computed in such a way as to maintain accuracy for small x.
static func exp10(Self
) -> Self static func signGamma(Self
) -> FloatingPointSign static func sqrt(Self
) -> Self static func / (a: Self, b: Self
) -> Self
Show implementation details (1)
Hide implementation details
Instance features
var reciprocal: Self?
The (approximate) reciprocal (multiplicative inverse) of this number, if it is representable.