struct Double
Inheritance |
AbsoluteValuable, CVarArgType, Comparable, CustomDebugStringConvertible, CustomStringConvertible, Equatable, FloatLiteralConvertible, FloatingPointType, Hashable, IntegerLiteralConvertible, SignedNumberType, Strideable, _CVarArgAlignedType, _CVarArgPassedAsDouble, _ObjectiveCBridgeable, _Reflectable
View Protocol Hierarchy →
|
---|---|
Import | import Swift |
Initializers
Create an instance initialized to value
.
Declaration
init(floatLiteral value: Double)
Create an instance initialized to value
.
Declaration
init(integerLiteral value: Int64)
Construct from an ASCII representation.
Returns the result of calling the POSIX function
strtod_l
using the "C" locale, unless
text
contains non-ASCII text or whitespace, or is not
completely consumed by the call. Otherwise, returns nil
.
See the strtod (3)
man page for details of
the exact format accepted.
Declaration
init?(_ text: String)
Static Variables
Instance Variables
A textual representation of self
.
Declaration
var debugDescription: String { get }
A textual representation of self
.
Declaration
var description: String { get }
The IEEE 754 "class" of this type.
Declaration
var floatingPointClass: FloatingPointClassification { get }
The hash value.
Axiom: x == y
implies x.hashValue == y.hashValue
.
Note: The hash value is not guaranteed to be stable across different invocations of the same program. Do not persist the hash value across program runs.
Declaration
var hashValue: Int { get }
true
iff self
is zero, subnormal, or normal (not infinity
or NaN).
Declaration
var isFinite: Bool { get }
true
iff self
is normal (not zero, subnormal, infinity, or
NaN).
Declaration
var isNormal: Bool { get }
Static Methods
Returns the absolute value of x
.
Declaration
static func abs(x: Double) -> Double
Instance Methods
Returns a Self
x
such that self.distanceTo(x)
approximates
n
.
Complexity: O(1).
Declaration
func advancedBy(amount: Double) -> Double
Returns a stride x
such that self.advancedBy(x)
approximates
other
.
Complexity: O(1).
Declaration
func distanceTo(other: Double) -> Double
Returns the sequence of values (self
, self + stride
, self +
stride + stride
, ... last) where last is the last value in
the progression less than or equal to end
.
Note: There is no guarantee that end
is an element of the sequence.
Declaration
func stride(through end: Double, by stride: Double.Stride) -> StrideThrough<Double>
Declared In
Strideable
Returns the sequence of values (self
, self + stride
, self +
stride + stride
, ... last) where last is the last value in
the progression that is less than end
.
Declaration
func stride(to end: Double, by stride: Double.Stride) -> StrideTo<Double>
Declared In
Strideable
A double-precision floating-point value type.