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 equals function is invoked using infix notation as in the following code snippet: lhs == rhs.

    Declaration

    func equals(_ lhs: Double) -> Bool

    Parameters

    lhs

    A value.

    rhs

    Another value.

    Return Value

    true if the lhs and rhs are equal, false otherwise.