protocol
FloatingPointType
Inheritance |
Comparable, Equatable, Strideable, _Comparable, _Strideable
View Protocol Hierarchy →
|
---|---|
Associated Types |
A type that can represent the distance between two values of 1 inherited item hidden. (Show all) |
Import |
|
Initializers
Static Variables
The positive infinity.
Declaration
static
var
infinity
:
Self
{
get
}
Instance Variables
@{ IEEE 754-2008 Non-computational operations. The IEEE 754 "class" of this type.
Declaration
var
floatingPointClass
:
FloatingPointClassification
{
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
Declaration
static
func
_fromBitPattern
(
bits
:
_BitsType
) -
>
Self
Instance Methods
A strict total order
over instances of Self
Declaration
func
<
(
lhs
:
Self
,
rhs
:
Self
) -
>
Bool
Declared In
_Comparable
Return true if lhs
is equal to rhs
.
Equality implies substitutability. When x == y
, x
and
y
are interchangeable in any code that only depends on their
values.
Class instance identity as distinguished by triple-equals ===
is notably not part of an instance's value. Exposing other
non-value aspects of Equatable
types is discouraged, and any
that are exposed should be explicitly pointed out in
documentation.
Equality is an equivalence relation
x == x
istrue
x == y
impliesy == x
x == y
andy == z
impliesx == z
Inequality is the inverse of equality, i.e. !(x == y)
iff
x != y
Declaration
func
==(
lhs
:
Self
,
rhs
:
Self
) -
>
Bool
Declared In
Equatable
Returns a Self
x
such that self.distanceTo(x)
approximates
n
.
Complexity: O(1).
See also: RandomAccessIndexType
's advancedBy
, which
provides a stronger semantic guarantee.
Declaration
func
advancedBy
(
n
:
Stride
) -
>
Self
Declared In
_Strideable
Returns a stride x
such that self.advancedBy(x)
approximates
other
.
Complexity: O(1).
See also: RandomAccessIndexType
's distanceTo
, which provides a
stronger semantic guarantee.
Declaration
func
distanceTo
(
other
:
Self
) -
>
Stride
Declared In
_Strideable
7 inherited items hidden. (Show all)
A set of common requirements for Swift's floating point types.