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 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 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 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
A type whose values can safely be passed across concurrency domains by copying.
protocol SignedNumeric
A numeric type with a negation operation.
protocol Strideable
A type representing continuous, one-dimensional values that can be offset and measured.
protocol TextOutputStreamable
A source of text-streaming operations.
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(Float80
) 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?(exactly: Float80
) 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: Decoder
) throws Creates a new instance by decoding from the given decoder.
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.
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
static func * (Double, Double
) -> Double static func *= (inout Double, Double
) static func + (Double, Double
) -> Double static func += (inout Double, Double
) static func - (Double
) -> Double static func - (Double, Double
) -> Double static func -= (inout Double, Double
) static func / (Double, Double
) -> Double static func /= (inout Double, Double
) func addProduct(Double, Double
) func advanced(by: Double
) -> Double func distance(to: Double
) -> Double func encode(to: 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
) 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.
typealias Exponent
typealias Magnitude
typealias RawSignificand
typealias SIMDMaskScalar
var customPlaygroundQuickLook: _PlaygroundQuickLook
A custom playground Quick Look for the
Double
instance.
Features
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 != (Self, Self
) -> Bool static func + (Self
) -> Self Returns the given number unchanged.
static func ... (Self
) -> PartialRangeFrom<Self> Returns a partial range extending upward from a lower bound.
static func ... (Self
) -> PartialRangeThrough<Self> Returns a partial range up to, and including, its upper bound.
static func ... (Self, Self
) -> ClosedRange<Self> Returns a closed range that contains both of its bounds.
static func ..< (Self
) -> PartialRangeUpTo<Self> Returns a partial range up to, but not including, its upper bound.
static func ..< (Self, Self
) -> Range<Self> Returns a half-open range that contains its lower bound but not its upper bound.
static func < (Self, Self
) -> Bool static func <= (Self, Self
) -> Bool static func == (Self, Self
) -> Bool static func == (Self, Self
) -> Bool static func > (Self, Self
) -> Bool static func >= (Self, Self
) -> Bool func round(
) func rounded(
) -> Self
Available in _Differentiation
Conformances
protocol Differentiable
A type that mathematically represents a differentiable manifold whose tangent spaces are finite-dimensional.
Members
Available in Foundation
Members
Extension in BSON
Conformances
Features
Extension in MultipartKit
Conformances
Members
Extension in ArgumentParser
Conformances
protocol ExpressibleByArgument
A type that can be expressed as a command-line argument.
Extension in JSONDecoding
Conformances
protocol JSONDecodable
A type that can be decoded from a JSON variant value.
Members
Extension in BSONDecoding
Conformances
protocol BSONDecodable
A type that can be decoded from a BSON variant value backed by some type of storage not particular to the decoded type.
Extension in BSONEncoding
Conformances
protocol BSONEncodable
A type that can be encoded to a BSON variant value.
Members
func encode(to: inout BSON.Field
) Encodes this metatype as a value of type
BSON.double
.
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
Members
static func _mulAdd(Double, Double, Double
) -> Double 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
Features
static func cosMinusOne(Self
) -> Self cos(x) - 1, computed in such a way as to maintain accuracy for small x.
static func sqrt(Self
) -> Self
Extension in SwiftSyntaxBuilder
Conformances
protocol ExpressibleByLiteralSyntax
A Swift type whose value can be represented directly in source code by a Swift literal.
Extension in JSONDecoding
Conformances
protocol JSONDecodable
A type that can be decoded from a JSON variant value.
Members
Extension in Vapor
Conformances
protocol AsyncRequestDecodable
Can convert
Request
to aSelf
.protocol AsyncResponseEncodable
Can convert
self
to aResponse
.protocol Content
Convertible to / from content in an HTTP message.
protocol RequestDecodable
Can convert
Request
to aSelf
.protocol ResponseEncodable
Can convert
self
to aResponse
.
Features
func encodeResponse(status: HTTPStatus, headers: HTTPHeaders, for: Request
) -> EventLoopFuture<Response> Asynchronously encodes
Self
into aResponse
, setting the supplied status and headers.