Double
class Double
Variables of type Double hold fractional numbers and can be used for calculating fractional quantities. Any number of the form X.Y is a Double Examples: (1, -2, 35.67, -2.0, 0.5154, …)
-
The object’s description
Declaration
var description: String { get } -
Compares two values for equality.
The
equalsfunction is invoked using infix notation as in the following code snippet:lhs == rhs.Declaration
func equals(_ lhs: Double) -> BoolParameters
lhsA value.
rhsAnother value.
Return Value
trueif thelhsandrhsare equal,falseotherwise. -
Returns the remainder of this value divided by the given
divisorusing truncating division.Declaration
func truncatingRemainder(dividingBy divisor: Double) -> DoubleParameters
divisorThe number used to divide
self.Return Value
The remainder obtained from dividing
selfbydivisor. -
Returns this value rounded to an integral value using “schoolbook rounding.
Declaration
func rounded() -> DoubleReturn Value
The nearest integral value, or, if two integral values are equally close, the integral value with greater magnitude.